From 44c8d2e1347473f885024c590ed8b1b798a039a3 Mon Sep 17 00:00:00 2001
From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com>
Date: Fri, 18 Oct 2019 05:48:12 +0000
Subject: [PATCH] [AutoPR preview/costmanagement/mgmt/2019-10-01]
CostManagement RP- Introducing API Version 2019-10-01 plus adding Modern
Commerce Account Scopes to Query and Dimension APIs. (#746)
* Generated from 16ff787a51dc55db850a3486cccf7780722c1e41 (#6018)
Revert changes in input-files to avoid errors
* Generated from 0e60fa1cd6adba0b91d7c91ebaaa4fc65c110b4b (#6017)
fixing the build
* Generated from fecc99c28f9ff6521a2cce0d481429b2b4ab78b5 (#6050)
include property in update as well
* Generated from 470b9dc33f877037875aca6fcedbbd845b88ba78 (#6028)
Update advisor.json
* Generated from f639fa1a11578b5cad9c3a155da216117d6e0059 (#6036)
chore: jsonfmt appplatform
* Generated from c7ff553c30947fdc9a3e133cc8c1ec3740abc0ac (#6046)
[SRP] Support Active Directory and regenerate kerb keys
* Add Go 1.13 to CI (#6061)
Updated Ubuntu image to 18.04.
Removed travis CI file.
* [AutoPR policyinsights/resource-manager] Adding a baseline folder for PolicyInsights 2019-10-01. Contents are same as prior version, I will make changes once this PR is complete. (#6041)
* Generated from 551a94e578553160c7a3ef54b75a2cdff76acc5a
fix go build error
* Generated from 964ec2957f79ce66ce1f0010e15d774904c753c7
Added spec json files for other resources to be added to the package. Also updated policyStates.json as per latest API changes.
* Generated from 33073abb10a1576efd929ed0344af26b4db6037a
Added new columns in the examples. Also, Removed metadata path.
* Generated from 89e4b3f2e4d5f61efd6d0a1bdacfc1db7a912c85 (#6067)
[DataFactory]Add CompressionCodec property for ORC Dataset
* Generated from 7face07707cee94abd393c81397c13c71a64c161 (#6070)
Fix mistakes.
* Generated from 92dd4e7a8d556480e7db4c970c5463b380dfc08f (#6055)
Small change - Modify the description for grace period
* Add Go 1.13 to CI
Updated Linux image to 18.04
Removed travis file.
* add windows builds and refactor
* Generated from a1e3eb2f88e93b67dba788fe6abcd993658f8aae
addressed some minor issues
* Modifications after running after_scripts
---
.travis.yml | 40 -
azure-pipelines.yml | 133 +-
.../latest/advisor/mgmt/advisor/models.go | 9 +-
.../latest/compute/mgmt/compute/models.go | 1 +
.../datafactory/mgmt/datafactory/models.go | 16 +-
.../mgmt/policyinsights/models.go | 63 +-
.../policyinsightsapi/models.go | 4 +-
profiles/latest/sql/mgmt/sql/models.go | 592 +-
profiles/latest/sql/mgmt/sql/sqlapi/models.go | 27 +
.../latest/storage/mgmt/storage/models.go | 11 +
.../preview/advisor/mgmt/advisor/models.go | 9 +-
.../preview/compute/mgmt/compute/models.go | 1 +
.../datafactory/mgmt/datafactory/models.go | 16 +-
.../mgmt/policyinsights/models.go | 63 +-
.../policyinsightsapi/models.go | 4 +-
.../mgmt/appplatform/appplatformapi/models.go | 28 +
.../appplatform/mgmt/appplatform/models.go | 277 +
.../costmanagementapi/models.go | 9 +-
.../mgmt/costmanagement/models.go | 219 +-
profiles/preview/sql/mgmt/sql/models.go | 592 +-
.../preview/sql/mgmt/sql/sqlapi/models.go | 27 +
.../preview/storage/mgmt/storage/models.go | 11 +
.../advisor/mgmt/2017-03-31/advisor/models.go | 6 +-
.../advisor/mgmt/2017-04-19/advisor/models.go | 6 +-
.../compute/mgmt/2018-10-01/compute/models.go | 17 +
.../compute/mgmt/2019-03-01/compute/models.go | 19 +
.../compute/mgmt/2019-07-01/compute/models.go | 19 +
.../mgmt/2018-06-01/datafactory/models.go | 125 +-
.../mgmt/2019-10-01/policyinsights/client.go | 49 +
.../mgmt/2019-10-01/policyinsights/models.go | 1777 ++++++
.../2019-10-01/policyinsights/operations.go | 109 +
.../2019-10-01/policyinsights/policyevents.go | 1049 ++++
.../policyinsightsapi/interfaces.go | 108 +
.../2019-10-01/policyinsights/policystates.go | 1813 ++++++
.../policyinsights/policytrackedresources.go | 557 ++
.../2019-10-01/policyinsights/remediations.go | 2308 +++++++
.../mgmt/2019-10-01/policyinsights/version.go | 30 +
.../appplatform/appplatformapi/interfaces.go | 87 +
.../2019-05-01-preview/appplatform/apps.go | 598 ++
.../appplatform/bindings.go | 498 ++
.../2019-05-01-preview/appplatform/client.go | 51 +
.../appplatform/deployments.go | 971 +++
.../2019-05-01-preview/appplatform/models.go | 1681 ++++++
.../appplatform/operations.go | 147 +
.../appplatform/services.go | 1006 ++++
.../2019-05-01-preview/appplatform/version.go | 30 +
.../mgmt/2019-10-01/costmanagement/client.go | 51 +
.../costmanagementapi/interfaces.go | 57 +
.../2019-10-01/costmanagement/dimensions.go | 158 +
.../mgmt/2019-10-01/costmanagement/exports.go | 593 ++
.../mgmt/2019-10-01/costmanagement/models.go | 966 +++
.../2019-10-01/costmanagement/operations.go | 147 +
.../mgmt/2019-10-01/costmanagement/query.go | 166 +
.../mgmt/2019-10-01/costmanagement/version.go | 30 +
.../sql/backuplongtermretentionpolicies.go | 298 +
.../sql/backuplongtermretentionvaults.go | 292 +
.../sql/mgmt/2014-04-01/sql/capabilities.go | 118 +
.../mgmt/2014-04-01/sql/databaseadvisors.go | 292 +
.../sql/databaseconnectionpolicies.go | 212 +
services/sql/mgmt/2014-04-01/sql/databases.go | 162 +
.../sql/databasetableauditingpolicies.go | 292 +
.../sql/mgmt/2014-04-01/sql/databaseusages.go | 123 +
.../2014-04-01/sql/datamaskingpolicies.go | 210 +
.../mgmt/2014-04-01/sql/datamaskingrules.go | 223 +
.../sql/disasterrecoveryconfigurations.go | 520 ++
.../sql/mgmt/2014-04-01/sql/elasticpools.go | 162 +
.../sql/mgmt/2014-04-01/sql/extensions.go | 203 +
.../mgmt/2014-04-01/sql/geobackuppolicies.go | 297 +
services/sql/mgmt/2014-04-01/sql/models.go | 5355 +++++++++++++----
.../sql/mgmt/2014-04-01/sql/operations.go | 111 +
services/sql/mgmt/2014-04-01/sql/queries.go | 123 +
.../mgmt/2014-04-01/sql/querystatistics.go | 125 +
.../sql/mgmt/2014-04-01/sql/querytexts.go | 125 +
.../2014-04-01/sql/recoverabledatabases.go | 201 +
.../sql/restorabledroppeddatabases.go | 202 +
.../sql/mgmt/2014-04-01/sql/restorepoints.go | 123 +
.../sql/mgmt/2014-04-01/sql/serveradvisors.go | 371 ++
.../sql/serverazureadadministrators.go | 374 ++
.../sql/servercommunicationlinks.go | 373 ++
.../sql/serverconnectionpolicies.go | 206 +
services/sql/mgmt/2014-04-01/sql/servers.go | 466 ++
.../sql/servertableauditingpolicies.go | 285 +
.../sql/mgmt/2014-04-01/sql/serverusages.go | 121 +
.../mgmt/2014-04-01/sql/serviceobjectives.go | 201 +
.../mgmt/2014-04-01/sql/sqlapi/interfaces.go | 243 +-
...transparentdataencryptionconfigurations.go | 126 +
.../mgmt/2019-04-01/storage/accounts.go | 26 +-
.../storage/mgmt/2019-04-01/storage/models.go | 39 +-
.../storage/storageapi/interfaces.go | 2 +-
89 files changed, 28604 insertions(+), 1379 deletions(-)
delete mode 100644 .travis.yml
create mode 100644 profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go
create mode 100644 profiles/preview/preview/appplatform/mgmt/appplatform/models.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/client.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/models.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/operations.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/policytrackedresources.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/remediations.go
create mode 100644 services/policyinsights/mgmt/2019-10-01/policyinsights/version.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/bindings.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/client.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/deployments.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/operations.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go
create mode 100644 services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/version.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/client.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/costmanagementapi/interfaces.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/dimensions.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/exports.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/models.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/operations.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/query.go
create mode 100644 services/preview/costmanagement/mgmt/2019-10-01/costmanagement/version.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/backuplongtermretentionvaults.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/capabilities.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/databaseadvisors.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/databasetableauditingpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/databaseusages.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/datamaskingpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/datamaskingrules.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/disasterrecoveryconfigurations.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/extensions.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/geobackuppolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/operations.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/queries.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/querystatistics.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/querytexts.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/recoverabledatabases.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/restorabledroppeddatabases.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/restorepoints.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/serveradvisors.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/servercommunicationlinks.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/serverconnectionpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/serverusages.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/serviceobjectives.go
create mode 100644 services/sql/mgmt/2014-04-01/sql/transparentdataencryptionconfigurations.go
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e2ec152676c1..000000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,40 +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
-
-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
-
-cache:
- directories:
- - $GOPATH/pkg/dep
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index d254313e0985..5ce8e1746eea 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -1,58 +1,79 @@
-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)'
+ Win_Go112:
+ vm.image: 'windows-2019'
+ go.version: '1.12'
+ GOROOT: 'c:\go$(go.version)'
+ Win_Go113:
+ vm.image: 'windows-2019'
+ go.version: '1.13'
+ GOROOT: 'c:\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'
+ go version
+ 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()
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/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go
index c0d6c7644bad..f9346b5c8435 100644
--- a/profiles/latest/compute/mgmt/compute/models.go
+++ b/profiles/latest/compute/mgmt/compute/models.go
@@ -654,6 +654,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
diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go
index 72a1b696a856..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 (
@@ -2310,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/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/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/storage/mgmt/storage/models.go b/profiles/latest/storage/mgmt/storage/models.go
index a37cf2345411..c475a601a271 100644
--- a/profiles/latest/storage/mgmt/storage/models.go
+++ b/profiles/latest/storage/mgmt/storage/models.go
@@ -85,6 +85,7 @@ type DirectoryServiceOptions = original.DirectoryServiceOptions
const (
DirectoryServiceOptionsAADDS DirectoryServiceOptions = original.DirectoryServiceOptionsAADDS
+ DirectoryServiceOptionsAD DirectoryServiceOptions = original.DirectoryServiceOptionsAD
DirectoryServiceOptionsNone DirectoryServiceOptions = original.DirectoryServiceOptionsNone
)
@@ -173,6 +174,12 @@ const (
LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked
)
+type ListKeyExpand = original.ListKeyExpand
+
+const (
+ Kerb ListKeyExpand = original.Kerb
+)
+
type Permissions = original.Permissions
const (
@@ -300,6 +307,7 @@ type AccountUpdateParameters = original.AccountUpdateParameters
type AccountsClient = original.AccountsClient
type AccountsCreateFuture = original.AccountsCreateFuture
type AccountsFailoverFuture = original.AccountsFailoverFuture
+type ActiveDirectoryProperties = original.ActiveDirectoryProperties
type AzureEntityResource = original.AzureEntityResource
type AzureFilesIdentityBasedAuthentication = original.AzureFilesIdentityBasedAuthentication
type BaseClient = original.BaseClient
@@ -523,6 +531,9 @@ func PossibleLeaseStateValues() []LeaseState {
func PossibleLeaseStatusValues() []LeaseStatus {
return original.PossibleLeaseStatusValues()
}
+func PossibleListKeyExpandValues() []ListKeyExpand {
+ return original.PossibleListKeyExpandValues()
+}
func PossiblePermissionsValues() []Permissions {
return original.PossiblePermissionsValues()
}
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/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go
index 0eb12de56c1f..6c12dc6fa772 100644
--- a/profiles/preview/compute/mgmt/compute/models.go
+++ b/profiles/preview/compute/mgmt/compute/models.go
@@ -654,6 +654,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
diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go
index 98bdbbbd1c7e..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 (
@@ -2310,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/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/appplatformapi/models.go b/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go
new file mode 100644
index 000000000000..3678e5593e3e
--- /dev/null
+++ b/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/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 appplatformapi
+
+import original "github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi"
+
+type AppsClientAPI = original.AppsClientAPI
+type BindingsClientAPI = original.BindingsClientAPI
+type DeploymentsClientAPI = original.DeploymentsClientAPI
+type OperationsClientAPI = original.OperationsClientAPI
+type ServicesClientAPI = original.ServicesClientAPI
diff --git a/profiles/preview/preview/appplatform/mgmt/appplatform/models.go b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go
new file mode 100644
index 000000000000..bf6f0554b541
--- /dev/null
+++ b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go
@@ -0,0 +1,277 @@
+// +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 appplatform
+
+import (
+ "context"
+
+ original "github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform"
+)
+
+const (
+ DefaultBaseURI = original.DefaultBaseURI
+)
+
+type AppResourceProvisioningState = original.AppResourceProvisioningState
+
+const (
+ Failed AppResourceProvisioningState = original.Failed
+ Succeeded AppResourceProvisioningState = original.Succeeded
+)
+
+type ConfigServerState = original.ConfigServerState
+
+const (
+ ConfigServerStateDeleted ConfigServerState = original.ConfigServerStateDeleted
+ ConfigServerStateFailed ConfigServerState = original.ConfigServerStateFailed
+ ConfigServerStateNotAvailable ConfigServerState = original.ConfigServerStateNotAvailable
+ ConfigServerStateSucceeded ConfigServerState = original.ConfigServerStateSucceeded
+ ConfigServerStateUpdating ConfigServerState = original.ConfigServerStateUpdating
+)
+
+type DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningState
+
+const (
+ DeploymentResourceProvisioningStateCreating DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateCreating
+ DeploymentResourceProvisioningStateFailed DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateFailed
+ DeploymentResourceProvisioningStateProcessing DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateProcessing
+ DeploymentResourceProvisioningStateSucceeded DeploymentResourceProvisioningState = original.DeploymentResourceProvisioningStateSucceeded
+)
+
+type DeploymentResourceStatus = original.DeploymentResourceStatus
+
+const (
+ DeploymentResourceStatusFailed DeploymentResourceStatus = original.DeploymentResourceStatusFailed
+ DeploymentResourceStatusProcessing DeploymentResourceStatus = original.DeploymentResourceStatusProcessing
+ DeploymentResourceStatusRunning DeploymentResourceStatus = original.DeploymentResourceStatusRunning
+ DeploymentResourceStatusStopped DeploymentResourceStatus = original.DeploymentResourceStatusStopped
+ DeploymentResourceStatusUnknown DeploymentResourceStatus = original.DeploymentResourceStatusUnknown
+)
+
+type ProvisioningState = original.ProvisioningState
+
+const (
+ ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating
+ ProvisioningStateDeleted ProvisioningState = original.ProvisioningStateDeleted
+ ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting
+ ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed
+ ProvisioningStateMoved ProvisioningState = original.ProvisioningStateMoved
+ ProvisioningStateMoveFailed ProvisioningState = original.ProvisioningStateMoveFailed
+ ProvisioningStateMoving ProvisioningState = original.ProvisioningStateMoving
+ ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded
+ ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating
+)
+
+type RuntimeVersion = original.RuntimeVersion
+
+const (
+ Java11 RuntimeVersion = original.Java11
+ Java8 RuntimeVersion = original.Java8
+)
+
+type TestKeyType = original.TestKeyType
+
+const (
+ Primary TestKeyType = original.Primary
+ Secondary TestKeyType = original.Secondary
+)
+
+type TraceProxyState = original.TraceProxyState
+
+const (
+ TraceProxyStateFailed TraceProxyState = original.TraceProxyStateFailed
+ TraceProxyStateNotAvailable TraceProxyState = original.TraceProxyStateNotAvailable
+ TraceProxyStateSucceeded TraceProxyState = original.TraceProxyStateSucceeded
+ TraceProxyStateUpdating TraceProxyState = original.TraceProxyStateUpdating
+)
+
+type UserSourceType = original.UserSourceType
+
+const (
+ Jar UserSourceType = original.Jar
+ Source UserSourceType = original.Source
+)
+
+type AppResource = original.AppResource
+type AppResourceCollection = original.AppResourceCollection
+type AppResourceCollectionIterator = original.AppResourceCollectionIterator
+type AppResourceCollectionPage = original.AppResourceCollectionPage
+type AppResourceProperties = original.AppResourceProperties
+type AppsClient = original.AppsClient
+type AvailableOperations = original.AvailableOperations
+type AvailableOperationsIterator = original.AvailableOperationsIterator
+type AvailableOperationsPage = original.AvailableOperationsPage
+type BaseClient = original.BaseClient
+type BindingResource = original.BindingResource
+type BindingResourceCollection = original.BindingResourceCollection
+type BindingResourceCollectionIterator = original.BindingResourceCollectionIterator
+type BindingResourceCollectionPage = original.BindingResourceCollectionPage
+type BindingResourceProperties = original.BindingResourceProperties
+type BindingsClient = original.BindingsClient
+type CloudError = original.CloudError
+type CloudErrorBody = original.CloudErrorBody
+type ClusterResourceProperties = original.ClusterResourceProperties
+type ConfigServerGitProperty = original.ConfigServerGitProperty
+type ConfigServerProperties = original.ConfigServerProperties
+type ConfigServerSettings = original.ConfigServerSettings
+type DeploymentInstance = original.DeploymentInstance
+type DeploymentResource = original.DeploymentResource
+type DeploymentResourceCollection = original.DeploymentResourceCollection
+type DeploymentResourceCollectionIterator = original.DeploymentResourceCollectionIterator
+type DeploymentResourceCollectionPage = original.DeploymentResourceCollectionPage
+type DeploymentResourceProperties = original.DeploymentResourceProperties
+type DeploymentSettings = original.DeploymentSettings
+type DeploymentsClient = original.DeploymentsClient
+type DeploymentsCreateOrUpdateFuture = original.DeploymentsCreateOrUpdateFuture
+type DeploymentsRestartFuture = original.DeploymentsRestartFuture
+type DeploymentsStartFuture = original.DeploymentsStartFuture
+type DeploymentsStopFuture = original.DeploymentsStopFuture
+type DeploymentsUpdateFuture = original.DeploymentsUpdateFuture
+type Error = original.Error
+type GitPatternRepository = original.GitPatternRepository
+type LogFileURLResponse = original.LogFileURLResponse
+type LogSpecification = original.LogSpecification
+type MetricDimension = original.MetricDimension
+type MetricSpecification = original.MetricSpecification
+type NameAvailability = original.NameAvailability
+type NameAvailabilityParameters = original.NameAvailabilityParameters
+type OperationDetail = original.OperationDetail
+type OperationDisplay = original.OperationDisplay
+type OperationProperties = original.OperationProperties
+type OperationsClient = original.OperationsClient
+type PersistentDisk = original.PersistentDisk
+type ProxyResource = original.ProxyResource
+type RegenerateTestKeyRequestPayload = original.RegenerateTestKeyRequestPayload
+type Resource = original.Resource
+type ResourceUploadDefinition = original.ResourceUploadDefinition
+type ServiceResource = original.ServiceResource
+type ServiceResourceList = original.ServiceResourceList
+type ServiceResourceListIterator = original.ServiceResourceListIterator
+type ServiceResourceListPage = original.ServiceResourceListPage
+type ServiceSpecification = original.ServiceSpecification
+type ServicesClient = original.ServicesClient
+type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture
+type ServicesDeleteFuture = original.ServicesDeleteFuture
+type ServicesUpdateFuture = original.ServicesUpdateFuture
+type TemporaryDisk = original.TemporaryDisk
+type TestKeys = original.TestKeys
+type TraceProperties = original.TraceProperties
+type TrackedResource = original.TrackedResource
+type UserSourceInfo = original.UserSourceInfo
+
+func New(subscriptionID string) BaseClient {
+ return original.New(subscriptionID)
+}
+func NewAppResourceCollectionIterator(page AppResourceCollectionPage) AppResourceCollectionIterator {
+ return original.NewAppResourceCollectionIterator(page)
+}
+func NewAppResourceCollectionPage(getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage {
+ return original.NewAppResourceCollectionPage(getNextPage)
+}
+func NewAppsClient(subscriptionID string) AppsClient {
+ return original.NewAppsClient(subscriptionID)
+}
+func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient {
+ return original.NewAppsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewAvailableOperationsIterator(page AvailableOperationsPage) AvailableOperationsIterator {
+ return original.NewAvailableOperationsIterator(page)
+}
+func NewAvailableOperationsPage(getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage {
+ return original.NewAvailableOperationsPage(getNextPage)
+}
+func NewBindingResourceCollectionIterator(page BindingResourceCollectionPage) BindingResourceCollectionIterator {
+ return original.NewBindingResourceCollectionIterator(page)
+}
+func NewBindingResourceCollectionPage(getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage {
+ return original.NewBindingResourceCollectionPage(getNextPage)
+}
+func NewBindingsClient(subscriptionID string) BindingsClient {
+ return original.NewBindingsClient(subscriptionID)
+}
+func NewBindingsClientWithBaseURI(baseURI string, subscriptionID string) BindingsClient {
+ return original.NewBindingsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewDeploymentResourceCollectionIterator(page DeploymentResourceCollectionPage) DeploymentResourceCollectionIterator {
+ return original.NewDeploymentResourceCollectionIterator(page)
+}
+func NewDeploymentResourceCollectionPage(getNextPage func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)) DeploymentResourceCollectionPage {
+ return original.NewDeploymentResourceCollectionPage(getNextPage)
+}
+func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
+ return original.NewDeploymentsClient(subscriptionID)
+}
+func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
+ return original.NewDeploymentsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return original.NewOperationsClient(subscriptionID)
+}
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewServiceResourceListIterator(page ServiceResourceListPage) ServiceResourceListIterator {
+ return original.NewServiceResourceListIterator(page)
+}
+func NewServiceResourceListPage(getNextPage func(context.Context, ServiceResourceList) (ServiceResourceList, error)) ServiceResourceListPage {
+ return original.NewServiceResourceListPage(getNextPage)
+}
+func NewServicesClient(subscriptionID string) ServicesClient {
+ return original.NewServicesClient(subscriptionID)
+}
+func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient {
+ return original.NewServicesClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return original.NewWithBaseURI(baseURI, subscriptionID)
+}
+func PossibleAppResourceProvisioningStateValues() []AppResourceProvisioningState {
+ return original.PossibleAppResourceProvisioningStateValues()
+}
+func PossibleConfigServerStateValues() []ConfigServerState {
+ return original.PossibleConfigServerStateValues()
+}
+func PossibleDeploymentResourceProvisioningStateValues() []DeploymentResourceProvisioningState {
+ return original.PossibleDeploymentResourceProvisioningStateValues()
+}
+func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus {
+ return original.PossibleDeploymentResourceStatusValues()
+}
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return original.PossibleProvisioningStateValues()
+}
+func PossibleRuntimeVersionValues() []RuntimeVersion {
+ return original.PossibleRuntimeVersionValues()
+}
+func PossibleTestKeyTypeValues() []TestKeyType {
+ return original.PossibleTestKeyTypeValues()
+}
+func PossibleTraceProxyStateValues() []TraceProxyState {
+ return original.PossibleTraceProxyStateValues()
+}
+func PossibleUserSourceTypeValues() []UserSourceType {
+ return original.PossibleUserSourceTypeValues()
+}
+func UserAgent() string {
+ return original.UserAgent() + " profiles/preview"
+}
+func Version() string {
+ return original.Version()
+}
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/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/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go
index bd83eed0e792..87e3d34ebd41 100644
--- a/profiles/preview/storage/mgmt/storage/models.go
+++ b/profiles/preview/storage/mgmt/storage/models.go
@@ -85,6 +85,7 @@ type DirectoryServiceOptions = original.DirectoryServiceOptions
const (
DirectoryServiceOptionsAADDS DirectoryServiceOptions = original.DirectoryServiceOptionsAADDS
+ DirectoryServiceOptionsAD DirectoryServiceOptions = original.DirectoryServiceOptionsAD
DirectoryServiceOptionsNone DirectoryServiceOptions = original.DirectoryServiceOptionsNone
)
@@ -173,6 +174,12 @@ const (
LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked
)
+type ListKeyExpand = original.ListKeyExpand
+
+const (
+ Kerb ListKeyExpand = original.Kerb
+)
+
type Permissions = original.Permissions
const (
@@ -300,6 +307,7 @@ type AccountUpdateParameters = original.AccountUpdateParameters
type AccountsClient = original.AccountsClient
type AccountsCreateFuture = original.AccountsCreateFuture
type AccountsFailoverFuture = original.AccountsFailoverFuture
+type ActiveDirectoryProperties = original.ActiveDirectoryProperties
type AzureEntityResource = original.AzureEntityResource
type AzureFilesIdentityBasedAuthentication = original.AzureFilesIdentityBasedAuthentication
type BaseClient = original.BaseClient
@@ -523,6 +531,9 @@ func PossibleLeaseStateValues() []LeaseState {
func PossibleLeaseStatusValues() []LeaseStatus {
return original.PossibleLeaseStatusValues()
}
+func PossibleListKeyExpandValues() []ListKeyExpand {
+ return original.PossibleListKeyExpandValues()
+}
func PossiblePermissionsValues() []Permissions {
return original.PossiblePermissionsValues()
}
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/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/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-07-01/compute/models.go b/services/compute/mgmt/2019-07-01/compute/models.go
index 8cf3b0571819..d9f11ecfb2b5 100644
--- a/services/compute/mgmt/2019-07-01/compute/models.go
+++ b/services/compute/mgmt/2019-07-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
@@ -6307,6 +6318,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
@@ -10394,6 +10407,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.
@@ -11219,10 +11234,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/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go
index 83c721ad77b0..ea7977a65b9f 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
@@ -50057,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"`
}
@@ -50147,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{}
@@ -78570,12 +78621,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"`
}
@@ -78660,6 +78717,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{}
@@ -80826,12 +80909,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"`
}
@@ -80916,6 +81005,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{}
@@ -149818,6 +149933,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.
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/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go
new file mode 100644
index 000000000000..3c3a7feb6811
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go
@@ -0,0 +1,87 @@
+package appplatformapi
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by 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/appplatform/mgmt/2019-05-01-preview/appplatform"
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// ServicesClientAPI contains the set of methods on the ServicesClient type.
+type ServicesClientAPI interface {
+ CheckNameAvailability(ctx context.Context, location string, availabilityParameters appplatform.NameAvailabilityParameters) (result appplatform.NameAvailability, err error)
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource *appplatform.ServiceResource) (result appplatform.ServicesCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.ServicesDeleteFuture, err error)
+ DisableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error)
+ EnableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.TestKeys, err error)
+ Get(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.ServiceResource, err error)
+ List(ctx context.Context, resourceGroupName string) (result appplatform.ServiceResourceListPage, err error)
+ ListBySubscription(ctx context.Context) (result appplatform.ServiceResourceListPage, err error)
+ ListTestKeys(ctx context.Context, resourceGroupName string, serviceName string) (result appplatform.TestKeys, err error)
+ RegenerateTestKey(ctx context.Context, resourceGroupName string, serviceName string, regenerateTestKeyRequest *appplatform.RegenerateTestKeyRequestPayload) (result appplatform.TestKeys, err error)
+ Update(ctx context.Context, resourceGroupName string, serviceName string, resource *appplatform.ServiceResource) (result appplatform.ServicesUpdateFuture, err error)
+}
+
+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)
+ 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)
+}
+
+var _ AppsClientAPI = (*appplatform.AppsClient)(nil)
+
+// BindingsClientAPI contains the set of methods on the BindingsClient type.
+type BindingsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *appplatform.BindingResource) (result appplatform.BindingResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (result appplatform.BindingResource, err error)
+ List(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result appplatform.BindingResourceCollectionPage, err error)
+ Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *appplatform.BindingResource) (result appplatform.BindingResource, err error)
+}
+
+var _ BindingsClientAPI = (*appplatform.BindingsClient)(nil)
+
+// DeploymentsClientAPI contains the set of methods on the DeploymentsClient type.
+type DeploymentsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *appplatform.DeploymentResource) (result appplatform.DeploymentsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result appplatform.DeploymentResource, err error)
+ GetLogFileURL(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result appplatform.LogFileURLResponse, err error)
+ List(ctx context.Context, resourceGroupName string, serviceName string, appName string, version []string) (result appplatform.DeploymentResourceCollectionPage, err error)
+ ListClusterAllDeployments(ctx context.Context, resourceGroupName string, serviceName string, version []string) (result appplatform.DeploymentResourceCollectionPage, err error)
+ Restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result appplatform.DeploymentsRestartFuture, err error)
+ Start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result appplatform.DeploymentsStartFuture, err error)
+ Stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result appplatform.DeploymentsStopFuture, err error)
+ Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *appplatform.DeploymentResource) (result appplatform.DeploymentsUpdateFuture, err error)
+}
+
+var _ DeploymentsClientAPI = (*appplatform.DeploymentsClient)(nil)
+
+// OperationsClientAPI contains the set of methods on the OperationsClient type.
+type OperationsClientAPI interface {
+ List(ctx context.Context) (result appplatform.AvailableOperationsPage, err error)
+}
+
+var _ OperationsClientAPI = (*appplatform.OperationsClient)(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
new file mode 100644
index 000000000000..69d6141f9fb0
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/apps.go
@@ -0,0 +1,598 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// AppsClient is the REST API for Azure Spring Cloud
+type AppsClient struct {
+ BaseClient
+}
+
+// NewAppsClient creates an instance of the AppsClient client.
+func NewAppsClient(subscriptionID string) AppsClient {
+ return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAppsClientWithBaseURI creates an instance of the AppsClient client.
+func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient {
+ return AppsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create a new App or update an exiting App.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// 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) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.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: appResource,
+ Constraints: []validation.Constraint{{Target: "appResource", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.InclusiveMaximum, Rule: int64(5), Chain: nil},
+ {Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
+ }},
+ }},
+ {Target: "appResource.Properties.PersistentDisk", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil},
+ {Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
+ }},
+ {Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil},
+ {Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
+ }},
+ }},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("appplatform.AppsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, appName, appResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", resp, "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
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if appResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(appResource))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppsClient) CreateOrUpdateSender(req *http.Request) (*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 AppsClient) CreateOrUpdateResponder(resp *http.Response) (result AppResource, 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 operation to delete an App.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, appName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", 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(), 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 AppsClient) 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 App and its properties.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// syncStatus - indicates whether sync status
+func (client AppsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, syncStatus string) (result AppResource, 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, resourceGroupName, serviceName, appName, syncStatus)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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, "appplatform.AppsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, syncStatus string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(syncStatus) > 0 {
+ queryParameters["syncStatus"] = autorest.Encode("query", syncStatus)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&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(), 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 AppsClient) GetResponder(resp *http.Response) (result AppResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetResourceUploadURL get an resource upload URL for an App, which may be artifacts or source archive.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+func (client AppsClient) GetResourceUploadURL(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result ResourceUploadDefinition, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetResourceUploadURL")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetResourceUploadURLPreparer(ctx, resourceGroupName, serviceName, appName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetResourceUploadURLSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResourceUploadURLResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourceUploadURLPreparer prepares the GetResourceUploadURL request.
+func (client AppsClient) GetResourceUploadURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetResourceUploadURLSender sends the GetResourceUploadURL request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppsClient) GetResourceUploadURLSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// GetResourceUploadURLResponder handles the response to the GetResourceUploadURL request. The method always
+// closes the http.Response Body.
+func (client AppsClient) GetResourceUploadURLResponder(resp *http.Response) (result ResourceUploadDefinition, 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 handles requests to list all resources in a Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client AppsClient) List(ctx context.Context, resourceGroupName string, serviceName string) (result AppResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List")
+ defer func() {
+ sc := -1
+ if result.arc.Response.Response != nil {
+ sc = result.arc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.arc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.arc, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AppsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) {
+ 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 AppResourceCollection, 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 AppResourceCollection) (result AppResourceCollection, err error) {
+ req, err := lastResults.appResourceCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.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, "appplatform.AppsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AppsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string) (result AppResourceCollectionIterator, 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, resourceGroupName, serviceName)
+ return
+}
+
+// Update operation to update an exiting App.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// 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) {
+ 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, resourceGroupName, serviceName, appName, appResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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, "appplatform.AppsClient", "Update", resp, "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
+}
+
+// UpdatePreparer prepares the Update request.
+func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource *AppResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if appResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(appResource))
+ }
+ 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(), 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 AppsClient) UpdateResponder(resp *http.Response) (result AppResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/bindings.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/bindings.go
new file mode 100644
index 000000000000..b03a7c626007
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/bindings.go
@@ -0,0 +1,498 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// BindingsClient is the REST API for Azure Spring Cloud
+type BindingsClient struct {
+ BaseClient
+}
+
+// NewBindingsClient creates an instance of the BindingsClient client.
+func NewBindingsClient(subscriptionID string) BindingsClient {
+ return NewBindingsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBindingsClientWithBaseURI creates an instance of the BindingsClient client.
+func NewBindingsClientWithBaseURI(baseURI string, subscriptionID string) BindingsClient {
+ return BindingsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create a new Binding or update an exiting Binding.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// bindingName - the name of the Binding resource.
+// bindingResource - parameters for the create or update operation
+func (client BindingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *BindingResource) (result BindingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.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, serviceName, appName, bindingName, bindingResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client BindingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *BindingResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "bindingName": autorest.Encode("path", bindingName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if bindingResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(bindingResource))
+ }
+ 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 BindingsClient) 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 BindingsClient) CreateOrUpdateResponder(resp *http.Response) (result BindingResource, 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 operation to delete a Binding.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// bindingName - the name of the Binding resource.
+func (client BindingsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, appName, bindingName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client BindingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "bindingName": autorest.Encode("path", bindingName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", 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 BindingsClient) 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 BindingsClient) 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 Binding and its properties.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// bindingName - the name of the Binding resource.
+func (client BindingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (result BindingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.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, serviceName, appName, bindingName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client BindingsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "bindingName": autorest.Encode("path", bindingName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BindingsClient) 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 BindingsClient) GetResponder(resp *http.Response) (result BindingResource, 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 handles requests to list all resources in an App.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+func (client BindingsClient) List(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result BindingResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.List")
+ defer func() {
+ sc := -1
+ if result.brc.Response.Response != nil {
+ sc = result.brc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, appName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.brc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.brc, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client BindingsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings", 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 BindingsClient) 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 BindingsClient) ListResponder(resp *http.Response) (result BindingResourceCollection, 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 BindingsClient) listNextResults(ctx context.Context, lastResults BindingResourceCollection) (result BindingResourceCollection, err error) {
+ req, err := lastResults.bindingResourceCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.BindingsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "appplatform.BindingsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client BindingsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result BindingResourceCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.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, serviceName, appName)
+ return
+}
+
+// Update operation to update an exiting Binding.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// bindingName - the name of the Binding resource.
+// bindingResource - parameters for the update operation
+func (client BindingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *BindingResource) (result BindingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingsClient.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, serviceName, appName, bindingName, bindingResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Update", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.BindingsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client BindingsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource *BindingResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "bindingName": autorest.Encode("path", bindingName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if bindingResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(bindingResource))
+ }
+ 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 BindingsClient) 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 BindingsClient) UpdateResponder(resp *http.Response) (result BindingResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/client.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/client.go
new file mode 100644
index 000000000000..cf95f5e086bb
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/client.go
@@ -0,0 +1,51 @@
+// Package appplatform implements the Azure ARM Appplatform service API version 2019-05-01-preview.
+//
+// REST API for Azure Spring Cloud
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // DefaultBaseURI is the default URI used for the service Appplatform
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// BaseClient is the base client for Appplatform.
+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/appplatform/mgmt/2019-05-01-preview/appplatform/deployments.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/deployments.go
new file mode 100644
index 000000000000..a1837b1c1a02
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/deployments.go
@@ -0,0 +1,971 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// DeploymentsClient is the REST API for Azure Spring Cloud
+type DeploymentsClient struct {
+ BaseClient
+}
+
+// NewDeploymentsClient creates an instance of the DeploymentsClient client.
+func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
+ return NewDeploymentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDeploymentsClientWithBaseURI creates an instance of the DeploymentsClient client.
+func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
+ return DeploymentsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create a new Deployment or update an exiting Deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+// deploymentResource - parameters for the create or update operation
+func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *DeploymentResource) (result DeploymentsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.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: deploymentResource,
+ Constraints: []validation.Constraint{{Target: "deploymentResource", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties.DeploymentSettings", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties.DeploymentSettings.CPU", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties.DeploymentSettings.CPU", Name: validation.InclusiveMaximum, Rule: int64(4), Chain: nil},
+ {Target: "deploymentResource.Properties.DeploymentSettings.CPU", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
+ }},
+ {Target: "deploymentResource.Properties.DeploymentSettings.MemoryInGB", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties.DeploymentSettings.MemoryInGB", Name: validation.InclusiveMaximum, Rule: int64(8), Chain: nil},
+ {Target: "deploymentResource.Properties.DeploymentSettings.MemoryInGB", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
+ }},
+ {Target: "deploymentResource.Properties.DeploymentSettings.InstanceCount", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "deploymentResource.Properties.DeploymentSettings.InstanceCount", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil},
+ {Target: "deploymentResource.Properties.DeploymentSettings.InstanceCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
+ }},
+ }},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("appplatform.DeploymentsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DeploymentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *DeploymentResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if deploymentResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(deploymentResource))
+ }
+ 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 DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future DeploymentsCreateOrUpdateFuture, 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 DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentResource, 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 operation to delete a Deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client DeploymentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", 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 DeploymentsClient) 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 DeploymentsClient) 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 Deployment and its properties.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result DeploymentResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.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, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DeploymentsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) 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 DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetLogFileURL get deployment log file URL
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) GetLogFileURL(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result LogFileURLResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.GetLogFileURL")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetLogFileURLPreparer(ctx, resourceGroupName, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "GetLogFileURL", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetLogFileURLSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "GetLogFileURL", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetLogFileURLResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "GetLogFileURL", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetLogFileURLPreparer prepares the GetLogFileURL request.
+func (client DeploymentsClient) GetLogFileURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetLogFileURLSender sends the GetLogFileURL request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) GetLogFileURLSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// GetLogFileURLResponder handles the response to the GetLogFileURL request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) GetLogFileURLResponder(resp *http.Response) (result LogFileURLResponse, 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
+}
+
+// List handles requests to list all resources in an App.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// version - version of the deployments to be listed
+func (client DeploymentsClient) List(ctx context.Context, resourceGroupName string, serviceName string, appName string, version []string) (result DeploymentResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.List")
+ defer func() {
+ sc := -1
+ if result.drc.Response.Response != nil {
+ sc = result.drc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, appName, version)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.drc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.drc, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DeploymentsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, version []string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if version != nil && len(version) > 0 {
+ queryParameters["version"] = version
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments", 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 DeploymentsClient) 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 DeploymentsClient) ListResponder(resp *http.Response) (result DeploymentResourceCollection, 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 DeploymentsClient) listNextResults(ctx context.Context, lastResults DeploymentResourceCollection) (result DeploymentResourceCollection, err error) {
+ req, err := lastResults.deploymentResourceCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client DeploymentsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, appName string, version []string) (result DeploymentResourceCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.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, serviceName, appName, version)
+ return
+}
+
+// ListClusterAllDeployments list deployments for a certain service
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// version - version of the deployments to be listed
+func (client DeploymentsClient) ListClusterAllDeployments(ctx context.Context, resourceGroupName string, serviceName string, version []string) (result DeploymentResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListClusterAllDeployments")
+ defer func() {
+ sc := -1
+ if result.drc.Response.Response != nil {
+ sc = result.drc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listClusterAllDeploymentsNextResults
+ req, err := client.ListClusterAllDeploymentsPreparer(ctx, resourceGroupName, serviceName, version)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "ListClusterAllDeployments", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListClusterAllDeploymentsSender(req)
+ if err != nil {
+ result.drc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "ListClusterAllDeployments", resp, "Failure sending request")
+ return
+ }
+
+ result.drc, err = client.ListClusterAllDeploymentsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "ListClusterAllDeployments", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListClusterAllDeploymentsPreparer prepares the ListClusterAllDeployments request.
+func (client DeploymentsClient) ListClusterAllDeploymentsPreparer(ctx context.Context, resourceGroupName string, serviceName string, version []string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if version != nil && len(version) > 0 {
+ queryParameters["version"] = version
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListClusterAllDeploymentsSender sends the ListClusterAllDeployments request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) ListClusterAllDeploymentsSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// ListClusterAllDeploymentsResponder handles the response to the ListClusterAllDeployments request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) ListClusterAllDeploymentsResponder(resp *http.Response) (result DeploymentResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listClusterAllDeploymentsNextResults retrieves the next set of results, if any.
+func (client DeploymentsClient) listClusterAllDeploymentsNextResults(ctx context.Context, lastResults DeploymentResourceCollection) (result DeploymentResourceCollection, err error) {
+ req, err := lastResults.deploymentResourceCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listClusterAllDeploymentsNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListClusterAllDeploymentsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listClusterAllDeploymentsNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListClusterAllDeploymentsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "listClusterAllDeploymentsNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListClusterAllDeploymentsComplete enumerates all values, automatically crossing page boundaries as required.
+func (client DeploymentsClient) ListClusterAllDeploymentsComplete(ctx context.Context, resourceGroupName string, serviceName string, version []string) (result DeploymentResourceCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListClusterAllDeployments")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListClusterAllDeployments(ctx, resourceGroupName, serviceName, version)
+ return
+}
+
+// Restart restart the deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) Restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result DeploymentsRestartFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Restart")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.RestartPreparer(ctx, resourceGroupName, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Restart", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.RestartSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Restart", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// RestartPreparer prepares the Restart request.
+func (client DeploymentsClient) RestartPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RestartSender sends the Restart request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) RestartSender(req *http.Request) (future DeploymentsRestartFuture, 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
+}
+
+// RestartResponder handles the response to the Restart request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Start start the deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) Start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result DeploymentsStartFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Start")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.StartPreparer(ctx, resourceGroupName, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Start", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.StartSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Start", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// StartPreparer prepares the Start request.
+func (client DeploymentsClient) StartPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/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 DeploymentsClient) StartSender(req *http.Request) (future DeploymentsStartFuture, 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 DeploymentsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Stop stop the deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+func (client DeploymentsClient) Stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (result DeploymentsStopFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Stop")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.StopPreparer(ctx, resourceGroupName, serviceName, appName, deploymentName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Stop", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.StopSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Stop", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// StopPreparer prepares the Stop request.
+func (client DeploymentsClient) StopPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/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 DeploymentsClient) StopSender(req *http.Request) (future DeploymentsStopFuture, 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 DeploymentsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Update operation to update an exiting Deployment.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// appName - the name of the App resource.
+// deploymentName - the name of the Deployment resource.
+// deploymentResource - parameters for the update operation
+func (client DeploymentsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *DeploymentResource) (result DeploymentsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client DeploymentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource *DeploymentResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if deploymentResource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(deploymentResource))
+ }
+ 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 DeploymentsClient) UpdateSender(req *http.Request) (future DeploymentsUpdateFuture, 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 DeploymentsClient) UpdateResponder(resp *http.Response) (result DeploymentResource, 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/appplatform/mgmt/2019-05-01-preview/appplatform/models.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go
new file mode 100644
index 000000000000..5e978290b3a7
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go
@@ -0,0 +1,1681 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "encoding/json"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// The package's fully qualified name.
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform"
+
+// AppResourceProvisioningState enumerates the values for app resource provisioning state.
+type AppResourceProvisioningState string
+
+const (
+ // Failed ...
+ Failed AppResourceProvisioningState = "Failed"
+ // Succeeded ...
+ Succeeded AppResourceProvisioningState = "Succeeded"
+)
+
+// PossibleAppResourceProvisioningStateValues returns an array of possible values for the AppResourceProvisioningState const type.
+func PossibleAppResourceProvisioningStateValues() []AppResourceProvisioningState {
+ return []AppResourceProvisioningState{Failed, Succeeded}
+}
+
+// ConfigServerState enumerates the values for config server state.
+type ConfigServerState string
+
+const (
+ // ConfigServerStateDeleted ...
+ ConfigServerStateDeleted ConfigServerState = "Deleted"
+ // ConfigServerStateFailed ...
+ ConfigServerStateFailed ConfigServerState = "Failed"
+ // ConfigServerStateNotAvailable ...
+ ConfigServerStateNotAvailable ConfigServerState = "NotAvailable"
+ // ConfigServerStateSucceeded ...
+ ConfigServerStateSucceeded ConfigServerState = "Succeeded"
+ // ConfigServerStateUpdating ...
+ ConfigServerStateUpdating ConfigServerState = "Updating"
+)
+
+// PossibleConfigServerStateValues returns an array of possible values for the ConfigServerState const type.
+func PossibleConfigServerStateValues() []ConfigServerState {
+ return []ConfigServerState{ConfigServerStateDeleted, ConfigServerStateFailed, ConfigServerStateNotAvailable, ConfigServerStateSucceeded, ConfigServerStateUpdating}
+}
+
+// DeploymentResourceProvisioningState enumerates the values for deployment resource provisioning state.
+type DeploymentResourceProvisioningState string
+
+const (
+ // DeploymentResourceProvisioningStateCreating ...
+ DeploymentResourceProvisioningStateCreating DeploymentResourceProvisioningState = "Creating"
+ // DeploymentResourceProvisioningStateFailed ...
+ DeploymentResourceProvisioningStateFailed DeploymentResourceProvisioningState = "Failed"
+ // DeploymentResourceProvisioningStateProcessing ...
+ DeploymentResourceProvisioningStateProcessing DeploymentResourceProvisioningState = "Processing"
+ // DeploymentResourceProvisioningStateSucceeded ...
+ DeploymentResourceProvisioningStateSucceeded DeploymentResourceProvisioningState = "Succeeded"
+)
+
+// PossibleDeploymentResourceProvisioningStateValues returns an array of possible values for the DeploymentResourceProvisioningState const type.
+func PossibleDeploymentResourceProvisioningStateValues() []DeploymentResourceProvisioningState {
+ return []DeploymentResourceProvisioningState{DeploymentResourceProvisioningStateCreating, DeploymentResourceProvisioningStateFailed, DeploymentResourceProvisioningStateProcessing, DeploymentResourceProvisioningStateSucceeded}
+}
+
+// DeploymentResourceStatus enumerates the values for deployment resource status.
+type DeploymentResourceStatus string
+
+const (
+ // DeploymentResourceStatusFailed ...
+ DeploymentResourceStatusFailed DeploymentResourceStatus = "Failed"
+ // DeploymentResourceStatusProcessing ...
+ DeploymentResourceStatusProcessing DeploymentResourceStatus = "Processing"
+ // DeploymentResourceStatusRunning ...
+ DeploymentResourceStatusRunning DeploymentResourceStatus = "Running"
+ // DeploymentResourceStatusStopped ...
+ DeploymentResourceStatusStopped DeploymentResourceStatus = "Stopped"
+ // DeploymentResourceStatusUnknown ...
+ DeploymentResourceStatusUnknown DeploymentResourceStatus = "Unknown"
+)
+
+// PossibleDeploymentResourceStatusValues returns an array of possible values for the DeploymentResourceStatus const type.
+func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus {
+ return []DeploymentResourceStatus{DeploymentResourceStatusFailed, DeploymentResourceStatusProcessing, DeploymentResourceStatusRunning, DeploymentResourceStatusStopped, DeploymentResourceStatusUnknown}
+}
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // ProvisioningStateCreating ...
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ // ProvisioningStateDeleted ...
+ ProvisioningStateDeleted ProvisioningState = "Deleted"
+ // ProvisioningStateDeleting ...
+ ProvisioningStateDeleting ProvisioningState = "Deleting"
+ // ProvisioningStateFailed ...
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateMoved ...
+ ProvisioningStateMoved ProvisioningState = "Moved"
+ // ProvisioningStateMoveFailed ...
+ ProvisioningStateMoveFailed ProvisioningState = "MoveFailed"
+ // ProvisioningStateMoving ...
+ ProvisioningStateMoving ProvisioningState = "Moving"
+ // ProvisioningStateSucceeded ...
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+ // ProvisioningStateUpdating ...
+ ProvisioningStateUpdating ProvisioningState = "Updating"
+)
+
+// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMoved, ProvisioningStateMoveFailed, ProvisioningStateMoving, ProvisioningStateSucceeded, ProvisioningStateUpdating}
+}
+
+// RuntimeVersion enumerates the values for runtime version.
+type RuntimeVersion string
+
+const (
+ // Java11 ...
+ Java11 RuntimeVersion = "Java_11"
+ // Java8 ...
+ Java8 RuntimeVersion = "Java_8"
+)
+
+// PossibleRuntimeVersionValues returns an array of possible values for the RuntimeVersion const type.
+func PossibleRuntimeVersionValues() []RuntimeVersion {
+ return []RuntimeVersion{Java11, Java8}
+}
+
+// TestKeyType enumerates the values for test key type.
+type TestKeyType string
+
+const (
+ // Primary ...
+ Primary TestKeyType = "Primary"
+ // Secondary ...
+ Secondary TestKeyType = "Secondary"
+)
+
+// PossibleTestKeyTypeValues returns an array of possible values for the TestKeyType const type.
+func PossibleTestKeyTypeValues() []TestKeyType {
+ return []TestKeyType{Primary, Secondary}
+}
+
+// TraceProxyState enumerates the values for trace proxy state.
+type TraceProxyState string
+
+const (
+ // TraceProxyStateFailed ...
+ TraceProxyStateFailed TraceProxyState = "Failed"
+ // TraceProxyStateNotAvailable ...
+ TraceProxyStateNotAvailable TraceProxyState = "NotAvailable"
+ // TraceProxyStateSucceeded ...
+ TraceProxyStateSucceeded TraceProxyState = "Succeeded"
+ // TraceProxyStateUpdating ...
+ TraceProxyStateUpdating TraceProxyState = "Updating"
+)
+
+// PossibleTraceProxyStateValues returns an array of possible values for the TraceProxyState const type.
+func PossibleTraceProxyStateValues() []TraceProxyState {
+ return []TraceProxyState{TraceProxyStateFailed, TraceProxyStateNotAvailable, TraceProxyStateSucceeded, TraceProxyStateUpdating}
+}
+
+// UserSourceType enumerates the values for user source type.
+type UserSourceType string
+
+const (
+ // Jar ...
+ Jar UserSourceType = "Jar"
+ // Source ...
+ Source UserSourceType = "Source"
+)
+
+// PossibleUserSourceTypeValues returns an array of possible values for the UserSourceType const type.
+func PossibleUserSourceTypeValues() []UserSourceType {
+ return []UserSourceType{Jar, Source}
+}
+
+// AppResource app resource payload
+type AppResource struct {
+ autorest.Response `json:"-"`
+ // Properties - Properties of the App resource
+ Properties *AppResourceProperties `json:"properties,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// AppResourceCollection object that includes an array of App resources and a possible link for next set
+type AppResourceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of App resources
+ Value *[]AppResource `json:"value,omitempty"`
+ // NextLink - URL client should use to fetch the next page (per server side paging).
+ // It's null for now, added for future use.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AppResourceCollectionIterator provides access to a complete listing of AppResource values.
+type AppResourceCollectionIterator struct {
+ i int
+ page AppResourceCollectionPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *AppResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *AppResourceCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter AppResourceCollectionIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter AppResourceCollectionIterator) Response() AppResourceCollection {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter AppResourceCollectionIterator) Value() AppResource {
+ if !iter.page.NotDone() {
+ return AppResource{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the AppResourceCollectionIterator type.
+func NewAppResourceCollectionIterator(page AppResourceCollectionPage) AppResourceCollectionIterator {
+ return AppResourceCollectionIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (arc AppResourceCollection) IsEmpty() bool {
+ return arc.Value == nil || len(*arc.Value) == 0
+}
+
+// appResourceCollectionPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (arc AppResourceCollection) appResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
+ if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(arc.NextLink)))
+}
+
+// AppResourceCollectionPage contains a page of AppResource values.
+type AppResourceCollectionPage struct {
+ fn func(context.Context, AppResourceCollection) (AppResourceCollection, error)
+ arc AppResourceCollection
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *AppResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.arc)
+ if err != nil {
+ return err
+ }
+ page.arc = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *AppResourceCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page AppResourceCollectionPage) NotDone() bool {
+ return !page.arc.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page AppResourceCollectionPage) Response() AppResourceCollection {
+ return page.arc
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page AppResourceCollectionPage) Values() []AppResource {
+ if page.arc.IsEmpty() {
+ return nil
+ }
+ return *page.arc.Value
+}
+
+// Creates a new instance of the AppResourceCollectionPage type.
+func NewAppResourceCollectionPage(getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage {
+ return AppResourceCollectionPage{fn: getNextPage}
+}
+
+// AppResourceProperties app resource properties payload
+type AppResourceProperties struct {
+ // Public - Indicates whether the App exposes public endpoint
+ 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 AppResourceProvisioningState `json:"provisioningState,omitempty"`
+ // ActiveDeploymentName - Name of the active deployment of the App
+ ActiveDeploymentName *string `json:"activeDeploymentName,omitempty"`
+ // CreatedTime - READ-ONLY; Date time when the resource is created
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ // TemporaryDisk - Temporary disk settings
+ TemporaryDisk *TemporaryDisk `json:"temporaryDisk,omitempty"`
+ // PersistentDisk - Persistent disk settings
+ PersistentDisk *PersistentDisk `json:"persistentDisk,omitempty"`
+}
+
+// AvailableOperations available operations of the service
+type AvailableOperations struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of available operation details
+ Value *[]OperationDetail `json:"value,omitempty"`
+ // NextLink - URL client should use to fetch the next page (per server side paging).
+ // It's null for now, added for future use.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AvailableOperationsIterator provides access to a complete listing of OperationDetail values.
+type AvailableOperationsIterator struct {
+ i int
+ page AvailableOperationsPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *AvailableOperationsIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *AvailableOperationsIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter AvailableOperationsIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter AvailableOperationsIterator) Response() AvailableOperations {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter AvailableOperationsIterator) Value() OperationDetail {
+ if !iter.page.NotDone() {
+ return OperationDetail{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the AvailableOperationsIterator type.
+func NewAvailableOperationsIterator(page AvailableOperationsPage) AvailableOperationsIterator {
+ return AvailableOperationsIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (ao AvailableOperations) IsEmpty() bool {
+ return ao.Value == nil || len(*ao.Value) == 0
+}
+
+// availableOperationsPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (ao AvailableOperations) availableOperationsPreparer(ctx context.Context) (*http.Request, error) {
+ if ao.NextLink == nil || len(to.String(ao.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(ao.NextLink)))
+}
+
+// AvailableOperationsPage contains a page of OperationDetail values.
+type AvailableOperationsPage struct {
+ fn func(context.Context, AvailableOperations) (AvailableOperations, error)
+ ao AvailableOperations
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *AvailableOperationsPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.ao)
+ if err != nil {
+ return err
+ }
+ page.ao = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *AvailableOperationsPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page AvailableOperationsPage) NotDone() bool {
+ return !page.ao.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page AvailableOperationsPage) Response() AvailableOperations {
+ return page.ao
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page AvailableOperationsPage) Values() []OperationDetail {
+ if page.ao.IsEmpty() {
+ return nil
+ }
+ return *page.ao.Value
+}
+
+// Creates a new instance of the AvailableOperationsPage type.
+func NewAvailableOperationsPage(getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage {
+ return AvailableOperationsPage{fn: getNextPage}
+}
+
+// BindingResource binding resource payload
+type BindingResource struct {
+ autorest.Response `json:"-"`
+ // Properties - Properties of the Binding resource
+ Properties *BindingResourceProperties `json:"properties,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// BindingResourceCollection object that includes an array of Binding resources and a possible link for
+// next set
+type BindingResourceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of Binding resources
+ Value *[]BindingResource `json:"value,omitempty"`
+ // NextLink - URL client should use to fetch the next page (per server side paging).
+ // It's null for now, added for future use.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// BindingResourceCollectionIterator provides access to a complete listing of BindingResource values.
+type BindingResourceCollectionIterator struct {
+ i int
+ page BindingResourceCollectionPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *BindingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *BindingResourceCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter BindingResourceCollectionIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter BindingResourceCollectionIterator) Response() BindingResourceCollection {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter BindingResourceCollectionIterator) Value() BindingResource {
+ if !iter.page.NotDone() {
+ return BindingResource{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the BindingResourceCollectionIterator type.
+func NewBindingResourceCollectionIterator(page BindingResourceCollectionPage) BindingResourceCollectionIterator {
+ return BindingResourceCollectionIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (brc BindingResourceCollection) IsEmpty() bool {
+ return brc.Value == nil || len(*brc.Value) == 0
+}
+
+// bindingResourceCollectionPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (brc BindingResourceCollection) bindingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
+ if brc.NextLink == nil || len(to.String(brc.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(brc.NextLink)))
+}
+
+// BindingResourceCollectionPage contains a page of BindingResource values.
+type BindingResourceCollectionPage struct {
+ fn func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)
+ brc BindingResourceCollection
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *BindingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.brc)
+ if err != nil {
+ return err
+ }
+ page.brc = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *BindingResourceCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page BindingResourceCollectionPage) NotDone() bool {
+ return !page.brc.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page BindingResourceCollectionPage) Response() BindingResourceCollection {
+ return page.brc
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page BindingResourceCollectionPage) Values() []BindingResource {
+ if page.brc.IsEmpty() {
+ return nil
+ }
+ return *page.brc.Value
+}
+
+// Creates a new instance of the BindingResourceCollectionPage type.
+func NewBindingResourceCollectionPage(getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage {
+ return BindingResourceCollectionPage{fn: getNextPage}
+}
+
+// BindingResourceProperties binding resource properties payload
+type BindingResourceProperties struct {
+ // ResourceName - The name of the bound resource
+ ResourceName *string `json:"resourceName,omitempty"`
+ // ResourceType - The standard Azure resource type of the bound resource
+ ResourceType *string `json:"resourceType,omitempty"`
+ // ResourceID - The Azure resource id of the bound resource
+ ResourceID *string `json:"resourceId,omitempty"`
+ // Key - The key of the bound resource
+ Key *string `json:"key,omitempty"`
+ // BindingParameters - Binding parameters of the Binding resource
+ BindingParameters map[string]interface{} `json:"bindingParameters"`
+ // GeneratedProperties - READ-ONLY; The generated Spring Boot property file for this binding. The secret will be deducted.
+ GeneratedProperties *string `json:"generatedProperties,omitempty"`
+ // CreatedAt - READ-ONLY; Creation time of the Binding resource
+ CreatedAt *string `json:"createdAt,omitempty"`
+ // UpdatedAt - READ-ONLY; Update time of the Binding resource
+ UpdatedAt *string `json:"updatedAt,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BindingResourceProperties.
+func (brp BindingResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if brp.ResourceName != nil {
+ objectMap["resourceName"] = brp.ResourceName
+ }
+ if brp.ResourceType != nil {
+ objectMap["resourceType"] = brp.ResourceType
+ }
+ if brp.ResourceID != nil {
+ objectMap["resourceId"] = brp.ResourceID
+ }
+ if brp.Key != nil {
+ objectMap["key"] = brp.Key
+ }
+ if brp.BindingParameters != nil {
+ objectMap["bindingParameters"] = brp.BindingParameters
+ }
+ return json.Marshal(objectMap)
+}
+
+// CloudError an error response from the service.
+type CloudError struct {
+ Error *CloudErrorBody `json:"error,omitempty"`
+}
+
+// CloudErrorBody an error response from the service.
+type CloudErrorBody struct {
+ // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
+ Code *string `json:"code,omitempty"`
+ // Message - A message describing the error, intended to be suitable for display in a user interface.
+ Message *string `json:"message,omitempty"`
+ // 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"`
+}
+
+// ClusterResourceProperties service properties payload
+type ClusterResourceProperties struct {
+ // ProvisioningState - READ-ONLY; Provisioning state of the Service. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving', 'ProvisioningStateMoved', 'ProvisioningStateMoveFailed'
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ // ConfigServerProperties - Config server git properties of the Service
+ ConfigServerProperties *ConfigServerProperties `json:"configServerProperties,omitempty"`
+ // Trace - Trace properties of the Service
+ Trace *TraceProperties `json:"trace,omitempty"`
+ // Version - READ-ONLY; Version of the Service
+ Version *int32 `json:"version,omitempty"`
+ // ServiceID - READ-ONLY; ServiceInstanceEntity GUID which uniquely identifies a created resource
+ ServiceID *string `json:"serviceId,omitempty"`
+}
+
+// ConfigServerGitProperty property of git.
+type ConfigServerGitProperty struct {
+ // Repositories - Repositories of git.
+ Repositories *[]GitPatternRepository `json:"repositories,omitempty"`
+ // URI - URI of the repository
+ URI *string `json:"uri,omitempty"`
+ // Label - Label of the repository
+ Label *string `json:"label,omitempty"`
+ // SearchPaths - Searching path of the repository
+ SearchPaths *[]string `json:"searchPaths,omitempty"`
+ // Username - Username of git repository basic auth.
+ Username *string `json:"username,omitempty"`
+ // Password - Password of git repository basic auth.
+ Password *string `json:"password,omitempty"`
+ // HostKey - Public sshKey of git repository.
+ HostKey *string `json:"hostKey,omitempty"`
+ // HostKeyAlgorithm - SshKey algorithm of git repository.
+ HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"`
+ // PrivateKey - Private sshKey algorithm of git repository.
+ PrivateKey *string `json:"privateKey,omitempty"`
+ // StrictHostKeyChecking - Strict host key checking or not.
+ StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"`
+}
+
+// ConfigServerProperties config server git properties payload
+type ConfigServerProperties struct {
+ // State - READ-ONLY; State of the config server. Possible values include: 'ConfigServerStateNotAvailable', 'ConfigServerStateDeleted', 'ConfigServerStateFailed', 'ConfigServerStateSucceeded', 'ConfigServerStateUpdating'
+ State ConfigServerState `json:"state,omitempty"`
+ // Error - Error when apply config server settings.
+ Error *Error `json:"error,omitempty"`
+ // ConfigServer - Settings of config server.
+ ConfigServer *ConfigServerSettings `json:"configServer,omitempty"`
+}
+
+// ConfigServerSettings the settings of config server.
+type ConfigServerSettings struct {
+ // GitProperty - Property of git environment.
+ GitProperty *ConfigServerGitProperty `json:"gitProperty,omitempty"`
+}
+
+// DeploymentInstance deployment instance payload
+type DeploymentInstance struct {
+ // Name - READ-ONLY; Name of the deployment instance
+ Name *string `json:"name,omitempty"`
+ // Status - READ-ONLY; Status of the deployment instance
+ Status *string `json:"status,omitempty"`
+ // Reason - READ-ONLY; Failed reason of the deployment instance
+ Reason *string `json:"reason,omitempty"`
+ // DiscoveryStatus - READ-ONLY; Discovery status of the deployment instance
+ DiscoveryStatus *string `json:"discoveryStatus,omitempty"`
+}
+
+// DeploymentResource deployment resource payload
+type DeploymentResource struct {
+ autorest.Response `json:"-"`
+ // Properties - Properties of the Deployment resource
+ Properties *DeploymentResourceProperties `json:"properties,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// DeploymentResourceCollection object that includes an array of App resources and a possible link for next
+// set
+type DeploymentResourceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of Deployment resources
+ Value *[]DeploymentResource `json:"value,omitempty"`
+ // NextLink - URL client should use to fetch the next page (per server side paging).
+ // It's null for now, added for future use.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DeploymentResourceCollectionIterator provides access to a complete listing of DeploymentResource values.
+type DeploymentResourceCollectionIterator struct {
+ i int
+ page DeploymentResourceCollectionPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *DeploymentResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentResourceCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *DeploymentResourceCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter DeploymentResourceCollectionIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter DeploymentResourceCollectionIterator) Response() DeploymentResourceCollection {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter DeploymentResourceCollectionIterator) Value() DeploymentResource {
+ if !iter.page.NotDone() {
+ return DeploymentResource{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the DeploymentResourceCollectionIterator type.
+func NewDeploymentResourceCollectionIterator(page DeploymentResourceCollectionPage) DeploymentResourceCollectionIterator {
+ return DeploymentResourceCollectionIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (drc DeploymentResourceCollection) IsEmpty() bool {
+ return drc.Value == nil || len(*drc.Value) == 0
+}
+
+// deploymentResourceCollectionPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (drc DeploymentResourceCollection) deploymentResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
+ if drc.NextLink == nil || len(to.String(drc.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(drc.NextLink)))
+}
+
+// DeploymentResourceCollectionPage contains a page of DeploymentResource values.
+type DeploymentResourceCollectionPage struct {
+ fn func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)
+ drc DeploymentResourceCollection
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *DeploymentResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentResourceCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.drc)
+ if err != nil {
+ return err
+ }
+ page.drc = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *DeploymentResourceCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page DeploymentResourceCollectionPage) NotDone() bool {
+ return !page.drc.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page DeploymentResourceCollectionPage) Response() DeploymentResourceCollection {
+ return page.drc
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page DeploymentResourceCollectionPage) Values() []DeploymentResource {
+ if page.drc.IsEmpty() {
+ return nil
+ }
+ return *page.drc.Value
+}
+
+// Creates a new instance of the DeploymentResourceCollectionPage type.
+func NewDeploymentResourceCollectionPage(getNextPage func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)) DeploymentResourceCollectionPage {
+ return DeploymentResourceCollectionPage{fn: getNextPage}
+}
+
+// DeploymentResourceProperties deployment resource properties payload
+type DeploymentResourceProperties struct {
+ // Source - Uploaded source information of the deployment.
+ Source *UserSourceInfo `json:"source,omitempty"`
+ // AppName - READ-ONLY; App name of the deployment
+ AppName *string `json:"appName,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'
+ Status DeploymentResourceStatus `json:"status,omitempty"`
+ // Active - READ-ONLY; Indicates whether the Deployment is active
+ Active *bool `json:"active,omitempty"`
+ // CreatedTime - READ-ONLY; Date time when the resource is created
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ // Instances - READ-ONLY; Collection of instances belong to the Deployment
+ Instances *[]DeploymentInstance `json:"instances,omitempty"`
+}
+
+// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type DeploymentsCreateOrUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (dr DeploymentResource, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if dr.Response.Response, err = future.GetResult(sender); err == nil && dr.Response.Response.StatusCode != http.StatusNoContent {
+ dr, err = client.CreateOrUpdateResponder(dr.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsCreateOrUpdateFuture", "Result", dr.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// DeploymentSettings deployment settings payload
+type DeploymentSettings struct {
+ // CPU - Required CPU
+ CPU *int32 `json:"cpu,omitempty"`
+ // MemoryInGB - Required Memory size in GB
+ MemoryInGB *int32 `json:"memoryInGB,omitempty"`
+ // JvmOptions - JVM parameter
+ JvmOptions *string `json:"jvmOptions,omitempty"`
+ // InstanceCount - Instance count
+ InstanceCount *int32 `json:"instanceCount,omitempty"`
+ // EnvironmentVariables - Collection of environment variables
+ EnvironmentVariables map[string]*string `json:"environmentVariables"`
+ // RuntimeVersion - Runtime version. Possible values include: 'Java8', 'Java11'
+ RuntimeVersion RuntimeVersion `json:"runtimeVersion,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for DeploymentSettings.
+func (ds DeploymentSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ds.CPU != nil {
+ objectMap["cpu"] = ds.CPU
+ }
+ if ds.MemoryInGB != nil {
+ objectMap["memoryInGB"] = ds.MemoryInGB
+ }
+ if ds.JvmOptions != nil {
+ objectMap["jvmOptions"] = ds.JvmOptions
+ }
+ if ds.InstanceCount != nil {
+ objectMap["instanceCount"] = ds.InstanceCount
+ }
+ if ds.EnvironmentVariables != nil {
+ objectMap["environmentVariables"] = ds.EnvironmentVariables
+ }
+ if ds.RuntimeVersion != "" {
+ objectMap["runtimeVersion"] = ds.RuntimeVersion
+ }
+ return json.Marshal(objectMap)
+}
+
+// DeploymentsRestartFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DeploymentsRestartFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DeploymentsRestartFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsRestartFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsRestartFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// DeploymentsStartFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DeploymentsStartFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DeploymentsStartFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsStartFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsStartFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// DeploymentsStopFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DeploymentsStopFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DeploymentsStopFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsStopFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsStopFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// DeploymentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DeploymentsUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DeploymentsUpdateFuture) Result(client DeploymentsClient) (dr DeploymentResource, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if dr.Response.Response, err = future.GetResult(sender); err == nil && dr.Response.Response.StatusCode != http.StatusNoContent {
+ dr, err = client.UpdateResponder(dr.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.DeploymentsUpdateFuture", "Result", dr.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// Error the error code compose of code and message.
+type Error struct {
+ // Code - The code of error.
+ Code *string `json:"code,omitempty"`
+ // Message - The message of error.
+ Message *string `json:"message,omitempty"`
+}
+
+// GitPatternRepository git repository property payload
+type GitPatternRepository struct {
+ // Name - Name of the repository
+ Name *string `json:"name,omitempty"`
+ // Pattern - Collection of pattern of the repository
+ Pattern *[]string `json:"pattern,omitempty"`
+ // URI - URI of the repository
+ URI *string `json:"uri,omitempty"`
+ // Label - Label of the repository
+ Label *string `json:"label,omitempty"`
+ // SearchPaths - Searching path of the repository
+ SearchPaths *[]string `json:"searchPaths,omitempty"`
+ // Username - Username of git repository basic auth.
+ Username *string `json:"username,omitempty"`
+ // Password - Password of git repository basic auth.
+ Password *string `json:"password,omitempty"`
+ // HostKey - Public sshKey of git repository.
+ HostKey *string `json:"hostKey,omitempty"`
+ // HostKeyAlgorithm - SshKey algorithm of git repository.
+ HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"`
+ // PrivateKey - Private sshKey algorithm of git repository.
+ PrivateKey *string `json:"privateKey,omitempty"`
+ // StrictHostKeyChecking - Strict host key checking or not.
+ StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"`
+}
+
+// LogFileURLResponse log file URL payload
+type LogFileURLResponse struct {
+ autorest.Response `json:"-"`
+ // URL - URL of the log file
+ URL *string `json:"url,omitempty"`
+}
+
+// LogSpecification specifications of the Log for Azure Monitoring
+type LogSpecification struct {
+ // Name - Name of the log
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Localized friendly display name of the log
+ DisplayName *string `json:"displayName,omitempty"`
+ // BlobDuration - Blob duration of the log
+ BlobDuration *string `json:"blobDuration,omitempty"`
+}
+
+// MetricDimension specifications of the Dimension of metrics
+type MetricDimension struct {
+ // Name - Name of the dimension
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Localized friendly display name of the dimension
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
+// MetricSpecification specifications of the Metrics for Azure Monitoring
+type MetricSpecification struct {
+ // Name - Name of the metric
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Localized friendly display name of the metric
+ DisplayName *string `json:"displayName,omitempty"`
+ // DisplayDescription - Localized friendly description of the metric
+ DisplayDescription *string `json:"displayDescription,omitempty"`
+ // Unit - Unit that makes sense for the metric
+ Unit *string `json:"unit,omitempty"`
+ // Category - Name of the metric category that the metric belongs to. A metric can only belong to a single category.
+ Category *string `json:"category,omitempty"`
+ // AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count.
+ AggregationType *string `json:"aggregationType,omitempty"`
+ // SupportedAggregationTypes - Supported aggregation types
+ SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"`
+ // SupportedTimeGrainTypes - Supported time grain types
+ SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
+ // FillGapWithZero - Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published.
+ FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`
+ // Dimensions - Dimensions of the metric
+ Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
+}
+
+// NameAvailability name availability result payload
+type NameAvailability struct {
+ autorest.Response `json:"-"`
+ // NameAvailable - Indicates whether the name is available
+ NameAvailable *bool `json:"nameAvailable,omitempty"`
+ // Reason - Reason why the name is not available
+ Reason *string `json:"reason,omitempty"`
+ // Message - Message why the name is not available
+ Message *string `json:"message,omitempty"`
+}
+
+// NameAvailabilityParameters name availability parameters payload
+type NameAvailabilityParameters struct {
+ // Type - Type of the resource to check name availability
+ Type *string `json:"type,omitempty"`
+ // Name - Name to be checked
+ Name *string `json:"name,omitempty"`
+}
+
+// OperationDetail operation detail payload
+type OperationDetail struct {
+ // Name - Name of the operation
+ Name *string `json:"name,omitempty"`
+ // DataAction - Indicates whether the operation is a data action
+ DataAction *bool `json:"dataAction,omitempty"`
+ // Display - Display of the operation
+ Display *OperationDisplay `json:"display,omitempty"`
+ // Origin - Origin of the operation
+ Origin *string `json:"origin,omitempty"`
+ // Properties - Properties of the operation
+ Properties *OperationProperties `json:"properties,omitempty"`
+}
+
+// OperationDisplay operation display payload
+type OperationDisplay struct {
+ // Provider - Resource provider of the operation
+ Provider *string `json:"provider,omitempty"`
+ // Resource - Resource of the operation
+ Resource *string `json:"resource,omitempty"`
+ // Operation - Localized friendly name for the operation
+ Operation *string `json:"operation,omitempty"`
+ // Description - Localized friendly description for the operation
+ Description *string `json:"description,omitempty"`
+}
+
+// OperationProperties extra Operation properties
+type OperationProperties struct {
+ // ServiceSpecification - Service specifications of the operation
+ ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
+}
+
+// PersistentDisk persistent disk payload
+type PersistentDisk struct {
+ // SizeInGB - Size of the persistent disk in GB
+ SizeInGB *int32 `json:"sizeInGB,omitempty"`
+ // UsedInGB - READ-ONLY; Size of the used persistent disk in GB
+ UsedInGB *int32 `json:"usedInGB,omitempty"`
+ // MountPath - Mount path of the persistent disk
+ MountPath *string `json:"mountPath,omitempty"`
+}
+
+// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
+// required location and tags.
+type ProxyResource struct {
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// RegenerateTestKeyRequestPayload regenerate test key request payload
+type RegenerateTestKeyRequestPayload struct {
+ // KeyType - Type of the test key. Possible values include: 'Primary', 'Secondary'
+ KeyType TestKeyType `json:"keyType,omitempty"`
+}
+
+// Resource the core properties of ARM resources.
+type Resource struct {
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// ResourceUploadDefinition resource upload definition payload
+type ResourceUploadDefinition struct {
+ autorest.Response `json:"-"`
+ // RelativePath - Source relative path
+ RelativePath *string `json:"relativePath,omitempty"`
+ // UploadURL - Upload URL
+ UploadURL *string `json:"uploadUrl,omitempty"`
+}
+
+// ServiceResource service resource
+type ServiceResource struct {
+ autorest.Response `json:"-"`
+ // Properties - Properties of the Service resource
+ Properties *ClusterResourceProperties `json:"properties,omitempty"`
+ // Location - The GEO location of the resource.
+ Location *string `json:"location,omitempty"`
+ // Tags - Tags of the service which is a list of key value pairs that describe the resource.
+ Tags map[string]*string `json:"tags"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ServiceResource.
+func (sr ServiceResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sr.Properties != nil {
+ objectMap["properties"] = sr.Properties
+ }
+ if sr.Location != nil {
+ objectMap["location"] = sr.Location
+ }
+ if sr.Tags != nil {
+ objectMap["tags"] = sr.Tags
+ }
+ return json.Marshal(objectMap)
+}
+
+// ServiceResourceList object that includes an array of Service resources and a possible link for next set
+type ServiceResourceList struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of Service resources
+ Value *[]ServiceResource `json:"value,omitempty"`
+ // NextLink - URL client should use to fetch the next page (per server side paging).
+ // It's null for now, added for future use.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ServiceResourceListIterator provides access to a complete listing of ServiceResource values.
+type ServiceResourceListIterator struct {
+ i int
+ page ServiceResourceListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *ServiceResourceListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *ServiceResourceListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter ServiceResourceListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter ServiceResourceListIterator) Response() ServiceResourceList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter ServiceResourceListIterator) Value() ServiceResource {
+ if !iter.page.NotDone() {
+ return ServiceResource{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the ServiceResourceListIterator type.
+func NewServiceResourceListIterator(page ServiceResourceListPage) ServiceResourceListIterator {
+ return ServiceResourceListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (srl ServiceResourceList) IsEmpty() bool {
+ return srl.Value == nil || len(*srl.Value) == 0
+}
+
+// serviceResourceListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (srl ServiceResourceList) serviceResourceListPreparer(ctx context.Context) (*http.Request, error) {
+ if srl.NextLink == nil || len(to.String(srl.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(srl.NextLink)))
+}
+
+// ServiceResourceListPage contains a page of ServiceResource values.
+type ServiceResourceListPage struct {
+ fn func(context.Context, ServiceResourceList) (ServiceResourceList, error)
+ srl ServiceResourceList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *ServiceResourceListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.srl)
+ if err != nil {
+ return err
+ }
+ page.srl = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *ServiceResourceListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page ServiceResourceListPage) NotDone() bool {
+ return !page.srl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page ServiceResourceListPage) Response() ServiceResourceList {
+ return page.srl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page ServiceResourceListPage) Values() []ServiceResource {
+ if page.srl.IsEmpty() {
+ return nil
+ }
+ return *page.srl.Value
+}
+
+// Creates a new instance of the ServiceResourceListPage type.
+func NewServiceResourceListPage(getNextPage func(context.Context, ServiceResourceList) (ServiceResourceList, error)) ServiceResourceListPage {
+ return ServiceResourceListPage{fn: getNextPage}
+}
+
+// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type ServicesCreateOrUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *ServicesCreateOrUpdateFuture) Result(client ServicesClient) (sr ServiceResource, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.ServicesCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
+ sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type ServicesDeleteFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *ServicesDeleteFuture) Result(client ServicesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.ServicesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// ServiceSpecification service specification payload
+type ServiceSpecification struct {
+ // LogSpecifications - Specifications of the Log for Azure Monitoring
+ LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
+ // MetricSpecifications - Specifications of the Metrics for Azure Monitoring
+ MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
+}
+
+// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type ServicesUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *ServicesUpdateFuture) Result(client ServicesClient) (sr ServiceResource, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("appplatform.ServicesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
+ sr, err = client.UpdateResponder(sr.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// TemporaryDisk temporary disk payload
+type TemporaryDisk struct {
+ // SizeInGB - Size of the temporary disk in GB
+ SizeInGB *int32 `json:"sizeInGB,omitempty"`
+ // MountPath - Mount path of the temporary disk
+ MountPath *string `json:"mountPath,omitempty"`
+}
+
+// TestKeys test keys payload
+type TestKeys struct {
+ autorest.Response `json:"-"`
+ // PrimaryKey - Primary key
+ PrimaryKey *string `json:"primaryKey,omitempty"`
+ // SecondaryKey - Secondary key
+ SecondaryKey *string `json:"secondaryKey,omitempty"`
+ // PrimaryTestEndpoint - Primary test endpoint
+ PrimaryTestEndpoint *string `json:"primaryTestEndpoint,omitempty"`
+ // SecondaryTestEndpoint - Secondary test endpoint
+ SecondaryTestEndpoint *string `json:"secondaryTestEndpoint,omitempty"`
+ // Enabled - Indicates whether the test endpoint feature enabled or not
+ Enabled *bool `json:"enabled,omitempty"`
+}
+
+// TraceProperties trace properties payload
+type TraceProperties struct {
+ // State - READ-ONLY; State of the trace proxy. Possible values include: 'TraceProxyStateNotAvailable', 'TraceProxyStateFailed', 'TraceProxyStateSucceeded', 'TraceProxyStateUpdating'
+ State TraceProxyState `json:"state,omitempty"`
+ // Error - Error when apply trace proxy changes.
+ Error *Error `json:"error,omitempty"`
+ // Enabled - Indicates whether enable the tracing functionality
+ Enabled *bool `json:"enabled,omitempty"`
+ // AppInsightInstrumentationKey - Target application insight instrumentation key
+ AppInsightInstrumentationKey *string `json:"appInsightInstrumentationKey,omitempty"`
+}
+
+// TrackedResource the resource model definition for a ARM tracked top level resource.
+type TrackedResource struct {
+ // Location - The GEO location of the resource.
+ Location *string `json:"location,omitempty"`
+ // Tags - Tags of the service which is a list of key value pairs that describe the resource.
+ Tags map[string]*string `json:"tags"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource.
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource.
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource.
+ 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)
+}
+
+// UserSourceInfo source information for a deployment
+type UserSourceInfo struct {
+ // Type - Type of the source uploaded. Possible values include: 'Jar', 'Source'
+ Type UserSourceType `json:"type,omitempty"`
+ // RelativePath - Relative path of the storage which stores the source
+ RelativePath *string `json:"relativePath,omitempty"`
+ // Version - Version of the source
+ Version *string `json:"version,omitempty"`
+ // ArtifactSelector - Selector for the artifact to be used for the deployment for multi-module projects. This should be
+ // the relative path to the target module/project.
+ ArtifactSelector *string `json:"artifactSelector,omitempty"`
+}
diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/operations.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/operations.go
new file mode 100644
index 000000000000..8bfb2858835f
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/operations.go
@@ -0,0 +1,147 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// OperationsClient is the REST API for Azure Spring Cloud
+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 REST API operations of the Microsoft.AppPlatform provider.
+func (client OperationsClient) List(ctx context.Context) (result AvailableOperationsPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
+ defer func() {
+ sc := -1
+ if result.ao.Response.Response != nil {
+ sc = result.ao.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.OperationsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.ao.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.OperationsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.ao, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.AppPlatform/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 AvailableOperations, 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 AvailableOperations) (result AvailableOperations, err error) {
+ req, err := lastResults.availableOperationsPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.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, "appplatform.OperationsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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 AvailableOperationsIterator, 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/appplatform/mgmt/2019-05-01-preview/appplatform/services.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go
new file mode 100644
index 000000000000..6f2c3a817fec
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go
@@ -0,0 +1,1006 @@
+package appplatform
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ServicesClient is the REST API for Azure Spring Cloud
+type ServicesClient struct {
+ BaseClient
+}
+
+// NewServicesClient creates an instance of the ServicesClient client.
+func NewServicesClient(subscriptionID string) ServicesClient {
+ return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServicesClientWithBaseURI creates an instance of the ServicesClient client.
+func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient {
+ return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckNameAvailability checks that the resource name is valid and is not already in use.
+// Parameters:
+// location - the region
+// availabilityParameters - parameters supplied to the operation.
+func (client ServicesClient) CheckNameAvailability(ctx context.Context, location string, availabilityParameters NameAvailabilityParameters) (result NameAvailability, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CheckNameAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: availabilityParameters,
+ Constraints: []validation.Constraint{{Target: "availabilityParameters.Type", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "availabilityParameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("appplatform.ServicesClient", "CheckNameAvailability", err.Error())
+ }
+
+ req, err := client.CheckNameAvailabilityPreparer(ctx, location, availabilityParameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "CheckNameAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "CheckNameAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "CheckNameAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, location string, availabilityParameters NameAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability", pathParameters),
+ autorest.WithJSON(availabilityParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) (result NameAvailability, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdate create a new Service or update an exiting Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// resource - parameters for the create or update operation
+func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource *ServiceResource) (result ServicesCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resource,
+ Constraints: []validation.Constraint{{Target: "resource", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "resource.Properties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "resource.Properties.ConfigServerProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "resource.Properties.ConfigServerProperties.ConfigServer", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "resource.Properties.ConfigServerProperties.ConfigServer.GitProperty", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "resource.Properties.ConfigServerProperties.ConfigServer.GitProperty.URI", Name: validation.Null, Rule: true, Chain: nil}}},
+ }},
+ }},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("appplatform.ServicesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, resource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, resource *ServiceResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if resource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(resource))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (future ServicesCreateOrUpdateFuture, err error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req, sd...)
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceResource, 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 operation to delete a Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result ServicesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) DeleteSender(req *http.Request) (future ServicesDeleteFuture, err error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req, sd...)
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DisableTestEndpoint sends the disable test endpoint request.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client ServicesClient) DisableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.DisableTestEndpoint")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DisableTestEndpointPreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "DisableTestEndpoint", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DisableTestEndpointSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "DisableTestEndpoint", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DisableTestEndpointResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "DisableTestEndpoint", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DisableTestEndpointPreparer prepares the DisableTestEndpoint request.
+func (client ServicesClient) DisableTestEndpointPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/disableTestEndpoint", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DisableTestEndpointSender sends the DisableTestEndpoint request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) DisableTestEndpointSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// DisableTestEndpointResponder handles the response to the DisableTestEndpoint request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) DisableTestEndpointResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// EnableTestEndpoint sends the enable test endpoint request.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client ServicesClient) EnableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string) (result TestKeys, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.EnableTestEndpoint")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.EnableTestEndpointPreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "EnableTestEndpoint", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.EnableTestEndpointSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "EnableTestEndpoint", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.EnableTestEndpointResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "EnableTestEndpoint", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// EnableTestEndpointPreparer prepares the EnableTestEndpoint request.
+func (client ServicesClient) EnableTestEndpointPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/enableTestEndpoint", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// EnableTestEndpointSender sends the EnableTestEndpoint request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) EnableTestEndpointSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// EnableTestEndpointResponder handles the response to the EnableTestEndpoint request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) EnableTestEndpointResponder(resp *http.Response) (result TestKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get get a Service and its properties.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result ServiceResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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, "appplatform.ServicesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) GetResponder(resp *http.Response) (result ServiceResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List handles requests to list all resources in a resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+func (client ServicesClient) List(ctx context.Context, resourceGroupName string) (result ServiceResourceListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List")
+ defer func() {
+ sc := -1
+ if result.srl.Response.Response != nil {
+ sc = result.srl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.srl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.srl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) ListSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) ListResponder(resp *http.Response) (result ServiceResourceList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client ServicesClient) listNextResults(ctx context.Context, lastResults ServiceResourceList) (result ServiceResourceList, err error) {
+ req, err := lastResults.serviceResourceListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.ServicesClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "appplatform.ServicesClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client ServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result ServiceResourceListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName)
+ return
+}
+
+// ListBySubscription handles requests to list all resources in a subscription.
+func (client ServicesClient) ListBySubscription(ctx context.Context) (result ServiceResourceListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.srl.Response.Response != nil {
+ sc = result.srl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listBySubscriptionNextResults
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.srl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result.srl, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring", 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 ServiceResourceList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listBySubscriptionNextResults retrieves the next set of results, if any.
+func (client ServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ServiceResourceList) (result ServiceResourceList, err error) {
+ req, err := lastResults.serviceResourceListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "appplatform.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, "appplatform.ServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.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 ServiceResourceListIterator, 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
+}
+
+// ListTestKeys list test keys for a Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+func (client ServicesClient) ListTestKeys(ctx context.Context, resourceGroupName string, serviceName string) (result TestKeys, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListTestKeys")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListTestKeysPreparer(ctx, resourceGroupName, serviceName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "ListTestKeys", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListTestKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "ListTestKeys", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListTestKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "ListTestKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListTestKeysPreparer prepares the ListTestKeys request.
+func (client ServicesClient) ListTestKeysPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-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.AppPlatform/Spring/{serviceName}/listTestKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListTestKeysSender sends the ListTestKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) ListTestKeysSender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// ListTestKeysResponder handles the response to the ListTestKeys request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) ListTestKeysResponder(resp *http.Response) (result TestKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RegenerateTestKey regenerate a test key for a Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// regenerateTestKeyRequest - parameters for the operation
+func (client ServicesClient) RegenerateTestKey(ctx context.Context, resourceGroupName string, serviceName string, regenerateTestKeyRequest *RegenerateTestKeyRequestPayload) (result TestKeys, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.RegenerateTestKey")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.RegenerateTestKeyPreparer(ctx, resourceGroupName, serviceName, regenerateTestKeyRequest)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "RegenerateTestKey", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.RegenerateTestKeySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "RegenerateTestKey", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.RegenerateTestKeyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "RegenerateTestKey", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegenerateTestKeyPreparer prepares the RegenerateTestKey request.
+func (client ServicesClient) RegenerateTestKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string, regenerateTestKeyRequest *RegenerateTestKeyRequestPayload) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if regenerateTestKeyRequest != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(regenerateTestKeyRequest))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RegenerateTestKeySender sends the RegenerateTestKey request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) RegenerateTestKeySender(req *http.Request) (*http.Response, error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ return autorest.SendWithSender(client, req, sd...)
+}
+
+// RegenerateTestKeyResponder handles the response to the RegenerateTestKey request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) RegenerateTestKeyResponder(resp *http.Response) (result TestKeys, 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 operation to update an exiting Service.
+// Parameters:
+// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value
+// from the Azure Resource Manager API or the portal.
+// serviceName - the name of the Service resource.
+// resource - parameters for the update operation
+func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, serviceName string, resource *ServiceResource) (result ServicesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, resource)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "appplatform.ServicesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, resource *ServiceResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2019-05-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if resource != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(resource))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServicesClient) UpdateSender(req *http.Request) (future ServicesUpdateFuture, err error) {
+ sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req, sd...)
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client ServicesClient) UpdateResponder(resp *http.Response) (result ServiceResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/version.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/version.go
new file mode 100644
index 000000000000..ae12ebc2af4d
--- /dev/null
+++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/version.go
@@ -0,0 +1,30 @@
+package appplatform
+
+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 + " appplatform/2019-05-01-preview"
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return version.Number
+}
diff --git a/services/preview/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/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go
new file mode 100644
index 000000000000..d106b0595037
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/backuplongtermretentionpolicies.go
@@ -0,0 +1,298 @@
+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"
+)
+
+// BackupLongTermRetentionPoliciesClient 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 BackupLongTermRetentionPoliciesClient struct {
+ BaseClient
+}
+
+// NewBackupLongTermRetentionPoliciesClient creates an instance of the BackupLongTermRetentionPoliciesClient client.
+func NewBackupLongTermRetentionPoliciesClient(subscriptionID string) BackupLongTermRetentionPoliciesClient {
+ return NewBackupLongTermRetentionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBackupLongTermRetentionPoliciesClientWithBaseURI creates an instance of the BackupLongTermRetentionPoliciesClient
+// client.
+func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupLongTermRetentionPoliciesClient {
+ return BackupLongTermRetentionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// 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 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")
+ 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.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")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// 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{}{
+ "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 = "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/{backupLongTermRetentionPolicyName}", 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 BackupLongTermRetentionPoliciesClient) CreateOrUpdateSender(req *http.Request) (future BackupLongTermRetentionPoliciesCreateOrUpdateFuture, 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 BackupLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, 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 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) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.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.BackupLongTermRetentionPoliciesClient", "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.BackupLongTermRetentionPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// 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{}{
+ "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 = "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}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupLongTermRetentionPoliciesClient) 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 BackupLongTermRetentionPoliciesClient) GetResponder(resp *http.Response) (result BackupLongTermRetentionPolicy, 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 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 BackupLongTermRetentionPolicyListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupLongTermRetentionPoliciesClient.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.BackupLongTermRetentionPoliciesClient", "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.BackupLongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByDatabaseResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "ListByDatabase", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByDatabasePreparer prepares the ListByDatabase request.
+func (client BackupLongTermRetentionPoliciesClient) 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}/backupLongTermRetentionPolicies", 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 BackupLongTermRetentionPoliciesClient) 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 BackupLongTermRetentionPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result BackupLongTermRetentionPolicyListResult, 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/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/sql/mgmt/2014-04-01/sql/capabilities.go b/services/sql/mgmt/2014-04-01/sql/capabilities.go
new file mode 100644
index 000000000000..c5718dd09fbe
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/capabilities.go
@@ -0,0 +1,118 @@
+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"
+)
+
+// CapabilitiesClient 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 CapabilitiesClient struct {
+ BaseClient
+}
+
+// NewCapabilitiesClient creates an instance of the CapabilitiesClient client.
+func NewCapabilitiesClient(subscriptionID string) CapabilitiesClient {
+ return NewCapabilitiesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCapabilitiesClientWithBaseURI creates an instance of the CapabilitiesClient client.
+func NewCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) CapabilitiesClient {
+ return CapabilitiesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ListByLocation gets the capabilities available for the specified location.
+// Parameters:
+// 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() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListByLocationPreparer(ctx, locationID)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.CapabilitiesClient", "ListByLocation", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByLocationSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "sql.CapabilitiesClient", "ListByLocation", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByLocationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.CapabilitiesClient", "ListByLocation", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByLocationPreparer prepares the ListByLocation request.
+func (client CapabilitiesClient) ListByLocationPreparer(ctx context.Context, locationID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "locationId": autorest.Encode("path", locationID),
+ "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/locations/{locationId}/capabilities", 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 CapabilitiesClient) 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 CapabilitiesClient) ListByLocationResponder(resp *http.Response) (result LocationCapabilities, 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/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/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go b/services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go
new file mode 100644
index 000000000000..7c70c940b266
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/databaseconnectionpolicies.go
@@ -0,0 +1,212 @@
+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"
+)
+
+// 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 DatabaseConnectionPoliciesClient struct {
+ BaseClient
+}
+
+// NewDatabaseConnectionPoliciesClient creates an instance of the DatabaseConnectionPoliciesClient client.
+func NewDatabaseConnectionPoliciesClient(subscriptionID string) DatabaseConnectionPoliciesClient {
+ return NewDatabaseConnectionPoliciesClientWithBaseURI(DefaultBaseURI, 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 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 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+"/DatabaseConnectionPoliciesClient.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.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.DatabaseConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DatabaseConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseConnectionPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "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"
+ 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}/connectionPolicies/{connectionPolicyName}", 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 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 DatabaseConnectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseConnectionPolicy, 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 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 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+"/DatabaseConnectionPoliciesClient.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.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.DatabaseConnectionPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DatabaseConnectionPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DatabaseConnectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "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"
+ 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}/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 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 DatabaseConnectionPoliciesClient) GetResponder(resp *http.Response) (result DatabaseConnectionPolicy, 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/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/sql/mgmt/2014-04-01/sql/databaseusages.go b/services/sql/mgmt/2014-04-01/sql/databaseusages.go
new file mode 100644
index 000000000000..45f0a1e730a4
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/databaseusages.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"
+)
+
+// DatabaseUsagesClient 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 DatabaseUsagesClient struct {
+ BaseClient
+}
+
+// NewDatabaseUsagesClient creates an instance of the DatabaseUsagesClient client.
+func NewDatabaseUsagesClient(subscriptionID string) DatabaseUsagesClient {
+ return NewDatabaseUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDatabaseUsagesClientWithBaseURI creates an instance of the DatabaseUsagesClient client.
+func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) DatabaseUsagesClient {
+ return DatabaseUsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ListByDatabase returns database usages.
+// Parameters:
+// resourceGroupName - 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 DatabaseUsagesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseUsageListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseUsagesClient.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.DatabaseUsagesClient", "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.DatabaseUsagesClient", "ListByDatabase", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByDatabaseResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DatabaseUsagesClient", "ListByDatabase", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByDatabasePreparer prepares the ListByDatabase request.
+func (client DatabaseUsagesClient) 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}/usages", 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 DatabaseUsagesClient) 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 DatabaseUsagesClient) ListByDatabaseResponder(resp *http.Response) (result DatabaseUsageListResult, 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/datamaskingpolicies.go b/services/sql/mgmt/2014-04-01/sql/datamaskingpolicies.go
new file mode 100644
index 000000000000..65303d3d345a
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/datamaskingpolicies.go
@@ -0,0 +1,210 @@
+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"
+)
+
+// DataMaskingPoliciesClient 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 DataMaskingPoliciesClient struct {
+ BaseClient
+}
+
+// NewDataMaskingPoliciesClient creates an instance of the DataMaskingPoliciesClient client.
+func NewDataMaskingPoliciesClient(subscriptionID string) DataMaskingPoliciesClient {
+ return NewDataMaskingPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDataMaskingPoliciesClientWithBaseURI creates an instance of the DataMaskingPoliciesClient client.
+func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingPoliciesClient {
+ return DataMaskingPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates a database data masking 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 - parameters for creating or updating a data masking policy.
+func (client DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy) (result DataMaskingPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingPoliciesClient.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.DataMaskingPoliciesClient", "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.DataMaskingPoliciesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DataMaskingPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DataMaskingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "dataMaskingPolicyName": autorest.Encode("path", "Default"),
+ "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
+ 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}/dataMaskingPolicies/{dataMaskingPolicyName}", 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 DataMaskingPoliciesClient) 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 DataMaskingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DataMaskingPolicy, 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 database data masking 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 DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DataMaskingPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingPoliciesClient.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.DataMaskingPoliciesClient", "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.DataMaskingPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DataMaskingPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DataMaskingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "dataMaskingPolicyName": autorest.Encode("path", "Default"),
+ "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}/dataMaskingPolicies/{dataMaskingPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client DataMaskingPoliciesClient) 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 DataMaskingPoliciesClient) GetResponder(resp *http.Response) (result DataMaskingPolicy, 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/datamaskingrules.go b/services/sql/mgmt/2014-04-01/sql/datamaskingrules.go
new file mode 100644
index 000000000000..d7a6ff263792
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/datamaskingrules.go
@@ -0,0 +1,223 @@
+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"
+)
+
+// DataMaskingRulesClient 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 DataMaskingRulesClient struct {
+ BaseClient
+}
+
+// NewDataMaskingRulesClient creates an instance of the DataMaskingRulesClient client.
+func NewDataMaskingRulesClient(subscriptionID string) DataMaskingRulesClient {
+ return NewDataMaskingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDataMaskingRulesClientWithBaseURI creates an instance of the DataMaskingRulesClient client.
+func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) DataMaskingRulesClient {
+ return DataMaskingRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates a database data masking 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.
+// databaseName - the name of the database.
+// dataMaskingRuleName - the name of the data masking rule.
+// parameters - the required parameters for creating or updating a data masking rule.
+func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule) (result DataMaskingRule, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingRulesClient.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.DataMaskingRuleProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.DataMaskingRuleProperties.SchemaName", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.DataMaskingRuleProperties.TableName", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.DataMaskingRuleProperties.ColumnName", Name: validation.Null, Rule: true, Chain: nil},
+ }}}}}); err != nil {
+ return result, validation.NewError("sql.DataMaskingRulesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingRuleName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DataMaskingRulesClient", "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.DataMaskingRulesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DataMaskingRulesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DataMaskingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "dataMaskingPolicyName": autorest.Encode("path", "Default"),
+ "dataMaskingRuleName": autorest.Encode("path", dataMaskingRuleName),
+ "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
+ 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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", 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 DataMaskingRulesClient) 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 DataMaskingRulesClient) CreateOrUpdateResponder(resp *http.Response) (result DataMaskingRule, 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
+}
+
+// ListByDatabase gets a list of database data masking rules.
+// Parameters:
+// resourceGroupName - 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 DataMaskingRulesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DataMaskingRuleListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DataMaskingRulesClient.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.DataMaskingRulesClient", "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.DataMaskingRulesClient", "ListByDatabase", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByDatabaseResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.DataMaskingRulesClient", "ListByDatabase", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByDatabasePreparer prepares the ListByDatabase request.
+func (client DataMaskingRulesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "dataMaskingPolicyName": autorest.Encode("path", "Default"),
+ "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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules", 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 DataMaskingRulesClient) 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 DataMaskingRulesClient) ListByDatabaseResponder(resp *http.Response) (result DataMaskingRuleListResult, 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/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/sql/mgmt/2014-04-01/sql/extensions.go b/services/sql/mgmt/2014-04-01/sql/extensions.go
new file mode 100644
index 000000000000..e240a3ccadf4
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/extensions.go
@@ -0,0 +1,203 @@
+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"
+)
+
+// 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
+}
+
+// NewExtensionsClient creates an instance of the ExtensionsClient client.
+func NewExtensionsClient(subscriptionID string) ExtensionsClient {
+ return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client.
+func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient {
+ return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// 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 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+"/ExtensionsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ 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.ExtensionsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+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),
+ "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.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ 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 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 ExtensionsClient) GetResponder(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 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 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+"/ExtensionsClient.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.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.ExtensionsClient", "ListByDatabase", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByDatabaseResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ExtensionsClient", "ListByDatabase", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByDatabasePreparer prepares the ListByDatabase request.
+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),
+ "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}/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 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 ExtensionsClient) ListByDatabaseResponder(resp *http.Response) (result ExtensionListResult, 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/geobackuppolicies.go b/services/sql/mgmt/2014-04-01/sql/geobackuppolicies.go
new file mode 100644
index 000000000000..28e35d715a1b
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/geobackuppolicies.go
@@ -0,0 +1,297 @@
+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"
+)
+
+// GeoBackupPoliciesClient 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 GeoBackupPoliciesClient struct {
+ BaseClient
+}
+
+// NewGeoBackupPoliciesClient creates an instance of the GeoBackupPoliciesClient client.
+func NewGeoBackupPoliciesClient(subscriptionID string) GeoBackupPoliciesClient {
+ return NewGeoBackupPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewGeoBackupPoliciesClientWithBaseURI creates an instance of the GeoBackupPoliciesClient client.
+func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) GeoBackupPoliciesClient {
+ return GeoBackupPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate updates a database geo backup 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 required parameters for creating or updating the geo backup policy.
+func (client GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters GeoBackupPolicy) (result GeoBackupPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/GeoBackupPoliciesClient.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.GeoBackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("sql.GeoBackupPoliciesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "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.GeoBackupPoliciesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client GeoBackupPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters GeoBackupPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "geoBackupPolicyName": autorest.Encode("path", "Default"),
+ "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}/geoBackupPolicies/{geoBackupPolicyName}", 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 GeoBackupPoliciesClient) 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 GeoBackupPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result GeoBackupPolicy, 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 geo backup 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 GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result GeoBackupPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/GeoBackupPoliciesClient.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.GeoBackupPoliciesClient", "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.GeoBackupPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client GeoBackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "databaseName": autorest.Encode("path", databaseName),
+ "geoBackupPolicyName": autorest.Encode("path", "Default"),
+ "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}/geoBackupPolicies/{geoBackupPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client GeoBackupPoliciesClient) 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 GeoBackupPoliciesClient) GetResponder(resp *http.Response) (result GeoBackupPolicy, 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 geo backup 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.
+// serverName - the name of the server.
+// databaseName - the name of the database.
+func (client GeoBackupPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result GeoBackupPolicyListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/GeoBackupPoliciesClient.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.GeoBackupPoliciesClient", "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.GeoBackupPoliciesClient", "ListByDatabase", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByDatabaseResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "ListByDatabase", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByDatabasePreparer prepares the ListByDatabase request.
+func (client GeoBackupPoliciesClient) 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}/geoBackupPolicies", 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 GeoBackupPoliciesClient) 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 GeoBackupPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result GeoBackupPolicyListResult, 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/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/sql/mgmt/2014-04-01/sql/querystatistics.go b/services/sql/mgmt/2014-04-01/sql/querystatistics.go
new file mode 100644
index 000000000000..4b948db0a3a2
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/querystatistics.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"
+)
+
+// 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 QueryStatisticsClient struct {
+ BaseClient
+}
+
+// NewQueryStatisticsClient creates an instance of the QueryStatisticsClient client.
+func NewQueryStatisticsClient(subscriptionID string) QueryStatisticsClient {
+ return NewQueryStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewQueryStatisticsClientWithBaseURI creates an instance of the QueryStatisticsClient client.
+func NewQueryStatisticsClientWithBaseURI(baseURI string, subscriptionID string) QueryStatisticsClient {
+ return QueryStatisticsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// 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.
+// 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+"/QueryStatisticsClient.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.QueryStatisticsClient", "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.QueryStatisticsClient", "ListByQuery", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByQueryResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.QueryStatisticsClient", "ListByQuery", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// 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{}{
+ "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}/statistics", 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 QueryStatisticsClient) 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 QueryStatisticsClient) ListByQueryResponder(resp *http.Response) (result QueryStatisticListResult, 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/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/sql/mgmt/2014-04-01/sql/recoverabledatabases.go b/services/sql/mgmt/2014-04-01/sql/recoverabledatabases.go
new file mode 100644
index 000000000000..bfa9b2425b97
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/recoverabledatabases.go
@@ -0,0 +1,201 @@
+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"
+)
+
+// RecoverableDatabasesClient 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 RecoverableDatabasesClient struct {
+ BaseClient
+}
+
+// NewRecoverableDatabasesClient creates an instance of the RecoverableDatabasesClient client.
+func NewRecoverableDatabasesClient(subscriptionID string) RecoverableDatabasesClient {
+ return NewRecoverableDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewRecoverableDatabasesClientWithBaseURI creates an instance of the RecoverableDatabasesClient client.
+func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RecoverableDatabasesClient {
+ return RecoverableDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get gets a recoverable database, which is a resource representing a database's geo 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.
+// serverName - the name of the server.
+// databaseName - the name of the database
+func (client RecoverableDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RecoverableDatabase, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableDatabasesClient.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.RecoverableDatabasesClient", "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.RecoverableDatabasesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.RecoverableDatabasesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client RecoverableDatabasesClient) 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 = "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}/recoverableDatabases/{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 RecoverableDatabasesClient) 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 RecoverableDatabasesClient) GetResponder(resp *http.Response) (result RecoverableDatabase, 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 recoverable 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 RecoverableDatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RecoverableDatabaseListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableDatabasesClient.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.RecoverableDatabasesClient", "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.RecoverableDatabasesClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.RecoverableDatabasesClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client RecoverableDatabasesClient) 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}/recoverableDatabases", 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 RecoverableDatabasesClient) 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 RecoverableDatabasesClient) ListByServerResponder(resp *http.Response) (result RecoverableDatabaseListResult, 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/restorabledroppeddatabases.go b/services/sql/mgmt/2014-04-01/sql/restorabledroppeddatabases.go
new file mode 100644
index 000000000000..ee9433fcd23a
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/restorabledroppeddatabases.go
@@ -0,0 +1,202 @@
+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"
+)
+
+// RestorableDroppedDatabasesClient 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 RestorableDroppedDatabasesClient struct {
+ BaseClient
+}
+
+// NewRestorableDroppedDatabasesClient creates an instance of the RestorableDroppedDatabasesClient client.
+func NewRestorableDroppedDatabasesClient(subscriptionID string) RestorableDroppedDatabasesClient {
+ return NewRestorableDroppedDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewRestorableDroppedDatabasesClientWithBaseURI creates an instance of the RestorableDroppedDatabasesClient client.
+func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscriptionID string) RestorableDroppedDatabasesClient {
+ return RestorableDroppedDatabasesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get gets a deleted database that can be restored
+// Parameters:
+// resourceGroupName - 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.
+// restorableDroppededDatabaseID - the id of the deleted database in the form of
+// databaseName,deletionTimeInFileTimeFormat
+func (client RestorableDroppedDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (result RestorableDroppedDatabase, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedDatabasesClient.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, restorableDroppededDatabaseID)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.RestorableDroppedDatabasesClient", "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.RestorableDroppedDatabasesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.RestorableDroppedDatabasesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client RestorableDroppedDatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "restorableDroppededDatabaseId": autorest.Encode("path", restorableDroppededDatabaseID),
+ "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}/restorableDroppedDatabases/{restorableDroppededDatabaseId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client RestorableDroppedDatabasesClient) 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 RestorableDroppedDatabasesClient) GetResponder(resp *http.Response) (result RestorableDroppedDatabase, 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 deleted databases that can be restored
+// Parameters:
+// resourceGroupName - 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 RestorableDroppedDatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RestorableDroppedDatabaseListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedDatabasesClient.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.RestorableDroppedDatabasesClient", "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.RestorableDroppedDatabasesClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.RestorableDroppedDatabasesClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client RestorableDroppedDatabasesClient) 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}/restorableDroppedDatabases", 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 RestorableDroppedDatabasesClient) 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 RestorableDroppedDatabasesClient) ListByServerResponder(resp *http.Response) (result RestorableDroppedDatabaseListResult, 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/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/sql/mgmt/2014-04-01/sql/serveradvisors.go b/services/sql/mgmt/2014-04-01/sql/serveradvisors.go
new file mode 100644
index 000000000000..9893c9d4ac6c
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/serveradvisors.go
@@ -0,0 +1,371 @@
+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"
+)
+
+// 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 ServerAdvisorsClient struct {
+ BaseClient
+}
+
+// NewServerAdvisorsClient creates an instance of the ServerAdvisorsClient client.
+func NewServerAdvisorsClient(subscriptionID string) ServerAdvisorsClient {
+ return NewServerAdvisorsClientWithBaseURI(DefaultBaseURI, 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 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.
+// 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+"/ServerAdvisorsClient.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, advisorName, parameters)
+ if err != nil {
+ 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.ServerAdvisorsClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ServerAdvisorsClient) CreateOrUpdatePreparer(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),
+ }
+
+ 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}/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 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 ServerAdvisorsClient) 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 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.
+// 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+"/ServerAdvisorsClient.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, advisorName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "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.ServerAdvisorsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// 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{}{
+ "advisorName": autorest.Encode("path", advisorName),
+ "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}/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 ServerAdvisorsClient) 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 ServerAdvisorsClient) 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
+}
+
+// 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.
+func (client ServerAdvisorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result AdvisorListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerAdvisorsClient.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.ServerAdvisorsClient", "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.ServerAdvisorsClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client ServerAdvisorsClient) 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}/advisors", 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 ServerAdvisorsClient) 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 ServerAdvisorsClient) ListByServerResponder(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
+}
+
+// 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.
+// 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+"/ServerAdvisorsClient.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, advisorName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "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.ServerAdvisorsClient", "Update", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAdvisorsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// 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),
+ }
+
+ 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.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ 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))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an 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...)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client ServerAdvisorsClient) UpdateResponder(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
+}
diff --git a/services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go b/services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go
new file mode 100644
index 000000000000..8f68bc664109
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/serverazureadadministrators.go
@@ -0,0 +1,374 @@
+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"
+)
+
+// ServerAzureADAdministratorsClient 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 ServerAzureADAdministratorsClient struct {
+ BaseClient
+}
+
+// NewServerAzureADAdministratorsClient creates an instance of the ServerAzureADAdministratorsClient client.
+func NewServerAzureADAdministratorsClient(subscriptionID string) ServerAzureADAdministratorsClient {
+ return NewServerAzureADAdministratorsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServerAzureADAdministratorsClientWithBaseURI creates an instance of the ServerAzureADAdministratorsClient client.
+func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ServerAzureADAdministratorsClient {
+ return ServerAzureADAdministratorsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates a new Server Active Directory Administrator or updates an existing server Active Directory
+// 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 Active Directory Administrator.
+func (client ServerAzureADAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAzureADAdministrator) (result ServerAzureADAdministratorsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerAzureADAdministratorsClient.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("sql.ServerAzureADAdministratorsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, properties)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ServerAzureADAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, properties ServerAzureADAdministrator) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "administratorName": autorest.Encode("path", "activeDirectory"),
+ "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}/administrators/{administratorName}", 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 ServerAzureADAdministratorsClient) CreateOrUpdateSender(req *http.Request) (future ServerAzureADAdministratorsCreateOrUpdateFuture, 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 ServerAzureADAdministratorsClient) CreateOrUpdateResponder(resp *http.Response) (result ServerAzureADAdministrator, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an existing server Active Directory 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 ServerAzureADAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServerAzureADAdministratorsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerAzureADAdministratorsClient.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.ServerAzureADAdministratorsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ServerAzureADAdministratorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "administratorName": autorest.Encode("path", "activeDirectory"),
+ "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}/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 ServerAzureADAdministratorsClient) DeleteSender(req *http.Request) (future ServerAzureADAdministratorsDeleteFuture, 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 ServerAzureADAdministratorsClient) DeleteResponder(resp *http.Response) (result ServerAzureADAdministrator, 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 an 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 ServerAzureADAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerAzureADAdministrator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerAzureADAdministratorsClient.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.ServerAzureADAdministratorsClient", "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.ServerAzureADAdministratorsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServerAzureADAdministratorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "administratorName": autorest.Encode("path", "activeDirectory"),
+ "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}/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 ServerAzureADAdministratorsClient) 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 ServerAzureADAdministratorsClient) GetResponder(resp *http.Response) (result ServerAzureADAdministrator, 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 ServerAzureADAdministratorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerAzureADAdministratorsClient.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.ServerAzureADAdministratorsClient", "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.ServerAzureADAdministratorsClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client ServerAzureADAdministratorsClient) 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}/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 ServerAzureADAdministratorsClient) 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 ServerAzureADAdministratorsClient) ListByServerResponder(resp *http.Response) (result ServerAdministratorListResult, 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/servercommunicationlinks.go b/services/sql/mgmt/2014-04-01/sql/servercommunicationlinks.go
new file mode 100644
index 000000000000..8c89241fa93f
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/servercommunicationlinks.go
@@ -0,0 +1,373 @@
+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"
+)
+
+// ServerCommunicationLinksClient 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 ServerCommunicationLinksClient struct {
+ BaseClient
+}
+
+// NewServerCommunicationLinksClient creates an instance of the ServerCommunicationLinksClient client.
+func NewServerCommunicationLinksClient(subscriptionID string) ServerCommunicationLinksClient {
+ return NewServerCommunicationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServerCommunicationLinksClientWithBaseURI creates an instance of the ServerCommunicationLinksClient client.
+func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServerCommunicationLinksClient {
+ return ServerCommunicationLinksClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates a server communication 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.
+// communicationLinkName - the name of the server communication link.
+// parameters - the required parameters for creating a server communication link.
+func (client ServerCommunicationLinksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink) (result ServerCommunicationLinksCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerCommunicationLinksClient.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.ServerCommunicationLinkProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.ServerCommunicationLinkProperties.PartnerServer", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
+ return result, validation.NewError("sql.ServerCommunicationLinksClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, communicationLinkName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ServerCommunicationLinksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "communicationLinkName": autorest.Encode("path", communicationLinkName),
+ "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
+ 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}/communicationLinks/{communicationLinkName}", 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 ServerCommunicationLinksClient) CreateOrUpdateSender(req *http.Request) (future ServerCommunicationLinksCreateOrUpdateFuture, 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 ServerCommunicationLinksClient) CreateOrUpdateResponder(resp *http.Response) (result ServerCommunicationLink, 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 communication 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.
+// communicationLinkName - the name of the server communication link.
+func (client ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerCommunicationLinksClient.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, communicationLinkName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ServerCommunicationLinksClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "communicationLinkName": autorest.Encode("path", communicationLinkName),
+ "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}/communicationLinks/{communicationLinkName}", 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 ServerCommunicationLinksClient) 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 ServerCommunicationLinksClient) 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 returns a server communication 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.
+// communicationLinkName - the name of the server communication link.
+func (client ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result ServerCommunicationLink, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerCommunicationLinksClient.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, communicationLinkName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "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.ServerCommunicationLinksClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServerCommunicationLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "communicationLinkName": autorest.Encode("path", communicationLinkName),
+ "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}/communicationLinks/{communicationLinkName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServerCommunicationLinksClient) 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 ServerCommunicationLinksClient) GetResponder(resp *http.Response) (result ServerCommunicationLink, 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 communication 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.
+func (client ServerCommunicationLinksClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerCommunicationLinkListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerCommunicationLinksClient.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.ServerCommunicationLinksClient", "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.ServerCommunicationLinksClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client ServerCommunicationLinksClient) 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}/communicationLinks", 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 ServerCommunicationLinksClient) 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 ServerCommunicationLinksClient) ListByServerResponder(resp *http.Response) (result ServerCommunicationLinkListResult, 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/serverconnectionpolicies.go b/services/sql/mgmt/2014-04-01/sql/serverconnectionpolicies.go
new file mode 100644
index 000000000000..281669c15993
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/serverconnectionpolicies.go
@@ -0,0 +1,206 @@
+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"
+)
+
+// ServerConnectionPoliciesClient 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 ServerConnectionPoliciesClient struct {
+ BaseClient
+}
+
+// NewServerConnectionPoliciesClient creates an instance of the ServerConnectionPoliciesClient client.
+func NewServerConnectionPoliciesClient(subscriptionID string) ServerConnectionPoliciesClient {
+ return NewServerConnectionPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServerConnectionPoliciesClientWithBaseURI creates an instance of the ServerConnectionPoliciesClient client.
+func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServerConnectionPoliciesClient {
+ return ServerConnectionPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates the server's connection 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 - the required parameters for updating a secure connection policy.
+func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (result ServerConnectionPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPoliciesClient.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.ServerConnectionPoliciesClient", "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.ServerConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "connectionPolicyName": autorest.Encode("path", "default"),
+ "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}/connectionPolicies/{connectionPolicyName}", 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 ServerConnectionPoliciesClient) 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 ServerConnectionPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerConnectionPolicy, 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 the server's secure connection 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 ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerConnectionPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerConnectionPoliciesClient.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.ServerConnectionPoliciesClient", "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.ServerConnectionPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServerConnectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "connectionPolicyName": autorest.Encode("path", "default"),
+ "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}/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 ServerConnectionPoliciesClient) 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 ServerConnectionPoliciesClient) GetResponder(resp *http.Response) (result ServerConnectionPolicy, 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/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/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go b/services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go
new file mode 100644
index 000000000000..230ddf261780
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/servertableauditingpolicies.go
@@ -0,0 +1,285 @@
+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"
+)
+
+// 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 ServerTableAuditingPoliciesClient struct {
+ BaseClient
+}
+
+// NewServerTableAuditingPoliciesClient creates an instance of the ServerTableAuditingPoliciesClient client.
+func NewServerTableAuditingPoliciesClient(subscriptionID string) ServerTableAuditingPoliciesClient {
+ return NewServerTableAuditingPoliciesClientWithBaseURI(DefaultBaseURI, 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 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 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+"/ServerTableAuditingPoliciesClient.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.ServerTableAuditingPoliciesClient", "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.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 ServerTableAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerTableAuditingPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "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}/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 ServerTableAuditingPoliciesClient) 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 ServerTableAuditingPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServerTableAuditingPolicy, 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 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 ServerTableAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerTableAuditingPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerTableAuditingPoliciesClient.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.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.ServerTableAuditingPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServerTableAuditingPoliciesClient) 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),
+ "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}/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 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 ServerTableAuditingPoliciesClient) GetResponder(resp *http.Response) (result ServerTableAuditingPolicy, 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 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 ServerTableAuditingPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerTableAuditingPolicyListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerTableAuditingPoliciesClient.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.ServerTableAuditingPoliciesClient", "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.ServerTableAuditingPoliciesClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerTableAuditingPoliciesClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+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 = "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}/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 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 ServerTableAuditingPoliciesClient) ListByServerResponder(resp *http.Response) (result ServerTableAuditingPolicyListResult, 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/serverusages.go b/services/sql/mgmt/2014-04-01/sql/serverusages.go
new file mode 100644
index 000000000000..65f3fd8d5b43
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/serverusages.go
@@ -0,0 +1,121 @@
+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"
+)
+
+// ServerUsagesClient 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 ServerUsagesClient struct {
+ BaseClient
+}
+
+// NewServerUsagesClient creates an instance of the ServerUsagesClient client.
+func NewServerUsagesClient(subscriptionID string) ServerUsagesClient {
+ return NewServerUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServerUsagesClientWithBaseURI creates an instance of the ServerUsagesClient client.
+func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) ServerUsagesClient {
+ return ServerUsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ListByServer returns server usages.
+// Parameters:
+// resourceGroupName - 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 ServerUsagesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerUsageListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServerUsagesClient.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.ServerUsagesClient", "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.ServerUsagesClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServerUsagesClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client ServerUsagesClient) 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}/usages", 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 ServerUsagesClient) 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 ServerUsagesClient) ListByServerResponder(resp *http.Response) (result ServerUsageListResult, 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/serviceobjectives.go b/services/sql/mgmt/2014-04-01/sql/serviceobjectives.go
new file mode 100644
index 000000000000..971180b812c7
--- /dev/null
+++ b/services/sql/mgmt/2014-04-01/sql/serviceobjectives.go
@@ -0,0 +1,201 @@
+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"
+)
+
+// ServiceObjectivesClient 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 ServiceObjectivesClient struct {
+ BaseClient
+}
+
+// NewServiceObjectivesClient creates an instance of the ServiceObjectivesClient client.
+func NewServiceObjectivesClient(subscriptionID string) ServiceObjectivesClient {
+ return NewServiceObjectivesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewServiceObjectivesClientWithBaseURI creates an instance of the ServiceObjectivesClient client.
+func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string) ServiceObjectivesClient {
+ return ServiceObjectivesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get gets a database service objective.
+// Parameters:
+// resourceGroupName - 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.
+// serviceObjectiveName - the name of the service objective to retrieve.
+func (client ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (result ServiceObjective, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServiceObjectivesClient.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, serviceObjectiveName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServiceObjectivesClient", "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.ServiceObjectivesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServiceObjectivesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ServiceObjectivesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serverName": autorest.Encode("path", serverName),
+ "serviceObjectiveName": autorest.Encode("path", serviceObjectiveName),
+ "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}/serviceObjectives/{serviceObjectiveName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ServiceObjectivesClient) 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 ServiceObjectivesClient) GetResponder(resp *http.Response) (result ServiceObjective, 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 database service objectives.
+// Parameters:
+// resourceGroupName - 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 ServiceObjectivesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServiceObjectiveListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ServiceObjectivesClient.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.ServiceObjectivesClient", "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.ServiceObjectivesClient", "ListByServer", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByServerResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.ServiceObjectivesClient", "ListByServer", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByServerPreparer prepares the ListByServer request.
+func (client ServiceObjectivesClient) 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}/serviceObjectives", 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 ServiceObjectivesClient) 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 ServiceObjectivesClient) ListByServerResponder(resp *http.Response) (result ServiceObjectiveListResult, 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/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)