diff -Nru juju-core-2.0~beta15/debian/changelog juju-core-2.0.0/debian/changelog
--- juju-core-2.0~beta15/debian/changelog 2016-08-22 12:22:41.000000000 +0000
+++ juju-core-2.0.0/debian/changelog 2016-10-31 19:55:49.000000000 +0000
@@ -1,3 +1,38 @@
+juju-core (2.0.0-0ubuntu0.16.04.2) xenial; urgency=medium
+
+ * DPKG_MAINTSCRIPT_ARCH doesn't work in .config, use dpkg check (LP: #1614969)
+
+ -- Nicholas Skaggs Mon, 31 Oct 2016 15:55:49 -0400
+
+juju-core (2.0.0-0ubuntu0.16.04.1) xenial-proposed; urgency=medium
+
+ [ Nicholas Skaggs ]
+ * New upstream release 2.0.0 (LP: #1617440)
+ * Disable future manual provider test (LP: #1629376)
+ * Add sysctl files for lxd provider (LP: #1631038)
+ * Juju can interact with LXD > 2.0 (LP: #1614559)
+ * Change LXD to depends to ensure autopkgtest run on LXD upload (LP: #1614724)
+ * d/copyright updated for 2.0.0 vendored packages.
+ * Update bootstrap order for autpopkgtests for juju cli changes
+ * Display debconf note upon install or upgrade for unsupported architectures
+ * Skip autopkgtests on unsupported arches
+ * Fix lxd-provider test to utilize *_proxy settings and provide additional info
+ * Add template and config files for debconf messaging
+ * Remove all quilt patches
+ * Add upstream signing key
+ * Update watch file to point to lp.net/juju to reflect project move
+ * Add po-debconf dependency for template translation support
+
+ [ Mathieu Trudel-Lapierre ]
+ * debian/*.postinst: use DPKG_MAINTSCRIPT_ARCH to detect architectures
+ * debian/control: Depends on golang-golang-x-crypto-dev
+ (>= 1:0.0~git20161012.0.5f3178)
+
+ [Curtis Hovey]
+ * d/t/setup-lxd.sh support lxd 2.0 and 2.3 network configuration in tests
+
+ -- Nicholas Skaggs Thu, 20 Oct 2016 15:28:12 +0200
+
juju-core (2.0~beta15-0ubuntu2.16.04.1) xenial-proposed; urgency=medium
* Restore all arches to building
diff -Nru juju-core-2.0~beta15/debian/control juju-core-2.0.0/debian/control
--- juju-core-2.0~beta15/debian/control 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/control 2016-10-20 13:28:12.000000000 +0000
@@ -10,12 +10,13 @@
golang-github-coreos-go-systemd-dev,
golang-go (>= 2:1.6),
golang-go-dbus-dev,
- golang-golang-x-crypto-dev,
+ golang-golang-x-crypto-dev (>= 1:0.0~git20161012.0.5f31782),
golang-golang-x-net-dev,
golang-gopkg-tomb.v2-dev,
golang-websocket-dev,
golang-yaml.v2-dev,
lsb-release,
+ po-debconf,
python
Standards-Version: 3.9.7
Homepage: http://launchpad.net/juju-core
@@ -24,8 +25,8 @@
Package: juju-2.0
Architecture: any
-Depends: distro-info, ${misc:Depends}, ${shlibs:Depends}
-Recommends: lxd, bash-completion
+Depends: distro-info, lxd, ${misc:Depends}, ${shlibs:Depends}
+Recommends: bash-completion
Breaks: juju-core (<= 1.25.4)
Conflicts: juju2, juju-core2
Replaces: juju2, juju-core2
diff -Nru juju-core-2.0~beta15/debian/copyright juju-core-2.0.0/debian/copyright
--- juju-core-2.0~beta15/debian/copyright 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/copyright 2016-10-20 13:28:12.000000000 +0000
@@ -26,7 +26,12 @@
Files: src/github.com/Azure/azure-sdk-for-go/*
Copyright: 2009-2015 The Go Authors. All rights reserved.
License: Apache-2.0
-Comment: Last verified commit 3b480eaaf6b4236d43a3c06cba969da6f53c8b66
+Comment: Last verified commit 902d95d9f311ae585ee98cfd18f418b467d60d5a
+
+Files: src/github.com/Azure/go-autorest/*
+Copyright: 2015 Microsoft Corporation. All rights reserved.
+License: Apache-2.0
+Comment: Last verified commit 6f40a8acfe03270d792cb8155e2942c09d7cff95
Files: src/github.com/ajstarks/svgo/*
Copyright: 2010 Anthony Starks
@@ -40,6 +45,11 @@
License: AGPL-3
Comment: Last verified commit 31228935eec685587914528585da4eb9b073c76d
+Files: src/github.com/beorn7/perks/*
+Copyright: 2013 Blake Mizerany
+License: Expat
+Comment: Last verified commit 3ac7bf7a47d159a033b107610db8a1b6575507a4
+
Files: src/github.com/bmizerany/pat/*
Copyright: 2012 Keith Rarick, Blake Mizerany
License: Expat
@@ -52,6 +62,11 @@
File src/github.com/coreos/go-systemd/daemon/sdnotify.go
forked from Docker project, also under Apache-2.0.
+Files: src/github.com/dgrijalva/jwt-go/*
+Copyright: 2012 Dave Grijalva
+License: Expat
+Comment: Last verified commit 01aeca54ebda6e0fbfafd0a524d234159c05ec20
+
Files: src/github.com/dustin/go-humanize/*
Copyright: 2005-2008 Dustin Sallings
License: Expat
@@ -69,6 +84,11 @@
License: BSD-2-clause
Comment: Last verified commit 32c6cc29c14570de4cf6d7e7737d68fb2d01ad15
+Files: src/github.com/golang/protobuf/*
+Copyright: Copyright 2010 The Go Authors. All rights reserved.
+License: BSD-3-clause
+Comment: Last verified commit 34a5f244f1c01cdfee8e60324258cfbb97a42aec
+
Files: src/github.com/google/go-querystring/*
Copyright: 2013 The Go Authors. All rights reserved.
Copyright 2013 Google.
@@ -110,6 +130,11 @@
License: LGPL-3+
Comment: Last verified commit 0da0d5f1342065321c97812b1f4ac0c2b0bab56c
+Files: src/github.com/juju/ansiterm/*
+Copyright: 2015 Canonical Ltd
+License: LGPL-3 with linking exception
+Comment: Last verified commit b99631de12cf04a906c1d4e4ec54fb86eae5863d
+
Files: src/github.com/juju/blobstore/*
Copyright: 2014, 2015 Canonical Ltd.
License: LGPL-3 with linking exception
@@ -123,13 +148,18 @@
Files: src/github.com/juju/cmd/*
Copyright: 2012-2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit 035efd5daac768531ef240ab9e5ee32e3498fbef
+Comment: Last verified commit 1c6973d59b804e4d3c293fbf240f067e73436bc9
Files: src/github.com/juju/errors/*
Copyright: 2013-2015 Canonical Ltd.
License: LGPL-3 with linking exception
Comment: Last verified commit 1b5e39b83d1835fa480e0c2ddefb040ee82d58b3
+Files: src/github.com/juju/gnuflag/*
+Copyright: 2009, 2010, 2012 The Go Authors. All rights reserved.
+License: BSD-3-clause
+Comment: Last verified commit 4e76c56581859c14d9d87e1ddbe29e1c0f10195f
+
Files: src/github.com/juju/go4/*
Copyright: 2011, 2014, 2015, 2016 The go4 Authors
License: Apache-2.0
@@ -203,7 +233,7 @@
Files: src/github.com/juju/gomaasapi/*
Copyright: 2012-2016, Canonical Ltd.
License: LGPL-3+
-Comment: Last verified commit c4008a71e7212cb6a99a9c17bb218034927d82b7
+Comment: Last verified commit 8c484173e0870fc49c9214c56c6ae8dc9c26463d
Files: src/github.com/juju/govmomi/*
Copyright: 2014-2015 VMware, Inc. All Rights Reserved.
@@ -226,7 +256,7 @@
Files: src/github.com/juju/httprequest/*
Copyright: 2015 Canonical Ltd.
License: LGPL-3+
-Comment: Last verified commit 796aaafaf712f666df58d31a482c51233038bf9f
+Comment: Last verified commit 266fd1e9debf09c037a63f074d099a2da4559ece
Files: src/github.com/juju/idmclient/*
Copyright: 2014, 2015, 2016 Canonical Ltd.
@@ -245,25 +275,6 @@
2014-2015 Cloudbase Solutions SRL
License: AGPL-3
-Files: src/github.com/juju/juju/cloudconfig/powershell_helpers.go
-Copyright: 2011-2015 Canonical Ltd.
- 2014-2015 Cloudbase Solutions
- 2012 Aaron Jensen
- 2009 Vladimir Vasiltsov
-License: AGPL-3
-Comment: - Contains some code borrowed from
- https://bitbucket.org/splatteredbits/carbon.
- Original file can be found at Source/Security/Privilege.cs and
- licensed under Apache-2.0 license. This license is compatible with
- AGPLv3 and derived works can and have been licensed under AGPLv3.
- The original Apache-2.0 license for the external source can be found
- inside cloudconfigApache-License.txt.
- - Contains code borrowed from https://github.com/gintsgints/tar-cs
- which is under BSD3 License. This license is compatible with
- AGPLv3 and derived works can and have been licensed under AGPLv3.
- The original BSD3 license for the external source can be found
- inside src/github.com/juju/juju/cloudconfig/BSD3-License.txt
-
Files: src/github.com/juju/juju/cloudconfig/windows_userdata_test.go
Copyright: 2011-2015 Canonical Ltd.
2014 Cloudbase Solutions
@@ -277,7 +288,7 @@
The original Apache-2.0 license for the external source can be found
inside src/github.com/juju/juju/cloudconfig/Apache-License.txt.
-Files: src/github.com/juju/juju/etc/bash_completion.d/juju
+Files: src/github.com/juju/juju/etc/bash_completion.d/juju*
Copyright: 2013+ Canonical Ltd.
License: GPL-3
@@ -294,7 +305,7 @@
Files: src/github.com/juju/loggo/*
Copyright: 2014, 2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit 15901ae4de786d05edae84a27c93d3fbef66c91e
+Comment: Last verified commit 3b7ece48644d35850f4ced4c2cbc2cf8413f58e0
Files: src/github.com/juju/mutex/*
Copyright: 2016 Canonical Ltd.
@@ -304,7 +315,7 @@
Files: src/github.com/juju/persistent-cookiejar/*
Copyright: 2012, 2013, 2015 The Go Authors. All rights reserved.
License: BSD-3-clause
-Comment: Last verified commit e710b897c13ca52828ca2fc9769465186fd6d15c
+Comment: Last verified commit b48f5b9290d63455d10de0c0e4c26e06e6e74842
Files: src/github.com/juju/replicaset/*
Copyright: 2013-2015 Canonical Ltd
@@ -324,7 +335,7 @@
Files: src/github.com/juju/romulus/*
Copyright: 2016 Canonical Ltd.
License: AGPL-3
-Comment: Last verified commit f790f93d956741903ce5b1f027df4c9404227d55
+Comment: Last verified commit bf7827fa2f360ab762c134766ff1d4fff959ea03
Files: src/github.com/juju/schema/*
Copyright: 2011-2016 Canonical Ltd.
@@ -339,7 +350,7 @@
Files: src/github.com/juju/testing/*
Copyright: 2011-2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit d325c22badd4ba3a5fde01d479b188c7a06df755
+Comment: Last verified commit 692d58e72934a2e2b56f663259696e035e6351ff
Files: src/github.com/juju/testing/checkers/file_test.go
src/github.com/juju/testing/mgo_windows.go
@@ -357,7 +368,7 @@
Files: src/github.com/juju/txn/*
Copyright: 2014, 2015 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit 99ec629d0066a4d73c54d8e021a7fc1dc07df614
+Comment: Last verified commit 18d812a45ffc407a4d5f849036b7d8d12febaf08
Files: src/github.com/juju/usso/*
Copyright: 2015 Canonical Ltd.
@@ -368,7 +379,7 @@
Copyright: 2011-2016 Canonical Ltd.
2014, 2015, 2016 Cloudbase Solutions SRL
License: LGPL-3 with linking exception
-Comment: Last verified commit 10adcbfe55417518543ed3c3341de2c7db0a3450
+Comment: Last verified commit 406e7197d0690a3f28c5a147138774eec4c1355e
Files: src/github.com/juju/utils/du/diskusage.go
src/github.com/juju/utils/du/diskusage_windows.go
@@ -411,6 +422,11 @@
License: BSD-3-clause
Comment: Last verified commit 77a895ad01ebc98a4dc95d8355bc825ce80a56f6
+Files: src/github.com/lunixbochs/vtclean/*
+Copyright: 2015 Ryan Hileman
+License: expat
+Comment: Last verified commit 4fbf7632a2c6d3fbdb9931439bdbbeded02cbe36
+
Files: src/github.com/julienschmidt/httprouter/path.go
src/github.com/julienschmidt/httprouter/path_test.go
Copyright: 2013 Julien Schmidt. All rights reserved.
@@ -422,7 +438,7 @@
Files: src/github.com/lxc/lxd/*
Copyright: 2015 LXD contributors
License: Apache-2.0
-Comment: Last verified commit 62f62e9d6e0da14947023f99764eac29c26cef8d
+Comment: Last verified commit 95a324a23696e937c466996d57554e3677b3c84a
Files: src/github.com/lxc/lxd/shared/cert.go
Copyright: 2009, 2010 The Go Authors. All rights reserved.
@@ -440,20 +456,55 @@
is not included in the gnuflag dir. The file is included at
src/launchpad.net/gnuflag/LICENSE
+Files: src/github.com/mattn/go-colorable/*
+Copyright: 2016 Yasuhiro Matsumoto
+License: expat
+Comment: Last verified commit ed8eb9e318d7a84ce5915b495b7d35e0cfe7b5a8
+
+Files: src/github.com/mattn/go-isatty/*
+Copyright: 2016 Yasuhiro Matsumoto
+License: expat
+Comment: Last verified commit 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8
+
Files: src/github.com/mattn/go-runewidth/*
Copyright: 2013-2016 Yasuhiro Matsumoto
License: Expat
Comment: Last verified commit d96d1bd051f2bd9e7e43d602782b37b93b1b5666
+FIles: src/github.com/matttproud/golang_protobuf_extensions/*
+Copyright: 2013-2016 golang protobuf extensions Authors
+License: Apache-2.0
+Comment: Last verified commit c12348ce28de40eed0136aa2b644d0ee0650e56c
+
+Files: src/github.com/prometheus/client_golang/*
+Copyright: 2012 - 2016 Prometheus Authors
+License: Apache-2.0
+Comment: Last verified commit b90ee0840e8e7dfb84c08d13b9c4f3a794586a21
+
+Files: src/github.com/prometheus/client_model/*
+Copyright: 2013 - 2015 Prometheus Authors
+License: Apache-2.0
+Comment: Last verified commit fa8ad6fec33561be4280a8f0514318c79d7f6cb6
+
+Files: src/github.com/prometheus/common/*
+Copyright: 2013 - 2015 Prometheus Authors
+License: Apache-2.0
+Comment: Last verified commit dd586c1c5abb0be59e60f942c22af711a2008cb4
+
+Files: src/github.com/prometheus/procfs/*
+Copyright: 2013 - 2015 Prometheus Authors
+License: Apache-2.0
+Comment: Last verified commit abf152e5f3e97f2fafac028d2cc06c1feb87ffa5
+
Files: src/github.com/rogpeppe/fastuuid/*
Copyright: 2014 Roger Peppe
License: BSD-3-clause
Comment: Last verified commit 6724a57986aff9bff1a1770e9347036def7c89f6
Files: src/golang.org/x/crypto/*
-Copyright: 2009-2015 The Go Authors. All rights reserved.
+Copyright: 2009-2016 The Go Authors. All rights reserved.
License: BSD-3-clause
-Comment: Last verified commit aedad9a179ec1ea11b7064c57cbc6dc30d7724ec
+Comment: Last verified commit 8e06e8ddd9629eb88639aba897641bff8031f1d3
Files: src/golang.org/x/net/*
Copyright: 2009-2015 The Go Authors. All rights reserved.
@@ -489,7 +540,7 @@
2011 AppsAttic Ltd.
2011 Memeo Inc.
License: LGPL-3 with linking exception
-Comment: Last verified commit a651c43e72df7778b14ac6b54e5ac119d32b1263
+Comment: Last verified commit 18899065239e006cc73b0e66800c98c2ce4eee50
Files: src/gopkg.in/check.v1/*
Copyright: 2010-2013 Gustavo Niemeyer
@@ -528,32 +579,32 @@
Files: src/gopkg.in/juju/charm.v6-unstable/*
Copyright: 2011-2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit a3bb92d047b0892452b6a39ece59b4d3a2ac35b9
+Comment: Last verified commit 83771c4919d6810bce5b7e63f46bea5fbfed0b93
Files: src/gopkg.in/juju/charmrepo.v2-unstable/*
Copyright: 2012-2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit 6e6733987fb03100f30e494cc1134351fe4a593b
+Comment: Last verified commit 73c1113f7ddee0306f4b3c19773d35a3f153c04a
Files: src/gopkg.in/juju/charmstore.v5-unstable/*
Copyright: 2012-2016 Canonical Ltd.
License: AGPL-3
-Comment: Last verified commit 2cb9f80553dddaae8c5e2161ea45f4be5d9afc00
+Comment: Last verified commit fd1eef3002fc6b6daff5e97efab6f5056d22dcc7
Files: src/gopkg.in/juju/environschema.v1/*
Copyright: 2015 Canonical Ltd.
License: LGPL-3 with linking exception
Comment: Last verified commit 7359fc7857abe2b11b5b3e23811a9c64cb6b01e0
-Files: src/gopkg.in/juju/jujusvg.v1/*
-Copyright: 2014, 2015 Canonical Ltd.
+Files: src/gopkg.in/juju/jujusvg.v2/*
+Copyright: 2015 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit cc128825adce31ea13020d24e7b3302bac86a8c3
+Comment: Last verified commit d82160011935ef79fc7aca84aba2c6f74700fe75
Files: src/gopkg.in/macaroon-bakery.v1/*
Copyright: 2014, Roger Peppe, Canonical Inc.
License: LGPL-3 with linking exception
-Comment: Last verified commit b097c9d99b2537efaf54492e08f7e148f956ba51
+Comment: Last verified commit 469b44e6f1f9479e115c8ae879ef80695be624d5
Files: src/gopkg.in/macaroon.v1/*
Copyright: 2014, Roger Peppe
@@ -563,7 +614,7 @@
Files: src/gopkg.in/mgo.v2/*
Copyright: 2010-2015 Gustavo Niemeyer
License: BSD-2-clause
-Comment: Last verified commit 29cc868a5ca65f401ff318143f9408d02f4799cc
+Comment: Last verified commit f2b6f6c918c452ad107eec89615f074e3bd80e33
Files: src/gopkg.in/mgo.v2/internal/sasl/sspi_windows.*
Copyright: 2013-2015 - Christian Amor Kvalheim
@@ -576,7 +627,7 @@
Files: src/gopkg.in/juju/names.v2/*
Copyright: 2013-2016 Canonical Ltd.
License: LGPL-3 with linking exception
-Comment: Last verified commit 3e0d33a444fec55aea7269b849eb22da41e73072
+Comment: Last verified commit 3317ff7471a685109e262892b5f81b940ad5782f
Files: src/gopkg.in/natefinch/lumberjack.v2/*
Copyright: 2014 Nate Finch
@@ -589,6 +640,11 @@
License: Expat
Comment: Last verified commit c1b8fa8bdccecb0b8db834ee0b92fdbcfa606dd6
+Files: src/gopkg.in/tomb.v1*
+Copyright: 2010-2011 - Gustavo Niemeyer
+License: BSD-3-clause
+Comment: Last verified commit dd632973f1e7218eb1089048e0798ec9ae7dceb8
+
Files: src/gopkg.in/yaml.v1/*
Copyright: 2011-2014 Canonical Inc.
License: LGPL-3 with linking exception
@@ -621,22 +677,6 @@
Copyright: 2006 Kirill Simonov
License: Expat
-Files: src/launchpad.net/gnuflag/*
-Copyright: 2009, 2010, 2012 The Go Authors. All rights reserved.
-License: BSD-3-clause
-Comment: Last verified commit roger.peppe@canonical.com-20140716064605-pk32dnmfust02yab
-
-Files: src/launchpad.net/golxc/*
-Copyright: 2012-2013, Canonical Ltd.
-License: LGPL-3+
-Comment: Last verified commit ian.booth@canonical.com-20141121040613-ztm1q0iy9rune3zt
-
-Files: src/launchpad.net/tomb/*
-Copyright: 2010-2011 - Gustavo Niemeyer
-License: BSD-3-clause
-Comment: Last verified commit gustavo@niemeyer.net-20140529072043-hzcrlnl3ygvg914q
-
-
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff -Nru juju-core-2.0~beta15/debian/juju-2.0.conf juju-core-2.0.0/debian/juju-2.0.conf
--- juju-core-2.0~beta15/debian/juju-2.0.conf 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/juju-2.0.conf 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1,2 @@
+fs.inotify.max_user_watches = 524288
+fs.inotify.max_user_instances = 256
diff -Nru juju-core-2.0~beta15/debian/juju-2.0.config juju-core-2.0.0/debian/juju-2.0.config
--- juju-core-2.0~beta15/debian/juju-2.0.config 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/juju-2.0.config 2016-10-31 19:55:49.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+# Source debconf library
+. /usr/share/debconf/confmodule
+
+ARCH=`dpkg --print-architecture`
+case $ARCH in amd64|arm64|ppc64el|s390x)
+ exit 0
+esac
+db_input critical juju/unsupportedarch || true
+db_go
diff -Nru juju-core-2.0~beta15/debian/juju-2.0.postinst juju-core-2.0.0/debian/juju-2.0.postinst
--- juju-core-2.0~beta15/debian/juju-2.0.postinst 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/juju-2.0.postinst 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1,29 @@
+#!/bin/sh
+# postinst script for juju-2.0
+
+set -e
+
+case $DPKG_MAINTSCRIPT_ARCH in
+amd64|arm64|ppc64el|s390x)
+ case "$1" in
+ configure)
+ if [ -x /etc/init.d/procps ]; then
+ invoke-rc.d procps restart || true
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+ esac
+ ;;
+esac
+
+
+exit 0
+
+##DEBHELPER##
diff -Nru juju-core-2.0~beta15/debian/juju-2.0.templates juju-core-2.0.0/debian/juju-2.0.templates
--- juju-core-2.0~beta15/debian/juju-2.0.templates 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/juju-2.0.templates 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1,8 @@
+Template: juju/unsupportedarch
+Type: note
+_Description: This package is not supported under this architecture.
+ The juju 2.0 client package is not supported under this architecture.
+ Please use a supported architecture (amd64, arm64, ppc64el, s390x).
+ .
+ This package did not install juju, contains no binaries, and should be
+ removed once this message has been viewed.
diff -Nru juju-core-2.0~beta15/debian/patches/gccgo-vsphere-storage.diff juju-core-2.0.0/debian/patches/gccgo-vsphere-storage.diff
--- juju-core-2.0~beta15/debian/patches/gccgo-vsphere-storage.diff 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/patches/gccgo-vsphere-storage.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,13 +0,0 @@
-Index: quilt/src/github.com/juju/juju/provider/vsphere/storage.go
-===================================================================
---- quilt.orig/src/github.com/juju/juju/provider/vsphere/storage.go
-+++ quilt/src/github.com/juju/juju/provider/vsphere/storage.go
-@@ -1,6 +1,8 @@
- // Copyright 2016 Canonical Ltd.
- // Licensed under the AGPLv3, see LICENCE file for details.
-
-+// +build !gccgo
-+
- package vsphere
-
- import (
diff -Nru juju-core-2.0~beta15/debian/patches/series juju-core-2.0.0/debian/patches/series
--- juju-core-2.0~beta15/debian/patches/series 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-gccgo-vsphere-storage.diff
diff -Nru juju-core-2.0~beta15/debian/po/POTFILES.in juju-core-2.0.0/debian/po/POTFILES.in
--- juju-core-2.0~beta15/debian/po/POTFILES.in 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/po/POTFILES.in 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] juju-2.0.templates
diff -Nru juju-core-2.0~beta15/debian/po/templates.pot juju-core-2.0.0/debian/po/templates.pot
--- juju-core-2.0~beta15/debian/po/templates.pot 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/po/templates.pot 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1,40 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the juju-core package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: juju-core\n"
+"Report-Msgid-Bugs-To: juju-core@packages.debian.org\n"
+"POT-Creation-Date: 2016-10-25 12:39-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: note
+#. Description
+#: ../juju-2.0.templates:1001
+msgid "This package is not supported under this architecture."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../juju-2.0.templates:1001
+msgid ""
+"The juju 2.0 client package is not supported under this architecture. "
+"Please use a supported architecture (amd64, arm64, ppc64el, s390x)."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../juju-2.0.templates:1001
+msgid ""
+"This package did not install juju, contains no binaries, and should be "
+"removed once this message has been viewed."
+msgstr ""
diff -Nru juju-core-2.0~beta15/debian/rules juju-core-2.0.0/debian/rules
--- juju-core-2.0~beta15/debian/rules 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/rules 2016-10-20 13:28:12.000000000 +0000
@@ -23,13 +23,7 @@
dh $@ --with=golang --buildsystem=golang --builddirectory=_build
COMMON_FLAGS:= -x -v
-golang_archs:= amd64 i386 armhf s390x ppc64el arm64
-ifeq (,$(filter $(DEB_HOST_ARCH), $(golang_archs)))
-# NOTE(james-page) statically link libgo for the jujud binary for gccgo
-# this allows the binary to be re-cut for upstream tool distribution and
-# mimics the behaviour of the golang gc compiler.
-JUJUD_FLAGS:= -gccgoflags -static-libgo
-endif
+supported_archs:= amd64 s390x ppc64el arm64
# NOTE: ensure /usr/share/gocode is use in preference to any
# embedded source for dependencies.
@@ -37,10 +31,12 @@
./debian/helpers/setup-build-directory.py
override_dh_auto_build:
- dh_auto_build -- $(COMMON_FLAGS)
- rm _build/bin/jujud
- # re-link jujud with specific options
- go install $(COMMON_FLAGS) $(JUJUD_FLAGS) github.com/juju/juju/cmd/jujud
+ifneq (,$(filter $(DEB_HOST_ARCH), $(supported_archs)))
+ dh_auto_build -- $(COMMON_FLAGS)
+ rm _build/bin/jujud
+ # re-link jujud with specific options
+ go install $(COMMON_FLAGS) $(JUJUD_FLAGS) github.com/juju/juju/cmd/jujud
+endif
# Don't run the tests -- the juju unit tests are too heavyweight to run during
# package build.
@@ -48,6 +44,7 @@
:
override_dh_auto_install:
+ifneq (,$(filter $(DEB_HOST_ARCH), $(supported_archs)))
echo '#!/bin/sh\nexport PATH=/usr/lib/juju-$(VERSION)/bin:"$$PATH"\nexec juju "$$@"' > _build/bin/juju-$(VERSION)
chmod 755 _build/bin/juju-$(VERSION)
mkdir -p _build/home
@@ -63,6 +60,8 @@
cp src/github.com/juju/juju/etc/bash_completion.d/juju-version _build/juju
dh_install _build/juju src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 \
usr/share/bash-completion/completions
+ dh_install debian/juju-2.0.conf usr/lib/sysctl.d
+endif
override_dh_link:
dh_link -pjuju-2.0 usr/bin/juju-$(VERSION) usr/bin/juju
@@ -71,7 +70,9 @@
dh_link
override_dh_compress:
- dh_compress usr/lib/juju-$(VERSION)/man/man1/juju.1
+ifneq (,$(filter $(DEB_HOST_ARCH), $(supported_archs)))
+ dh_compress -pjuju-2.0 usr/lib/juju-$(VERSION)/man/man1/juju.1
+endif
dh_compress
override_dh_auto_clean:
diff -Nru juju-core-2.0~beta15/debian/tests/client juju-core-2.0.0/debian/tests/client
--- juju-core-2.0~beta15/debian/tests/client 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/client 2016-10-20 13:28:12.000000000 +0000
@@ -2,6 +2,14 @@
set -ex
-echo "Testing juju version: "
-juju version
-echo "OK"
+ARCH=`dpkg --print-architecture`
+if [ "$ARCH" = "amd64" -o "$ARCH" = "arm64" -o "$ARCH" = "ppc64el" -o "$ARCH" = "s390x" ]
+then
+ echo "Testing juju version: "
+ juju version
+ echo "OK"
+else
+ echo "SKIP: Unsupported Architecture"
+ exit 0
+fi
+
diff -Nru juju-core-2.0~beta15/debian/tests/current-lxd-provider juju-core-2.0.0/debian/tests/current-lxd-provider
--- juju-core-2.0~beta15/debian/tests/current-lxd-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/current-lxd-provider 2016-10-20 13:28:12.000000000 +0000
@@ -1,6 +1,13 @@
#!/bin/sh
set -ex
-sh debian/tests/setup-lxd.sh
-ln /var/log/lxd/lxd.log "$ADT_ARTIFACTS/lxd.log"
-sh debian/tests/normal-user.sh debian/tests/lxd-provider
+ARCH=`dpkg --print-architecture`
+if [ "$ARCH" = "amd64" -o "$ARCH" = "arm64" -o "$ARCH" = "ppc64el" -o "$ARCH" = "s390x" ]
+then
+ sh debian/tests/setup-lxd.sh
+ ln /var/log/lxd/lxd.log "$ADT_ARTIFACTS/lxd.log"
+ sh debian/tests/normal-user.sh debian/tests/lxd-provider
+else
+ echo "SKIP: Unsupported Architecture"
+ exit 0
+fi
diff -Nru juju-core-2.0~beta15/debian/tests/current-manual-provider juju-core-2.0.0/debian/tests/current-manual-provider
--- juju-core-2.0~beta15/debian/tests/current-manual-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/current-manual-provider 2016-10-20 13:28:12.000000000 +0000
@@ -1,9 +1,16 @@
#!/bin/sh
set -ex
-if ! apt-cache show juju-mongodb3.2 >/dev/null 2>&1; then
- echo "SKIP: 32-bit state servers not supported after xenial."
- exit 0
-fi
+ARCH=`dpkg --print-architecture`
+if [ "$ARCH" = "amd64" -o "$ARCH" = "arm64" -o "$ARCH" = "ppc64el" -o "$ARCH" = "s390x" ]
+then
+ if ! apt-cache show juju-mongodb3.2 >/dev/null 2>&1; then
+ echo "SKIP: 32-bit state servers not supported after xenial."
+ exit 0
+ fi
-sh debian/tests/normal-user.sh debian/tests/manual-provider
+ sh debian/tests/normal-user.sh debian/tests/manual-provider
+else
+ echo "SKIP: Unsupported Architecture"
+ exit 0
+fi
diff -Nru juju-core-2.0~beta15/debian/tests/future-lxd-provider juju-core-2.0.0/debian/tests/future-lxd-provider
--- juju-core-2.0~beta15/debian/tests/future-lxd-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/future-lxd-provider 2016-10-20 13:28:12.000000000 +0000
@@ -1,12 +1,19 @@
#!/bin/sh
set -ex
-if [ ! -d /run/systemd/system ]; then
- echo "SKIP: non-systemd series are not valid future series."
- exit 0
-fi
+ARCH=`dpkg --print-architecture`
+if [ "$ARCH" = "amd64" -o "$ARCH" = "arm64" -o "$ARCH" = "ppc64el" -o "$ARCH" = "s390x" ]
+then
+ if [ ! -d /run/systemd/system ]; then
+ echo "SKIP: non-systemd series are not valid future series."
+ exit 0
+ fi
-sh debian/tests/fake-future.sh
-sh debian/tests/setup-lxd.sh
-ln /var/log/lxd/lxd.log "$ADT_ARTIFACTS/lxd.log"
-sh debian/tests/normal-user.sh debian/tests/lxd-provider
+ sh debian/tests/fake-future.sh
+ sh debian/tests/setup-lxd.sh
+ ln /var/log/lxd/lxd.log "$ADT_ARTIFACTS/lxd.log"
+ sh debian/tests/normal-user.sh debian/tests/lxd-provider
+else
+ echo "SKIP: Unsupported Architecture"
+ exit 0
+fi
diff -Nru juju-core-2.0~beta15/debian/tests/future-manual-provider juju-core-2.0.0/debian/tests/future-manual-provider
--- juju-core-2.0~beta15/debian/tests/future-manual-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/future-manual-provider 2016-10-20 13:28:12.000000000 +0000
@@ -1,14 +1,26 @@
#!/bin/sh
set -ex
-if [ ! -d /run/systemd/system ]; then
- echo "SKIP: non-systemd series are not valid future series."
- exit 0
-fi
-if ! apt-cache show juju-mongodb3.2 >/dev/null 2>&1; then
- echo "SKIP: 32-bit state servers not supported in future series."
- exit 0
-fi
+ARCH=`dpkg --print-architecture`
+if [ "$ARCH" = "amd64" -o "$ARCH" = "arm64" -o "$ARCH" = "ppc64el" -o "$ARCH" = "s390x" ]
+then
+ # bug 1629376 prevents juju from working in this scenario
+ # juju will not bootstrap published versions of juju on unknown series
+ echo "SKIP: Juju won't bootstrap unknown without published agent (LP:1629376)"
+ exit 0
-sh debian/tests/fake-future.sh
-sh debian/tests/normal-user.sh debian/tests/manual-provider
+ if [ ! -d /run/systemd/system ]; then
+ echo "SKIP: non-systemd series are not valid future series."
+ exit 0
+ fi
+ if ! apt-cache show juju-mongodb3.2 >/dev/null 2>&1; then
+ echo "SKIP: 32-bit state servers not supported in future series."
+ exit 0
+ fi
+
+ sh debian/tests/fake-future.sh
+ sh debian/tests/normal-user.sh debian/tests/manual-provider
+else
+ echo "SKIP: Unsupported Architecture"
+ exit 0
+fi
diff -Nru juju-core-2.0~beta15/debian/tests/lxd-provider juju-core-2.0.0/debian/tests/lxd-provider
--- juju-core-2.0~beta15/debian/tests/lxd-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/lxd-provider 2016-10-20 13:28:12.000000000 +0000
@@ -12,9 +12,20 @@
echo "Prepopulating lxd with daily $SERIES image: "
lxc image copy ubuntu-daily:$SERIES local: --alias ubuntu-$SERIES
+lxc image list
+lxc info
echo "Testing juju bootstrap: "
-juju bootstrap my-controller lxd --upload-tools --debug --config default-series=$SERIES
+BOOTSTRAP_ARGS="--debug --config default-series=$SERIES --config enable-os-upgrade=false --config no-proxy=$no_proxy"
+if [ "$http_proxy" ]
+then
+ BOOTSTRAP_ARGS=$BOOTSTRAP_ARGS' --config http-proxy='$http_proxy
+fi
+if [ "$https_proxy" ]
+then
+ BOOTSTRAP_ARGS=$BOOTSTRAP_ARGS' --config https-proxy='$https_proxy
+fi
+juju bootstrap lxd my-controller $BOOTSTRAP_ARGS
echo "OK"
echo "Waiting for environment to bootstrap: "
diff -Nru juju-core-2.0~beta15/debian/tests/manual-provider juju-core-2.0.0/debian/tests/manual-provider
--- juju-core-2.0~beta15/debian/tests/manual-provider 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/manual-provider 2016-10-20 13:28:12.000000000 +0000
@@ -14,4 +14,4 @@
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keyscan "$ip" >> ~/.ssh/known_hosts
-juju bootstrap my-controller manual/$ip --upload-tools --debug
+juju bootstrap manual/$ip my-controller --debug --config enable-os-upgrade=false
diff -Nru juju-core-2.0~beta15/debian/tests/setup-lxd.sh juju-core-2.0.0/debian/tests/setup-lxd.sh
--- juju-core-2.0~beta15/debian/tests/setup-lxd.sh 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/tests/setup-lxd.sh 2016-10-20 13:28:12.000000000 +0000
@@ -5,6 +5,22 @@
# bridge so the juju lxd provider can function. Taken from changes made
# to cloud-init to do approximately this.
+VERSION=$(lxd --version)
+
+# LXD 2.3+ needs lxdbr0 setup via lxc.
+if dpkg --compare-versions "$VERSION" gt "2.2"; then
+ if ! lxc network list | grep -q lxdbr0; then
+ # Configure a known address ranges for lxdbr0.
+ lxc network create lxdbr0 \
+ ipv4.address=10.0.8.1/24 ipv4.nat=true \
+ ipv6.address=none ipv6.nat=false
+ fi
+ lxc network show lxdbr0
+ lxc config show
+ exit 0
+fi
+
+# LXD 2.2 and earlier use debconf to create and configure the network.
debconf-communicate << EOF
set lxd/setup-bridge true
set lxd/bridge-domain lxd
@@ -24,4 +40,4 @@
dpkg-reconfigure lxd --frontend=noninteractive
# Must run a command for systemd socket activation to start the service
-lxc finger
+lxc config show
diff -Nru juju-core-2.0~beta15/debian/upstream/signing-key.asc juju-core-2.0.0/debian/upstream/signing-key.asc
--- juju-core-2.0~beta15/debian/upstream/signing-key.asc 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/debian/upstream/signing-key.asc 2016-10-20 13:28:12.000000000 +0000
@@ -0,0 +1,26 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQENBFStm2IBCACyp8ayW/1D5Qta2mgz7YrD6lY9eKID8YTIQEAnGf1SPQL9iBKR
+I7EAAzOqeBlHsPRwUOUw7fv7YFmm8XQTqyj/e5zbe89OLrC08qrgZL0p83ejR1J+
+P/7q4LT8bD0DxYFJ+VzvFTlOOCHhofi3NykgCu7FmJroTJX9NKwrfQptSyYfLq9T
+1zH30eGp7vtv9QwypAivxRq43dwtcDUameQNdDmgwx5mqUxHXkH7V+yWJqZW+Rw6
+YCQmUc8RrtTrkoRRMLBwB7gQRWGJnwuyNDgVF3ZHSJxH3W1vTSqzgWckfLg2a/Yg
+2kYcop94qZUvLRvUfJoK5CRBbl08XZfSN1PVABEBAAGJATcEHwECACEFAlStm2IX
+DIARgSee7n7In7eBcCra95Ni2kSi0dsCBwAACgkQa0knIBmuGVLIZAgAowYVL3b3
+sJeq0juwP2zYpewr/HOpxnzl5CJ6IqwKl678WbH2gGuIkGjpvM27j1So4uTOBFIP
+3vrBDoIsk5/TZ3KnBcSrP2nBvz/jGRIFnivavs0GfXBINDX5RHhF0FD14f6M61Hx
+1+1mC3qBr8BC7b4OT0zR/v070Ii21WAcu4gerGFsK5Ib0E2RbnumW4BM0sOoE9lK
+MgnNuyg4QQ7XVPPztLN0R6dwrUOjBBmUvHFLR5dO5pe0E3a8NqpzaT9TgT9Z/a3O
+ZoycFoxgy9gD7kcTSm2rPd2/BRVxienB7sNGHA6X9Md9cXMJLk5/wJ1SyEUaqwTm
+lgK8UoUl9+qX7LQ4Q2Fub25pY2FsIEp1anUgUUEgQm90IDxhYXJvbi5iZW50bGV5
+K2NqcWFAY2Fub25pY2FsLmNvbT6JAVoEEwECAEQFAlStm2ICGwMFCQlmAYAGCwkI
+BwMCBhUIAgkKCwQWAgMBAh4BAheAGxhoa3A6Ly9rZXlzZXJ2ZXIudWJ1bnR1LmNv
+bQAKCRBrSScgGa4ZUlqZB/9zOnPS1gjvdpxoGdbLu1YIa/uNCCzdSa8eq1TvakjI
+sM/Y3JSXAKAF+dDo4naFSnXTtIQJ+vxRM1qelDFLCDcWCFZj83F1H557CcvrQlN5
+k1qlDTx5GB+NEj2ssuLcLJxFYzxvhI0/jvNVj6fU6jRsBXnMBU588+ls5/Hfj1Cf
+WYSWC8laPz1ynk+oGSqh6Zt8PH+qSHyfTA+wvrt+NAateLhyC9O7+8d7B4yZ3bJk
+qca5Uif8XtE40Ryp/ER8HtV30yEJXdOwuSCh/GcWr5xznkmMeEcyuxkDhCQwhwj5
+eCegY4pbZcnZMlkubEEVVM/B3BnbaMUxfcaGdW8135Rt
+=8Jlc
+-----END PGP PUBLIC KEY BLOCK-----
diff -Nru juju-core-2.0~beta15/debian/watch juju-core-2.0.0/debian/watch
--- juju-core-2.0~beta15/debian/watch 2016-08-22 12:17:34.000000000 +0000
+++ juju-core-2.0.0/debian/watch 2016-10-20 13:28:12.000000000 +0000
@@ -1,3 +1,5 @@
version=3
-opts="uversionmangle=s/-/./" \
- https://launchpad.net/juju-core/+download https://launchpad.net/juju-core/.*/.*/.*/juju-core_(.*)\.tar\.gz
+opts="uversionmangle=s/^1://;s/-/~/" \
+ https://launchpad.net/juju/+download https://launchpad.net/juju/.*/.*/.*/juju-core_(.*)\.tar\.gz
+opts=pgpsigurlmangle=s/$/.asc/ \
+ https://launchpad.net/juju/+download https://launchpad.net/juju/.*/.*/.*/juju-core_(.*)\.tar\.gz
diff -Nru juju-core-2.0~beta15/src/github.com/altoros/gosigma/.gitignore juju-core-2.0.0/src/github.com/altoros/gosigma/.gitignore
--- juju-core-2.0~beta15/src/github.com/altoros/gosigma/.gitignore 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/altoros/gosigma/.gitignore 2016-10-13 14:31:55.000000000 +0000
@@ -0,0 +1,2 @@
+*.test
+*cover*.out
\ No newline at end of file
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/classicadministrators.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/classicadministrators.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/classicadministrators.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/classicadministrators.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,125 @@
+package authorization
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ClassicAdministratorsClient is the client for the ClassicAdministrators
+// methods of the Authorization service.
+type ClassicAdministratorsClient struct {
+ ManagementClient
+}
+
+// NewClassicAdministratorsClient creates an instance of the
+// ClassicAdministratorsClient client.
+func NewClassicAdministratorsClient(subscriptionID string) ClassicAdministratorsClient {
+ return NewClassicAdministratorsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewClassicAdministratorsClientWithBaseURI creates an instance of the
+// ClassicAdministratorsClient client.
+func NewClassicAdministratorsClientWithBaseURI(baseURI string, subscriptionID string) ClassicAdministratorsClient {
+ return ClassicAdministratorsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List gets a list of classic administrators for the subscription.
+func (client ClassicAdministratorsClient) List() (result ClassicAdministratorListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ClassicAdministratorsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ClassicAdministratorsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ClassicAdministratorsClient) ListResponder(resp *http.Response) (result ClassicAdministratorListResult, 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 ClassicAdministratorsClient) ListNextResults(lastResults ClassicAdministratorListResult) (result ClassicAdministratorListResult, err error) {
+ req, err := lastResults.ClassicAdministratorListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.ClassicAdministratorsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,6 @@
+// Package authorization implements the Azure ARM Authorization service API
+// version 2015-07-01.
+//
package authorization
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,17 +17,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Authorization
- APIVersion = "2015-01-01"
+ APIVersion = "2015-07-01"
// DefaultBaseURI is the default URI used for the service Authorization
DefaultBaseURI = "https://management.azure.com"
@@ -34,6 +37,7 @@
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +51,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/managementlocks.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/managementlocks.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/managementlocks.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/managementlocks.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,858 +0,0 @@
-package authorization
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// ManagementLocksClient is the client for the ManagementLocks methods of the
-// Authorization service.
-type ManagementLocksClient struct {
- ManagementClient
-}
-
-// NewManagementLocksClient creates an instance of the ManagementLocksClient
-// client.
-func NewManagementLocksClient(subscriptionID string) ManagementLocksClient {
- return NewManagementLocksClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewManagementLocksClientWithBaseURI creates an instance of the
-// ManagementLocksClient client.
-func NewManagementLocksClientWithBaseURI(baseURI string, subscriptionID string) ManagementLocksClient {
- return ManagementLocksClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdateAtResourceGroupLevel create or update a management lock at
-// the resource group level.
-//
-// resourceGroupName is the resource group name. lockName is the lock name.
-// parameters is the management lock parameters.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(resourceGroupName string, lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
- req, err := client.CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName, lockName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateAtResourceGroupLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateAtResourceGroupLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdateAtResourceGroupLevelPreparer prepares the CreateOrUpdateAtResourceGroupLevel request.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName string, lockName string, parameters ManagementLockProperties) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateAtResourceGroupLevelSender sends the CreateOrUpdateAtResourceGroupLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateAtResourceGroupLevelResponder handles the response to the CreateOrUpdateAtResourceGroupLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateAtResourceLevel create or update a management lock at the
-// resource level or any level below resource.
-//
-// resourceGroupName is the name of the resource group.
-// resourceProviderNamespace is resource identity. parentResourcePath is
-// resource identity. resourceType is resource identity. resourceName is
-// resource identity. lockName is the name of lock. parameters is create or
-// update management lock parameters.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
- req, err := client.CreateOrUpdateAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateAtResourceLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateAtResourceLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtResourceLevel", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdateAtResourceLevelPreparer prepares the CreateOrUpdateAtResourceLevel request.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockProperties) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateAtResourceLevelSender sends the CreateOrUpdateAtResourceLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateAtResourceLevelResponder handles the response to the CreateOrUpdateAtResourceLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateAtSubscriptionLevel create or update a management lock at the
-// subscription level.
-//
-// lockName is the name of lock. parameters is the management lock parameters.
-func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(lockName string, parameters ManagementLockProperties) (result ManagementLockObject, ae error) {
- req, err := client.CreateOrUpdateAtSubscriptionLevelPreparer(lockName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateAtSubscriptionLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateAtSubscriptionLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdateAtSubscriptionLevelPreparer prepares the CreateOrUpdateAtSubscriptionLevel request.
-func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelPreparer(lockName string, parameters ManagementLockProperties) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateAtSubscriptionLevelSender sends the CreateOrUpdateAtSubscriptionLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
-}
-
-// CreateOrUpdateAtSubscriptionLevelResponder handles the response to the CreateOrUpdateAtSubscriptionLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteAtResourceGroupLevel deletes the management lock of a resource group.
-//
-// resourceGroup is the resource group names. lockName is the name of lock.
-func (client ManagementLocksClient) DeleteAtResourceGroupLevel(resourceGroup string, lockName string) (result autorest.Response, ae error) {
- req, err := client.DeleteAtResourceGroupLevelPreparer(resourceGroup, lockName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure preparing request")
- }
-
- resp, err := client.DeleteAtResourceGroupLevelSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure sending request")
- }
-
- result, err = client.DeleteAtResourceGroupLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceGroupLevel", "Failure responding to request")
- }
-
- return
-}
-
-// DeleteAtResourceGroupLevelPreparer prepares the DeleteAtResourceGroupLevel request.
-func (client ManagementLocksClient) DeleteAtResourceGroupLevelPreparer(resourceGroup string, lockName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "resourceGroup": url.QueryEscape(resourceGroup),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteAtResourceGroupLevelSender sends the DeleteAtResourceGroupLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) DeleteAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
-}
-
-// DeleteAtResourceGroupLevelResponder handles the response to the DeleteAtResourceGroupLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) DeleteAtResourceGroupLevelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteAtResourceLevel deletes the management lock of a resource or any
-// level below resource.
-//
-// resourceGroupName is the name of the resource group.
-// resourceProviderNamespace is resource identity. parentResourcePath is
-// resource identity. resourceType is resource identity. resourceName is
-// resource identity. lockName is the name of lock.
-func (client ManagementLocksClient) DeleteAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result autorest.Response, ae error) {
- req, err := client.DeleteAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure preparing request")
- }
-
- resp, err := client.DeleteAtResourceLevelSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure sending request")
- }
-
- result, err = client.DeleteAtResourceLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtResourceLevel", "Failure responding to request")
- }
-
- return
-}
-
-// DeleteAtResourceLevelPreparer prepares the DeleteAtResourceLevel request.
-func (client ManagementLocksClient) DeleteAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteAtResourceLevelSender sends the DeleteAtResourceLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) DeleteAtResourceLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
-}
-
-// DeleteAtResourceLevelResponder handles the response to the DeleteAtResourceLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) DeleteAtResourceLevelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteAtSubscriptionLevel deletes the management lock of a subscription.
-//
-// lockName is the name of lock.
-func (client ManagementLocksClient) DeleteAtSubscriptionLevel(lockName string) (result autorest.Response, ae error) {
- req, err := client.DeleteAtSubscriptionLevelPreparer(lockName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure preparing request")
- }
-
- resp, err := client.DeleteAtSubscriptionLevelSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure sending request")
- }
-
- result, err = client.DeleteAtSubscriptionLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "DeleteAtSubscriptionLevel", "Failure responding to request")
- }
-
- return
-}
-
-// DeleteAtSubscriptionLevelPreparer prepares the DeleteAtSubscriptionLevel request.
-func (client ManagementLocksClient) DeleteAtSubscriptionLevelPreparer(lockName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteAtSubscriptionLevelSender sends the DeleteAtSubscriptionLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) DeleteAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusOK, http.StatusAccepted)
-}
-
-// DeleteAtSubscriptionLevelResponder handles the response to the DeleteAtSubscriptionLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) DeleteAtSubscriptionLevelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets the management lock of a scope.
-//
-// lockName is name of the management lock.
-func (client ManagementLocksClient) Get(lockName string) (result ManagementLockObject, ae error) {
- req, err := client.GetPreparer(lockName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ManagementLocksClient) GetPreparer(lockName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "lockName": url.QueryEscape(lockName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) GetResponder(resp *http.Response) (result ManagementLockObject, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAtResourceGroupLevel gets all the management locks of a resource group.
-//
-// resourceGroupName is resource group name. filter is the filter to apply on
-// the operation.
-func (client ManagementLocksClient) ListAtResourceGroupLevel(resourceGroupName string, filter string) (result ManagementLockListResult, ae error) {
- req, err := client.ListAtResourceGroupLevelPreparer(resourceGroupName, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure preparing request")
- }
-
- resp, err := client.ListAtResourceGroupLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure sending request")
- }
-
- result, err = client.ListAtResourceGroupLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure responding to request")
- }
-
- return
-}
-
-// ListAtResourceGroupLevelPreparer prepares the ListAtResourceGroupLevel request.
-func (client ManagementLocksClient) ListAtResourceGroupLevelPreparer(resourceGroupName string, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListAtResourceGroupLevelSender sends the ListAtResourceGroupLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) ListAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListAtResourceGroupLevelResponder handles the response to the ListAtResourceGroupLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) ListAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAtResourceGroupLevelNextResults retrieves the next set of results, if any.
-func (client ManagementLocksClient) ListAtResourceGroupLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
- req, err := lastResults.ManagementLockListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListAtResourceGroupLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure sending next results request request")
- }
-
- result, err = client.ListAtResourceGroupLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceGroupLevel", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListAtResourceLevel gets all the management locks of a resource or any
-// level below resource.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity. filter is the filter to apply
-// on the operation.
-func (client ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result ManagementLockListResult, ae error) {
- req, err := client.ListAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure preparing request")
- }
-
- resp, err := client.ListAtResourceLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure sending request")
- }
-
- result, err = client.ListAtResourceLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure responding to request")
- }
-
- return
-}
-
-// ListAtResourceLevelPreparer prepares the ListAtResourceLevel request.
-func (client ManagementLocksClient) ListAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListAtResourceLevelSender sends the ListAtResourceLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) ListAtResourceLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListAtResourceLevelResponder handles the response to the ListAtResourceLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) ListAtResourceLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAtResourceLevelNextResults retrieves the next set of results, if any.
-func (client ManagementLocksClient) ListAtResourceLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
- req, err := lastResults.ManagementLockListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListAtResourceLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure sending next results request request")
- }
-
- result, err = client.ListAtResourceLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtResourceLevel", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListAtSubscriptionLevel gets all the management locks of a subscription.
-//
-// filter is the filter to apply on the operation.
-func (client ManagementLocksClient) ListAtSubscriptionLevel(filter string) (result ManagementLockListResult, ae error) {
- req, err := client.ListAtSubscriptionLevelPreparer(filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure preparing request")
- }
-
- resp, err := client.ListAtSubscriptionLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure sending request")
- }
-
- result, err = client.ListAtSubscriptionLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure responding to request")
- }
-
- return
-}
-
-// ListAtSubscriptionLevelPreparer prepares the ListAtSubscriptionLevel request.
-func (client ManagementLocksClient) ListAtSubscriptionLevelPreparer(filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListAtSubscriptionLevelSender sends the ListAtSubscriptionLevel request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) ListAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListAtSubscriptionLevelResponder handles the response to the ListAtSubscriptionLevel request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) ListAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAtSubscriptionLevelNextResults retrieves the next set of results, if any.
-func (client ManagementLocksClient) ListAtSubscriptionLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
- req, err := lastResults.ManagementLockListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListAtSubscriptionLevelSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure sending next results request request")
- }
-
- result, err = client.ListAtSubscriptionLevelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListAtSubscriptionLevel", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListNext get a list of management locks at resource level or below.
-//
-// nextLink is nextLink from the previous successful call to List operation.
-func (client ManagementLocksClient) ListNext(nextLink string) (result ManagementLockListResult, ae error) {
- req, err := client.ListNextPreparer(nextLink)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure preparing request")
- }
-
- resp, err := client.ListNextSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure sending request")
- }
-
- result, err = client.ListNextResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure responding to request")
- }
-
- return
-}
-
-// ListNextPreparer prepares the ListNext request.
-func (client ManagementLocksClient) ListNextPreparer(nextLink string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "nextLink": nextLink,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/{nextLink}"),
- autorest.WithPathParameters(pathParameters))
-}
-
-// ListNextSender sends the ListNext request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementLocksClient) ListNextSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListNextResponder handles the response to the ListNext request. The method always
-// closes the http.Response Body.
-func (client ManagementLocksClient) ListNextResponder(resp *http.Response) (result ManagementLockListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextNextResults retrieves the next set of results, if any.
-func (client ManagementLocksClient) ListNextNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, ae error) {
- req, err := lastResults.ManagementLockListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListNextSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure sending next results request request")
- }
-
- result, err = client.ListNextResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "authorization/ManagementLocksClient", "ListNext", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,50 +14,105 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
-// LockLevel enumerates the values for lock level.
-type LockLevel string
+// ClassicAdministrator is classic Administrators
+type ClassicAdministrator struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *ClassicAdministratorProperties `json:"properties,omitempty"`
+}
-const (
- // CanNotDelete specifies the can not delete state for lock level.
- CanNotDelete LockLevel = "CanNotDelete"
- // NotSpecified specifies the not specified state for lock level.
- NotSpecified LockLevel = "NotSpecified"
- // ReadOnly specifies the read only state for lock level.
- ReadOnly LockLevel = "ReadOnly"
-)
+// ClassicAdministratorListResult is classicAdministrator list result
+// information.
+type ClassicAdministratorListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ClassicAdministrator `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
+
+// ClassicAdministratorListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ClassicAdministratorListResult) ClassicAdministratorListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ClassicAdministratorProperties is classic Administrator properties.
+type ClassicAdministratorProperties struct {
+ EmailAddress *string `json:"emailAddress,omitempty"`
+ Role *string `json:"role,omitempty"`
+}
+
+// Permission is role definition permissions.
+type Permission struct {
+ Actions *[]string `json:"actions,omitempty"`
+ NotActions *[]string `json:"notActions,omitempty"`
+}
+
+// PermissionGetResult is permissions information.
+type PermissionGetResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Permission `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
-// DeploymentExtendedFilter is deployment filter.
-type DeploymentExtendedFilter struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
+// PermissionGetResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client PermissionGetResult) PermissionGetResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
}
-// GenericResourceFilter is resource filter.
-type GenericResourceFilter struct {
- ResourceType *string `json:"resourceType,omitempty"`
- Tagname *string `json:"tagname,omitempty"`
- Tagvalue *string `json:"tagvalue,omitempty"`
+// ProviderOperation is operation
+type ProviderOperation struct {
+ Name *string `json:"name,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Origin *string `json:"origin,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
}
-// ManagementLockListResult is list of management locks.
-type ManagementLockListResult struct {
+// ProviderOperationsMetadata is provider Operations metadata
+type ProviderOperationsMetadata struct {
autorest.Response `json:"-"`
- Value *[]ManagementLockObject `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ ResourceTypes *[]ResourceType `json:"resourceTypes,omitempty"`
+ Operations *[]ProviderOperation `json:"operations,omitempty"`
}
-// ManagementLockListResultPreparer prepares a request to retrieve the next set of results. It returns
+// ProviderOperationsMetadataListResult is provider operations metadata list
+type ProviderOperationsMetadataListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ProviderOperationsMetadata `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
+
+// ProviderOperationsMetadataListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client ManagementLockListResult) ManagementLockListResultPreparer() (*http.Request, error) {
+func (client ProviderOperationsMetadataListResult) ProviderOperationsMetadataListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -67,37 +122,102 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// ManagementLockObject is management lock information.
-type ManagementLockObject struct {
+// ResourceType is resource Type
+type ResourceType struct {
+ Name *string `json:"name,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Operations *[]ProviderOperation `json:"operations,omitempty"`
+}
+
+// RoleAssignment is role Assignments
+type RoleAssignment struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *RoleAssignmentPropertiesWithScope `json:"properties,omitempty"`
+}
+
+// RoleAssignmentCreateParameters is role assignment create parameters.
+type RoleAssignmentCreateParameters struct {
+ Properties *RoleAssignmentProperties `json:"properties,omitempty"`
+}
+
+// RoleAssignmentFilter is role Assignments filter
+type RoleAssignmentFilter struct {
+ PrincipalID *string `json:"principalId,omitempty"`
+}
+
+// RoleAssignmentListResult is role assignment list operation result.
+type RoleAssignmentListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]RoleAssignment `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// RoleAssignmentListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client RoleAssignmentListResult) RoleAssignmentListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// RoleAssignmentProperties is role assignment properties.
+type RoleAssignmentProperties struct {
+ RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
+ PrincipalID *string `json:"principalId,omitempty"`
+}
+
+// RoleAssignmentPropertiesWithScope is role assignment properties with scope.
+type RoleAssignmentPropertiesWithScope struct {
+ Scope *string `json:"scope,omitempty"`
+ RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
+ PrincipalID *string `json:"principalId,omitempty"`
+}
+
+// RoleDefinition is role definition.
+type RoleDefinition struct {
autorest.Response `json:"-"`
- Properties *ManagementLockProperties `json:"properties,omitempty"`
ID *string `json:"id,omitempty"`
- Type *string `json:"type,omitempty"`
Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *RoleDefinitionProperties `json:"properties,omitempty"`
+}
+
+// RoleDefinitionFilter is role Definitions filter
+type RoleDefinitionFilter struct {
+ RoleName *string `json:"roleName,omitempty"`
+}
+
+// RoleDefinitionListResult is role definition list operation result.
+type RoleDefinitionListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]RoleDefinition `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
+
+// RoleDefinitionListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client RoleDefinitionListResult) RoleDefinitionListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
}
-// ManagementLockProperties is the management lock properties.
-type ManagementLockProperties struct {
- Level LockLevel `json:"level,omitempty"`
- Notes *string `json:"notes,omitempty"`
-}
-
-// Resource is
-type Resource struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
-
-// ResourceGroupFilter is resource group filter.
-type ResourceGroupFilter struct {
- TagName *string `json:"tagName,omitempty"`
- TagValue *string `json:"tagValue,omitempty"`
-}
-
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
+// RoleDefinitionProperties is role definition properties.
+type RoleDefinitionProperties struct {
+ RoleName *string `json:"roleName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Permissions *[]Permission `json:"permissions,omitempty"`
+ AssignableScopes *[]string `json:"assignableScopes,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/permissions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/permissions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/permissions.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/permissions.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,219 @@
+package authorization
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// PermissionsClient is the client for the Permissions methods of the
+// Authorization service.
+type PermissionsClient struct {
+ ManagementClient
+}
+
+// NewPermissionsClient creates an instance of the PermissionsClient client.
+func NewPermissionsClient(subscriptionID string) PermissionsClient {
+ return NewPermissionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPermissionsClientWithBaseURI creates an instance of the
+// PermissionsClient client.
+func NewPermissionsClientWithBaseURI(baseURI string, subscriptionID string) PermissionsClient {
+ return PermissionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ListForResource gets a resource permissions.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource parentResourcePath is
+// resource resourceType is resource resourceName is resource
+func (client PermissionsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result PermissionGetResult, err error) {
+ req, err := client.ListForResourcePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourcePreparer prepares the ListForResource request.
+func (client PermissionsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceSender sends the ListForResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client PermissionsClient) ListForResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceResponder handles the response to the ListForResource request. The method always
+// closes the http.Response Body.
+func (client PermissionsClient) ListForResourceResponder(resp *http.Response) (result PermissionGetResult, 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 PermissionsClient) ListForResourceNextResults(lastResults PermissionGetResult) (result PermissionGetResult, err error) {
+ req, err := lastResults.PermissionGetResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResource", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForResourceGroup gets a resource group permissions.
+//
+// resourceGroupName is name of the resource group to get the permissions
+// for.The name is case insensitive.
+func (client PermissionsClient) ListForResourceGroup(resourceGroupName string) (result PermissionGetResult, err error) {
+ req, err := client.ListForResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourceGroupPreparer prepares the ListForResourceGroup request.
+func (client PermissionsClient) ListForResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client PermissionsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always
+// closes the http.Response Body.
+func (client PermissionsClient) ListForResourceGroupResponder(resp *http.Response) (result PermissionGetResult, 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 PermissionsClient) ListForResourceGroupNextResults(lastResults PermissionGetResult) (result PermissionGetResult, err error) {
+ req, err := lastResults.PermissionGetResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.PermissionsClient", "ListForResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/provideroperationsmetadataoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/provideroperationsmetadataoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/provideroperationsmetadataoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/provideroperationsmetadataoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,188 @@
+package authorization
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ProviderOperationsMetadataOperationsClient is the client for the
+// ProviderOperationsMetadataOperations methods of the Authorization service.
+type ProviderOperationsMetadataOperationsClient struct {
+ ManagementClient
+}
+
+// NewProviderOperationsMetadataOperationsClient creates an instance of the
+// ProviderOperationsMetadataOperationsClient client.
+func NewProviderOperationsMetadataOperationsClient(subscriptionID string) ProviderOperationsMetadataOperationsClient {
+ return NewProviderOperationsMetadataOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewProviderOperationsMetadataOperationsClientWithBaseURI creates an
+// instance of the ProviderOperationsMetadataOperationsClient client.
+func NewProviderOperationsMetadataOperationsClientWithBaseURI(baseURI string, subscriptionID string) ProviderOperationsMetadataOperationsClient {
+ return ProviderOperationsMetadataOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get gets provider operations metadata
+//
+// resourceProviderNamespace is namespace of the resource provider.
+func (client ProviderOperationsMetadataOperationsClient) Get(resourceProviderNamespace string, expand string) (result ProviderOperationsMetadata, err error) {
+ req, err := client.GetPreparer(resourceProviderNamespace, expand)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ProviderOperationsMetadataOperationsClient) GetPreparer(resourceProviderNamespace string, expand string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProviderOperationsMetadataOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ProviderOperationsMetadataOperationsClient) GetResponder(resp *http.Response) (result ProviderOperationsMetadata, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets provider operations metadata list
+//
+func (client ProviderOperationsMetadataOperationsClient) List(expand string) (result ProviderOperationsMetadataListResult, err error) {
+ req, err := client.ListPreparer(expand)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ProviderOperationsMetadataOperationsClient) ListPreparer(expand string) (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.Authorization/providerOperations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProviderOperationsMetadataOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ProviderOperationsMetadataOperationsClient) ListResponder(resp *http.Response) (result ProviderOperationsMetadataListResult, 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 ProviderOperationsMetadataOperationsClient) ListNextResults(lastResults ProviderOperationsMetadataListResult) (result ProviderOperationsMetadataListResult, err error) {
+ req, err := lastResults.ProviderOperationsMetadataListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roleassignments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roleassignments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roleassignments.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roleassignments.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,769 @@
+package authorization
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// RoleAssignmentsClient is the client for the RoleAssignments methods of the
+// Authorization service.
+type RoleAssignmentsClient struct {
+ ManagementClient
+}
+
+// NewRoleAssignmentsClient creates an instance of the RoleAssignmentsClient
+// client.
+func NewRoleAssignmentsClient(subscriptionID string) RoleAssignmentsClient {
+ return NewRoleAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewRoleAssignmentsClientWithBaseURI creates an instance of the
+// RoleAssignmentsClient client.
+func NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) RoleAssignmentsClient {
+ return RoleAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create role assignment.
+//
+// scope is scope. roleAssignmentName is role assignment name. parameters is
+// role assignment.
+func (client RoleAssignmentsClient) Create(scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters) (result RoleAssignment, err error) {
+ req, err := client.CreatePreparer(scope, roleAssignmentName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client RoleAssignmentsClient) CreatePreparer(scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentName": autorest.Encode("path", roleAssignmentName),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) CreateResponder(resp *http.Response) (result RoleAssignment, 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
+}
+
+// CreateByID create role assignment by Id.
+//
+// roleAssignmentID is role assignment Id parameters is role assignment.
+func (client RoleAssignmentsClient) CreateByID(roleAssignmentID string, parameters RoleAssignmentCreateParameters) (result RoleAssignment, err error) {
+ req, err := client.CreateByIDPreparer(roleAssignmentID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "CreateByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "CreateByID", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "CreateByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateByIDPreparer prepares the CreateByID request.
+func (client RoleAssignmentsClient) CreateByIDPreparer(roleAssignmentID string, parameters RoleAssignmentCreateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentId": roleAssignmentID,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{roleAssignmentId}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateByIDSender sends the CreateByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) CreateByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateByIDResponder handles the response to the CreateByID request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) CreateByIDResponder(resp *http.Response) (result RoleAssignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete role assignment.
+//
+// scope is scope. roleAssignmentName is role assignment name.
+func (client RoleAssignmentsClient) Delete(scope string, roleAssignmentName string) (result RoleAssignment, err error) {
+ req, err := client.DeletePreparer(scope, roleAssignmentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client RoleAssignmentsClient) DeletePreparer(scope string, roleAssignmentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentName": autorest.Encode("path", roleAssignmentName),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) DeleteResponder(resp *http.Response) (result RoleAssignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteByID delete role assignment.
+//
+// roleAssignmentID is role assignment Id
+func (client RoleAssignmentsClient) DeleteByID(roleAssignmentID string) (result RoleAssignment, err error) {
+ req, err := client.DeleteByIDPreparer(roleAssignmentID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "DeleteByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "DeleteByID", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "DeleteByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteByIDPreparer prepares the DeleteByID request.
+func (client RoleAssignmentsClient) DeleteByIDPreparer(roleAssignmentID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentId": roleAssignmentID,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{roleAssignmentId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteByIDSender sends the DeleteByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteByIDResponder handles the response to the DeleteByID request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) DeleteByIDResponder(resp *http.Response) (result RoleAssignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get get single role assignment.
+//
+// scope is scope. roleAssignmentName is role assignment name.
+func (client RoleAssignmentsClient) Get(scope string, roleAssignmentName string) (result RoleAssignment, err error) {
+ req, err := client.GetPreparer(scope, roleAssignmentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client RoleAssignmentsClient) GetPreparer(scope string, roleAssignmentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentName": autorest.Encode("path", roleAssignmentName),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) GetResponder(resp *http.Response) (result RoleAssignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByID get single role assignment.
+//
+// roleAssignmentID is role assignment Id
+func (client RoleAssignmentsClient) GetByID(roleAssignmentID string) (result RoleAssignment, err error) {
+ req, err := client.GetByIDPreparer(roleAssignmentID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "GetByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "GetByID", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "GetByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByIDPreparer prepares the GetByID request.
+func (client RoleAssignmentsClient) GetByIDPreparer(roleAssignmentID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleAssignmentId": roleAssignmentID,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{roleAssignmentId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByIDSender sends the GetByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) GetByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByIDResponder handles the response to the GetByID request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) GetByIDResponder(resp *http.Response) (result RoleAssignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets role assignments of the subscription.
+//
+// filter is the filter to apply on the operation.
+func (client RoleAssignmentsClient) List(filter string) (result RoleAssignmentListResult, err error) {
+ req, err := client.ListPreparer(filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client RoleAssignmentsClient) ListPreparer(filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) ListResponder(resp *http.Response) (result RoleAssignmentListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client RoleAssignmentsClient) ListNextResults(lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) {
+ req, err := lastResults.RoleAssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForResource gets role assignments of the resource.
+//
+// resourceGroupName is the name of the resource group.
+// resourceProviderNamespace is resource identity. parentResourcePath is
+// resource identity. resourceType is resource identity. resourceName is
+// resource identity. filter is the filter to apply on the operation.
+func (client RoleAssignmentsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result RoleAssignmentListResult, err error) {
+ req, err := client.ListForResourcePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourcePreparer prepares the ListForResource request.
+func (client RoleAssignmentsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}providers/Microsoft.Authorization/roleAssignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceSender sends the ListForResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) ListForResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceResponder handles the response to the ListForResource request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) ListForResourceResponder(resp *http.Response) (result RoleAssignmentListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListForResourceNextResults retrieves the next set of results, if any.
+func (client RoleAssignmentsClient) ListForResourceNextResults(lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) {
+ req, err := lastResults.RoleAssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResource", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForResourceGroup gets role assignments of the resource group.
+//
+// resourceGroupName is resource group name. filter is the filter to apply on
+// the operation.
+func (client RoleAssignmentsClient) ListForResourceGroup(resourceGroupName string, filter string) (result RoleAssignmentListResult, err error) {
+ req, err := client.ListForResourceGroupPreparer(resourceGroupName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourceGroupPreparer prepares the ListForResourceGroup request.
+func (client RoleAssignmentsClient) ListForResourceGroupPreparer(resourceGroupName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result RoleAssignmentListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListForResourceGroupNextResults retrieves the next set of results, if any.
+func (client RoleAssignmentsClient) ListForResourceGroupNextResults(lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) {
+ req, err := lastResults.RoleAssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForScope gets role assignments of the scope.
+//
+// scope is scope. filter is the filter to apply on the operation.
+func (client RoleAssignmentsClient) ListForScope(scope string, filter string) (result RoleAssignmentListResult, err error) {
+ req, err := client.ListForScopePreparer(scope, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForScopeSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForScopeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForScopePreparer prepares the ListForScope request.
+func (client RoleAssignmentsClient) ListForScopePreparer(scope string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleAssignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForScopeSender sends the ListForScope request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleAssignmentsClient) ListForScopeSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForScopeResponder handles the response to the ListForScope request. The method always
+// closes the http.Response Body.
+func (client RoleAssignmentsClient) ListForScopeResponder(resp *http.Response) (result RoleAssignmentListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListForScopeNextResults retrieves the next set of results, if any.
+func (client RoleAssignmentsClient) ListForScopeNextResults(lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) {
+ req, err := lastResults.RoleAssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForScopeSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForScopeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleAssignmentsClient", "ListForScope", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roledefinitions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roledefinitions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roledefinitions.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/roledefinitions.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,377 @@
+package authorization
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// RoleDefinitionsClient is the client for the RoleDefinitions methods of the
+// Authorization service.
+type RoleDefinitionsClient struct {
+ ManagementClient
+}
+
+// NewRoleDefinitionsClient creates an instance of the RoleDefinitionsClient
+// client.
+func NewRoleDefinitionsClient(subscriptionID string) RoleDefinitionsClient {
+ return NewRoleDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewRoleDefinitionsClientWithBaseURI creates an instance of the
+// RoleDefinitionsClient client.
+func NewRoleDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) RoleDefinitionsClient {
+ return RoleDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates a role definition.
+//
+// scope is scope roleDefinitionID is role definition id. roleDefinition is
+// role definition.
+func (client RoleDefinitionsClient) CreateOrUpdate(scope string, roleDefinitionID string, roleDefinition RoleDefinition) (result RoleDefinition, err error) {
+ req, err := client.CreateOrUpdatePreparer(scope, roleDefinitionID, roleDefinition)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client RoleDefinitionsClient) CreateOrUpdatePreparer(scope string, roleDefinitionID string, roleDefinition RoleDefinition) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleDefinitionId": autorest.Encode("path", roleDefinitionID),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", pathParameters),
+ autorest.WithJSON(roleDefinition),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleDefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client RoleDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result RoleDefinition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes the role definition.
+//
+// scope is scope roleDefinitionID is role definition id.
+func (client RoleDefinitionsClient) Delete(scope string, roleDefinitionID string) (result RoleDefinition, err error) {
+ req, err := client.DeletePreparer(scope, roleDefinitionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client RoleDefinitionsClient) DeletePreparer(scope string, roleDefinitionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleDefinitionId": autorest.Encode("path", roleDefinitionID),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleDefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client RoleDefinitionsClient) DeleteResponder(resp *http.Response) (result RoleDefinition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get get role definition by name (GUID).
+//
+// scope is scope roleDefinitionID is role definition Id
+func (client RoleDefinitionsClient) Get(scope string, roleDefinitionID string) (result RoleDefinition, err error) {
+ req, err := client.GetPreparer(scope, roleDefinitionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client RoleDefinitionsClient) GetPreparer(scope string, roleDefinitionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleDefinitionId": autorest.Encode("path", roleDefinitionID),
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleDefinitionsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client RoleDefinitionsClient) GetResponder(resp *http.Response) (result RoleDefinition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByID get role definition by name (GUID).
+//
+// roleDefinitionID is fully qualified role definition Id
+func (client RoleDefinitionsClient) GetByID(roleDefinitionID string) (result RoleDefinition, err error) {
+ req, err := client.GetByIDPreparer(roleDefinitionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "GetByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "GetByID", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "GetByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByIDPreparer prepares the GetByID request.
+func (client RoleDefinitionsClient) GetByIDPreparer(roleDefinitionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "roleDefinitionId": roleDefinitionID,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{roleDefinitionId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByIDSender sends the GetByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleDefinitionsClient) GetByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByIDResponder handles the response to the GetByID request. The method always
+// closes the http.Response Body.
+func (client RoleDefinitionsClient) GetByIDResponder(resp *http.Response) (result RoleDefinition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get all role definitions that are applicable at scope and above. Use
+// atScopeAndBelow filter to search below the given scope as well
+//
+// scope is scope filter is the filter to apply on the operation.
+func (client RoleDefinitionsClient) List(scope string, filter string) (result RoleDefinitionListResult, err error) {
+ req, err := client.ListPreparer(scope, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client RoleDefinitionsClient) ListPreparer(scope string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "scope": scope,
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleDefinitions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client RoleDefinitionsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client RoleDefinitionsClient) ListResponder(resp *http.Response) (result RoleDefinitionListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client RoleDefinitionsClient) ListNextResults(lastResults RoleDefinitionListResult) (result RoleDefinitionListResult, err error) {
+ req, err := lastResults.RoleDefinitionListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "authorization.RoleDefinitionsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/authorization/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/authorization/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "authorization", "2015-01-01")
+ return fmt.Sprintf(userAgentFormat, Version(), "authorization", "2015-07-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/account.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/account.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/account.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/account.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,676 @@
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AccountClient is the client for the Account methods of the Batch service.
+type AccountClient struct {
+ ManagementClient
+}
+
+// NewAccountClient creates an instance of the AccountClient client.
+func NewAccountClient(subscriptionID string) AccountClient {
+ return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountClientWithBaseURI creates an instance of the AccountClient client.
+func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient {
+ return AccountClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create creates a new Batch account with the specified parameters. Existing
+// accounts cannot be updated with this API and should instead be updated
+// with the Update Batch Account API. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group that contains the new
+// Batch account. accountName is a name for the Batch account which must be
+// unique within the region. Batch account names must be between 3 and 24
+// characters in length and must use only numbers and lowercase letters. This
+// name is used as part of the DNS name that is used to access the Batch
+// service in the region in which the account is created. For example:
+// http://accountname.region.batch.azure.com/. parameters is additional
+// parameters for account creation.
+func (client AccountClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(resourceGroupName, accountName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client AccountClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client AccountClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Delete deletes the specified Batch account. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account to be deleted. accountName is the name of the account to be
+// deleted.
+func (client AccountClient) Delete(resourceGroupName string, accountName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, accountName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountClient) DeletePreparer(resourceGroupName string, accountName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusNoContent, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets information about the specified Batch account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the account.
+func (client AccountClient) Get(resourceGroupName string, accountName string) (result AccountResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AccountClient) GetPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AccountClient) GetResponder(resp *http.Response) (result AccountResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets information about the Batch accounts associated with the
+// subscription.
+func (client AccountClient) List() (result AccountListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountClient) ListResponder(resp *http.Response) (result AccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client AccountClient) ListNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
+ req, err := lastResults.AccountListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListByResourceGroup gets information about the Batch accounts associated
+// within the specified resource group.
+//
+// resourceGroupName is the name of the resource group whose Batch accounts to
+// list.
+func (client AccountClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client AccountClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroupNextResults retrieves the next set of results, if any.
+func (client AccountClient) ListByResourceGroupNextResults(lastResults AccountListResult) (result AccountListResult, err error) {
+ req, err := lastResults.AccountListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListKeys lists the account keys for the specified Batch account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the account.
+func (client AccountClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeyResult, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client AccountClient) ListKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client AccountClient) ListKeysResponder(resp *http.Response) (result AccountListKeyResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RegenerateKey regenerates the specified account key for the specified Batch
+// account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the account. parameters is the type of
+// key to regenerate.
+func (client AccountClient) RegenerateKey(resourceGroupName string, accountName string, parameters AccountRegenerateKeyParameters) (result AccountRegenerateKeyResult, err error) {
+ req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "RegenerateKey", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegenerateKeySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "RegenerateKey", resp, "Failure sending request")
+ }
+
+ result, err = client.RegenerateKeyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "RegenerateKey", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegenerateKeyPreparer prepares the RegenerateKey request.
+func (client AccountClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, parameters AccountRegenerateKeyParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegenerateKeySender sends the RegenerateKey request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
+// closes the http.Response Body.
+func (client AccountClient) RegenerateKeyResponder(resp *http.Response) (result AccountRegenerateKeyResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// SynchronizeAutoStorageKeys synchronizes access keys for the auto storage
+// account configured for the specified Batch account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account.
+func (client AccountClient) SynchronizeAutoStorageKeys(resourceGroupName string, accountName string) (result autorest.Response, err error) {
+ req, err := client.SynchronizeAutoStorageKeysPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "SynchronizeAutoStorageKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.SynchronizeAutoStorageKeysSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "SynchronizeAutoStorageKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.SynchronizeAutoStorageKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "SynchronizeAutoStorageKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// SynchronizeAutoStorageKeysPreparer prepares the SynchronizeAutoStorageKeys request.
+func (client AccountClient) SynchronizeAutoStorageKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// SynchronizeAutoStorageKeysSender sends the SynchronizeAutoStorageKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) SynchronizeAutoStorageKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// SynchronizeAutoStorageKeysResponder handles the response to the SynchronizeAutoStorageKeys request. The method always
+// closes the http.Response Body.
+func (client AccountClient) SynchronizeAutoStorageKeysResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Update updates the properties of an existing Batch account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the account. parameters is additional
+// parameters for account update.
+func (client AccountClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result AccountResource, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.AccountClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.AccountClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client AccountClient) UpdatePreparer(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client AccountClient) UpdateResponder(resp *http.Response) (result AccountResource, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/applicationoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/applicationoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/applicationoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/applicationoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,667 @@
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ApplicationOperationsClient is the client for the ApplicationOperations
+// methods of the Batch service.
+type ApplicationOperationsClient struct {
+ ManagementClient
+}
+
+// NewApplicationOperationsClient creates an instance of the
+// ApplicationOperationsClient client.
+func NewApplicationOperationsClient(subscriptionID string) ApplicationOperationsClient {
+ return NewApplicationOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewApplicationOperationsClientWithBaseURI creates an instance of the
+// ApplicationOperationsClient client.
+func NewApplicationOperationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationOperationsClient {
+ return ApplicationOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ActivateApplicationPackage activates the specified application package.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. id is the id of the
+// application. version is the version of the application to activate.
+// parameters is the parameters for the request.
+func (client ApplicationOperationsClient) ActivateApplicationPackage(resourceGroupName string, accountName string, id string, version string, parameters ActivateApplicationPackageParameters) (result autorest.Response, err error) {
+ req, err := client.ActivateApplicationPackagePreparer(resourceGroupName, accountName, id, version, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "ActivateApplicationPackage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ActivateApplicationPackageSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "ActivateApplicationPackage", resp, "Failure sending request")
+ }
+
+ result, err = client.ActivateApplicationPackageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "ActivateApplicationPackage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ActivateApplicationPackagePreparer prepares the ActivateApplicationPackage request.
+func (client ApplicationOperationsClient) ActivateApplicationPackagePreparer(resourceGroupName string, accountName string, id string, version string, parameters ActivateApplicationPackageParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "id": autorest.Encode("path", id),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "version": autorest.Encode("path", version),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{id}/versions/{version}/activate", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ActivateApplicationPackageSender sends the ActivateApplicationPackage request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) ActivateApplicationPackageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ActivateApplicationPackageResponder handles the response to the ActivateApplicationPackage request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) ActivateApplicationPackageResponder(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
+}
+
+// AddApplication adds an application to the specified Batch account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application. parameters is the parameters for the request.
+func (client ApplicationOperationsClient) AddApplication(resourceGroupName string, accountName string, applicationID string, parameters *AddApplicationParameters) (result Application, err error) {
+ req, err := client.AddApplicationPreparer(resourceGroupName, accountName, applicationID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplication", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddApplicationSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplication", resp, "Failure sending request")
+ }
+
+ result, err = client.AddApplicationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplication", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddApplicationPreparer prepares the AddApplication request.
+func (client ApplicationOperationsClient) AddApplicationPreparer(resourceGroupName string, accountName string, applicationID string, parameters *AddApplicationParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if parameters != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(parameters))
+ }
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddApplicationSender sends the AddApplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) AddApplicationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddApplicationResponder handles the response to the AddApplication request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) AddApplicationResponder(resp *http.Response) (result Application, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// AddApplicationPackage creates an application package record.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application. version is the version of the application.
+func (client ApplicationOperationsClient) AddApplicationPackage(resourceGroupName string, accountName string, applicationID string, version string) (result AddApplicationPackageResult, err error) {
+ req, err := client.AddApplicationPackagePreparer(resourceGroupName, accountName, applicationID, version)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplicationPackage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddApplicationPackageSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplicationPackage", resp, "Failure sending request")
+ }
+
+ result, err = client.AddApplicationPackageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "AddApplicationPackage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddApplicationPackagePreparer prepares the AddApplicationPackage request.
+func (client ApplicationOperationsClient) AddApplicationPackagePreparer(resourceGroupName string, accountName string, applicationID string, version string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "version": autorest.Encode("path", version),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddApplicationPackageSender sends the AddApplicationPackage request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) AddApplicationPackageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddApplicationPackageResponder handles the response to the AddApplicationPackage request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) AddApplicationPackageResponder(resp *http.Response) (result AddApplicationPackageResult, 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
+}
+
+// DeleteApplication deletes an application.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application.
+func (client ApplicationOperationsClient) DeleteApplication(resourceGroupName string, accountName string, applicationID string) (result autorest.Response, err error) {
+ req, err := client.DeleteApplicationPreparer(resourceGroupName, accountName, applicationID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplication", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteApplicationSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplication", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteApplicationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplication", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteApplicationPreparer prepares the DeleteApplication request.
+func (client ApplicationOperationsClient) DeleteApplicationPreparer(resourceGroupName string, accountName string, applicationID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteApplicationSender sends the DeleteApplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) DeleteApplicationResponder(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
+}
+
+// DeleteApplicationPackage deletes an application package record and its
+// associated binary file.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application. version is the version of the application to
+// delete.
+func (client ApplicationOperationsClient) DeleteApplicationPackage(resourceGroupName string, accountName string, applicationID string, version string) (result autorest.Response, err error) {
+ req, err := client.DeleteApplicationPackagePreparer(resourceGroupName, accountName, applicationID, version)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplicationPackage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteApplicationPackageSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplicationPackage", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteApplicationPackageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "DeleteApplicationPackage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteApplicationPackagePreparer prepares the DeleteApplicationPackage request.
+func (client ApplicationOperationsClient) DeleteApplicationPackagePreparer(resourceGroupName string, accountName string, applicationID string, version string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "version": autorest.Encode("path", version),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteApplicationPackageSender sends the DeleteApplicationPackage request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) DeleteApplicationPackageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteApplicationPackageResponder handles the response to the DeleteApplicationPackage request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) DeleteApplicationPackageResponder(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
+}
+
+// GetApplication gets information about the specified application.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application.
+func (client ApplicationOperationsClient) GetApplication(resourceGroupName string, accountName string, applicationID string) (result Application, err error) {
+ req, err := client.GetApplicationPreparer(resourceGroupName, accountName, applicationID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplication", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetApplicationSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplication", resp, "Failure sending request")
+ }
+
+ result, err = client.GetApplicationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplication", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetApplicationPreparer prepares the GetApplication request.
+func (client ApplicationOperationsClient) GetApplicationPreparer(resourceGroupName string, accountName string, applicationID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetApplicationSender sends the GetApplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) GetApplicationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetApplicationResponder handles the response to the GetApplication request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) GetApplicationResponder(resp *http.Response) (result Application, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetApplicationPackage gets information about the specified application
+// package.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application. version is the version of the application.
+func (client ApplicationOperationsClient) GetApplicationPackage(resourceGroupName string, accountName string, applicationID string, version string) (result GetApplicationPackageResult, err error) {
+ req, err := client.GetApplicationPackagePreparer(resourceGroupName, accountName, applicationID, version)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplicationPackage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetApplicationPackageSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplicationPackage", resp, "Failure sending request")
+ }
+
+ result, err = client.GetApplicationPackageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "GetApplicationPackage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetApplicationPackagePreparer prepares the GetApplicationPackage request.
+func (client ApplicationOperationsClient) GetApplicationPackagePreparer(resourceGroupName string, accountName string, applicationID string, version string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "version": autorest.Encode("path", version),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetApplicationPackageSender sends the GetApplicationPackage request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) GetApplicationPackageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetApplicationPackageResponder handles the response to the GetApplicationPackage request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) GetApplicationPackageResponder(resp *http.Response) (result GetApplicationPackageResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List lists all of the applications in the specified account.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. maxresults is the
+// maximum number of items to return in the response.
+func (client ApplicationOperationsClient) List(resourceGroupName string, accountName string, maxresults *int32) (result ListApplicationsResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, accountName, maxresults)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ApplicationOperationsClient) ListPreparer(resourceGroupName string, accountName string, maxresults *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if maxresults != nil {
+ queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) ListResponder(resp *http.Response) (result ListApplicationsResult, 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 ApplicationOperationsClient) ListNextResults(lastResults ListApplicationsResult) (result ListApplicationsResult, err error) {
+ req, err := lastResults.ListApplicationsResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// UpdateApplication updates settings for the specified application.
+//
+// resourceGroupName is the name of the resource group that contains the Batch
+// account. accountName is the name of the Batch account. applicationID is
+// the id of the application. parameters is the parameters for the request.
+func (client ApplicationOperationsClient) UpdateApplication(resourceGroupName string, accountName string, applicationID string, parameters UpdateApplicationParameters) (result autorest.Response, err error) {
+ req, err := client.UpdateApplicationPreparer(resourceGroupName, accountName, applicationID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "UpdateApplication", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateApplicationSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "UpdateApplication", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateApplicationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.ApplicationOperationsClient", "UpdateApplication", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdateApplicationPreparer prepares the UpdateApplication request.
+func (client ApplicationOperationsClient) UpdateApplicationPreparer(resourceGroupName string, accountName string, applicationID string, parameters UpdateApplicationParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "applicationId": autorest.Encode("path", applicationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateApplicationSender sends the UpdateApplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client ApplicationOperationsClient) UpdateApplicationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateApplicationResponder handles the response to the UpdateApplication request. The method always
+// closes the http.Response Body.
+func (client ApplicationOperationsClient) UpdateApplicationResponder(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
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,56 @@
+// Package batch implements the Azure ARM Batch service API version 2015-12-01.
+//
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Batch
+ APIVersion = "2015-12-01"
+
+ // DefaultBaseURI is the default URI used for the service Batch
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Batch.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,256 @@
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// AccountKeyType enumerates the values for account key type.
+type AccountKeyType string
+
+const (
+ // Primary specifies the primary state for account key type.
+ Primary AccountKeyType = "Primary"
+ // Secondary specifies the secondary state for account key type.
+ Secondary AccountKeyType = "Secondary"
+)
+
+// AccountProvisioningState enumerates the values for account provisioning
+// state.
+type AccountProvisioningState string
+
+const (
+ // Cancelled specifies the cancelled state for account provisioning state.
+ Cancelled AccountProvisioningState = "Cancelled"
+ // Creating specifies the creating state for account provisioning state.
+ Creating AccountProvisioningState = "Creating"
+ // Deleting specifies the deleting state for account provisioning state.
+ Deleting AccountProvisioningState = "Deleting"
+ // Failed specifies the failed state for account provisioning state.
+ Failed AccountProvisioningState = "Failed"
+ // Invalid specifies the invalid state for account provisioning state.
+ Invalid AccountProvisioningState = "Invalid"
+ // Succeeded specifies the succeeded state for account provisioning state.
+ Succeeded AccountProvisioningState = "Succeeded"
+)
+
+// PackageState enumerates the values for package state.
+type PackageState string
+
+const (
+ // Active specifies the active state for package state.
+ Active PackageState = "active"
+ // Pending specifies the pending state for package state.
+ Pending PackageState = "pending"
+ // Unmapped specifies the unmapped state for package state.
+ Unmapped PackageState = "unmapped"
+)
+
+// AccountBaseProperties is the properties of a Batch account.
+type AccountBaseProperties struct {
+ AutoStorage *AutoStorageBaseProperties `json:"autoStorage,omitempty"`
+}
+
+// AccountCreateParameters is parameters supplied to the Create operation.
+type AccountCreateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *AccountBaseProperties `json:"properties,omitempty"`
+}
+
+// AccountListKeyResult is values returned by the GetKeys operation.
+type AccountListKeyResult struct {
+ autorest.Response `json:"-"`
+ Primary *string `json:"primary,omitempty"`
+ Secondary *string `json:"secondary,omitempty"`
+}
+
+// AccountListResult is values returned by the List operation.
+type AccountListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]AccountResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AccountListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client AccountListResult) AccountListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// AccountProperties is account specific properties.
+type AccountProperties struct {
+ AccountEndpoint *string `json:"accountEndpoint,omitempty"`
+ ProvisioningState AccountProvisioningState `json:"provisioningState,omitempty"`
+ AutoStorage *AutoStorageProperties `json:"autoStorage,omitempty"`
+ CoreQuota *int32 `json:"coreQuota,omitempty"`
+ PoolQuota *int32 `json:"poolQuota,omitempty"`
+ ActiveJobAndJobScheduleQuota *int32 `json:"activeJobAndJobScheduleQuota,omitempty"`
+}
+
+// AccountRegenerateKeyParameters is parameters supplied to the RegenerateKey
+// operation.
+type AccountRegenerateKeyParameters struct {
+ KeyName AccountKeyType `json:"keyName,omitempty"`
+}
+
+// AccountRegenerateKeyResult is values returned by the RegenerateKey
+// operation.
+type AccountRegenerateKeyResult struct {
+ autorest.Response `json:"-"`
+ Primary *string `json:"primary,omitempty"`
+ Secondary *string `json:"secondary,omitempty"`
+}
+
+// AccountResource is contains information about an Azure Batch account.
+type AccountResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *AccountProperties `json:"properties,omitempty"`
+}
+
+// AccountUpdateParameters is parameters supplied to the Update operation.
+type AccountUpdateParameters struct {
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *AccountBaseProperties `json:"properties,omitempty"`
+}
+
+// ActivateApplicationPackageParameters is parameters for an
+// ApplicationOperations.ActivateApplicationPackage request.
+type ActivateApplicationPackageParameters struct {
+ Format *string `json:"format,omitempty"`
+}
+
+// AddApplicationPackageResult is response to an
+// ApplicationOperations.AddApplicationPackage request.
+type AddApplicationPackageResult struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Version *string `json:"version,omitempty"`
+ StorageURL *string `json:"storageUrl,omitempty"`
+ StorageURLExpiry *date.Time `json:"storageUrlExpiry,omitempty"`
+}
+
+// AddApplicationParameters is parameters for an
+// ApplicationOperations.AddApplication request.
+type AddApplicationParameters struct {
+ AllowUpdates *bool `json:"allowUpdates,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
+// Application is contains information about an application in a Batch account.
+type Application struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Packages *[]ApplicationPackage `json:"packages,omitempty"`
+ AllowUpdates *bool `json:"allowUpdates,omitempty"`
+ DefaultVersion *string `json:"defaultVersion,omitempty"`
+}
+
+// ApplicationPackage is contains information about an application package.
+type ApplicationPackage struct {
+ Version *string `json:"version,omitempty"`
+ State PackageState `json:"state,omitempty"`
+ Format *string `json:"format,omitempty"`
+ LastActivationTime *date.Time `json:"lastActivationTime,omitempty"`
+}
+
+// AutoStorageBaseProperties is the properties related to auto storage account.
+type AutoStorageBaseProperties struct {
+ StorageAccountID *string `json:"storageAccountId,omitempty"`
+}
+
+// AutoStorageProperties is contains information about the auto storage
+// account associated with a Batch account.
+type AutoStorageProperties struct {
+ StorageAccountID *string `json:"storageAccountId,omitempty"`
+ LastKeySync *date.Time `json:"lastKeySync,omitempty"`
+}
+
+// GetApplicationPackageResult is response to an
+// ApplicationOperations.GetApplicationPackage request.
+type GetApplicationPackageResult struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Version *string `json:"version,omitempty"`
+ State PackageState `json:"state,omitempty"`
+ Format *string `json:"format,omitempty"`
+ StorageURL *string `json:"storageUrl,omitempty"`
+ StorageURLExpiry *date.Time `json:"storageUrlExpiry,omitempty"`
+ LastActivationTime *date.Time `json:"lastActivationTime,omitempty"`
+}
+
+// ListApplicationsResult is response to an
+// ApplicationOperations.ListApplications request.
+type ListApplicationsResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Application `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ListApplicationsResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ListApplicationsResult) ListApplicationsResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// SubscriptionQuotasGetResult is values returned by the Get Subscription
+// Quotas operation.
+type SubscriptionQuotasGetResult struct {
+ autorest.Response `json:"-"`
+ AccountQuota *int32 `json:"accountQuota,omitempty"`
+}
+
+// UpdateApplicationParameters is parameters for an
+// ApplicationOperations.UpdateApplication request.
+type UpdateApplicationParameters struct {
+ AllowUpdates *bool `json:"allowUpdates,omitempty"`
+ DefaultVersion *string `json:"defaultVersion,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/subscription.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/subscription.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/subscription.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/subscription.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,104 @@
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// SubscriptionClient is the client for the Subscription methods of the Batch
+// service.
+type SubscriptionClient struct {
+ ManagementClient
+}
+
+// NewSubscriptionClient creates an instance of the SubscriptionClient client.
+func NewSubscriptionClient(subscriptionID string) SubscriptionClient {
+ return NewSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSubscriptionClientWithBaseURI creates an instance of the
+// SubscriptionClient client.
+func NewSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionClient {
+ return SubscriptionClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// GetSubscriptionQuotas gets the Batch service quotas for the specified
+// suscription.
+//
+// locationName is the desired region for the quotas.
+func (client SubscriptionClient) GetSubscriptionQuotas(locationName string) (result SubscriptionQuotasGetResult, err error) {
+ req, err := client.GetSubscriptionQuotasPreparer(locationName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "batch.SubscriptionClient", "GetSubscriptionQuotas", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSubscriptionQuotasSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "batch.SubscriptionClient", "GetSubscriptionQuotas", resp, "Failure sending request")
+ }
+
+ result, err = client.GetSubscriptionQuotasResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "batch.SubscriptionClient", "GetSubscriptionQuotas", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetSubscriptionQuotasPreparer prepares the GetSubscriptionQuotas request.
+func (client SubscriptionClient) GetSubscriptionQuotasPreparer(locationName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "locationName": autorest.Encode("path", locationName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSubscriptionQuotasSender sends the GetSubscriptionQuotas request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubscriptionClient) GetSubscriptionQuotasSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetSubscriptionQuotasResponder handles the response to the GetSubscriptionQuotas request. The method always
+// closes the http.Response Body.
+func (client SubscriptionClient) GetSubscriptionQuotasResponder(resp *http.Response) (result SubscriptionQuotasGetResult, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/batch/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/batch/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package batch
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "batch", "2015-12-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,60 @@
+// Package cdn implements the Azure ARM Cdn service API version 2016-04-02.
+//
+// Use these APIs to manage Azure CDN resources through the Azure Resource
+// Manager. You must make sure that requests made to these resources are
+// secure. For more information, see Authenticating Azure Resource Manager
+// requests (https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx).
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Cdn
+ APIVersion = "2016-04-02"
+
+ // DefaultBaseURI is the default URI used for the service Cdn
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Cdn.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/customdomains.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/customdomains.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/customdomains.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/customdomains.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,392 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// CustomDomainsClient is the use these APIs to manage Azure CDN resources
+// through the Azure Resource Manager. You must make sure that requests made
+// to these resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type CustomDomainsClient struct {
+ ManagementClient
+}
+
+// NewCustomDomainsClient creates an instance of the CustomDomainsClient
+// client.
+func NewCustomDomainsClient(subscriptionID string) CustomDomainsClient {
+ return NewCustomDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCustomDomainsClientWithBaseURI creates an instance of the
+// CustomDomainsClient client.
+func NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string) CustomDomainsClient {
+ return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create sends the create request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// customDomainName is name of the custom domain within an endpoint.
+// customDomainProperties is custom domain properties required for creation.
+// endpointName is name of the endpoint within the CDN profile. profileName
+// is name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client CustomDomainsClient) Create(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(customDomainName, customDomainProperties, endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client CustomDomainsClient) CreatePreparer(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "customDomainName": autorest.Encode("path", customDomainName),
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
+ autorest.WithJSON(customDomainProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomDomainsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteIfExists sends the delete if exists request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// customDomainName is name of the custom domain within an endpoint.
+// endpointName is name of the endpoint within the CDN profile. profileName
+// is name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client CustomDomainsClient) DeleteIfExists(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteIfExistsPreparer(customDomainName, endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteIfExistsSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteIfExistsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteIfExistsPreparer prepares the DeleteIfExists request.
+func (client CustomDomainsClient) DeleteIfExistsPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "customDomainName": autorest.Encode("path", customDomainName),
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomDomainsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always
+// closes the http.Response Body.
+func (client CustomDomainsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get sends the get request.
+//
+// customDomainName is name of the custom domain within an endpoint.
+// endpointName is name of the endpoint within the CDN profile. profileName
+// is name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client CustomDomainsClient) Get(customDomainName string, endpointName string, profileName string, resourceGroupName string) (result CustomDomain, err error) {
+ req, err := client.GetPreparer(customDomainName, endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client CustomDomainsClient) GetPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "customDomainName": autorest.Encode("path", customDomainName),
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomDomainsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client CustomDomainsClient) GetResponder(resp *http.Response) (result CustomDomain, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByEndpoint sends the list by endpoint request.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client CustomDomainsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result CustomDomainListResult, err error) {
+ req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByEndpointSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByEndpointResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByEndpointPreparer prepares the ListByEndpoint request.
+func (client CustomDomainsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByEndpointSender sends the ListByEndpoint request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomDomainsClient) ListByEndpointSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByEndpointResponder handles the response to the ListByEndpoint request. The method always
+// closes the http.Response Body.
+func (client CustomDomainsClient) ListByEndpointResponder(resp *http.Response) (result CustomDomainListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update sends the update request.
+//
+// customDomainName is name of the custom domain within an endpoint.
+// customDomainProperties is custom domain properties to update. endpointName
+// is name of the endpoint within the CDN profile. profileName is name of the
+// CDN profile within the resource group. resourceGroupName is name of the
+// resource group within the Azure subscription.
+func (client CustomDomainsClient) Update(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string) (result ErrorResponse, err error) {
+ req, err := client.UpdatePreparer(customDomainName, customDomainProperties, endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client CustomDomainsClient) UpdatePreparer(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "customDomainName": autorest.Encode("path", customDomainName),
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
+ autorest.WithJSON(customDomainProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomDomainsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client CustomDomainsClient) UpdateResponder(resp *http.Response) (result ErrorResponse, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/endpoints.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/endpoints.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/endpoints.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/endpoints.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,735 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// EndpointsClient is the use these APIs to manage Azure CDN resources through
+// the Azure Resource Manager. You must make sure that requests made to these
+// resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type EndpointsClient struct {
+ ManagementClient
+}
+
+// NewEndpointsClient creates an instance of the EndpointsClient client.
+func NewEndpointsClient(subscriptionID string) EndpointsClient {
+ return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient
+// client.
+func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
+ return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create sends the create request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile.
+// endpointProperties is endpoint properties profileName is name of the CDN
+// profile within the resource group. resourceGroupName is name of the
+// resource group within the Azure subscription.
+func (client EndpointsClient) Create(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client EndpointsClient) CreatePreparer(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
+ autorest.WithJSON(endpointProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteIfExists sends the delete if exists request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client EndpointsClient) DeleteIfExists(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteIfExistsPreparer(endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteIfExistsSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteIfExistsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteIfExistsPreparer prepares the DeleteIfExists request.
+func (client EndpointsClient) DeleteIfExistsPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get sends the get request.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client EndpointsClient) Get(endpointName string, profileName string, resourceGroupName string) (result Endpoint, err error) {
+ req, err := client.GetPreparer(endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client EndpointsClient) GetPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByProfile sends the list by profile request.
+//
+// profileName is name of the CDN profile within the resource group.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client EndpointsClient) ListByProfile(profileName string, resourceGroupName string) (result EndpointListResult, err error) {
+ req, err := client.ListByProfilePreparer(profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByProfileSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByProfileResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByProfilePreparer prepares the ListByProfile request.
+func (client EndpointsClient) ListByProfilePreparer(profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByProfileSender sends the ListByProfile request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) ListByProfileSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByProfileResponder handles the response to the ListByProfile request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) ListByProfileResponder(resp *http.Response) (result EndpointListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// LoadContent sends the load content request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile.
+// contentFilePaths is the path to the content to be loaded. Path should
+// describe a file. profileName is name of the CDN profile within the
+// resource group. resourceGroupName is name of the resource group within the
+// Azure subscription.
+func (client EndpointsClient) LoadContent(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.LoadContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", nil, "Failure preparing request")
+ }
+
+ resp, err := client.LoadContentSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", resp, "Failure sending request")
+ }
+
+ result, err = client.LoadContentResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// LoadContentPreparer prepares the LoadContent request.
+func (client EndpointsClient) LoadContentPreparer(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load", pathParameters),
+ autorest.WithJSON(contentFilePaths),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// LoadContentSender sends the LoadContent request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) LoadContentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// LoadContentResponder handles the response to the LoadContent request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) LoadContentResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// PurgeContent sends the purge content request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile.
+// contentFilePaths is the path to the content to be purged. Path can
+// describe a file or directory. profileName is name of the CDN profile
+// within the resource group. resourceGroupName is name of the resource group
+// within the Azure subscription.
+func (client EndpointsClient) PurgeContent(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.PurgeContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PurgeContentSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", resp, "Failure sending request")
+ }
+
+ result, err = client.PurgeContentResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PurgeContentPreparer prepares the PurgeContent request.
+func (client EndpointsClient) PurgeContentPreparer(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge", pathParameters),
+ autorest.WithJSON(contentFilePaths),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// PurgeContentSender sends the PurgeContent request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) PurgeContentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// PurgeContentResponder handles the response to the PurgeContent request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Start sends the start request. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client EndpointsClient) Start(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", nil, "Failure preparing request")
+ }
+
+ resp, err := client.StartSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", resp, "Failure sending request")
+ }
+
+ result, err = client.StartResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// StartPreparer prepares the Start request.
+func (client EndpointsClient) StartPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// StartSender sends the Start request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) StartSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// StartResponder handles the response to the Start request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) 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 sends the stop request. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client EndpointsClient) Stop(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StopPreparer(endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", nil, "Failure preparing request")
+ }
+
+ resp, err := client.StopSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", resp, "Failure sending request")
+ }
+
+ result, err = client.StopResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// StopPreparer prepares the Stop request.
+func (client EndpointsClient) StopPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// StopSender sends the Stop request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) StopSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// StopResponder handles the response to the Stop request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) 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 sends the update request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// endpointName is name of the endpoint within the CDN profile.
+// endpointProperties is endpoint properties profileName is name of the CDN
+// profile within the resource group. resourceGroupName is name of the
+// resource group within the Azure subscription.
+func (client EndpointsClient) Update(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.UpdatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client EndpointsClient) UpdatePreparer(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
+ autorest.WithJSON(endpointProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ValidateCustomDomain sends the validate custom domain request.
+//
+// endpointName is name of the endpoint within the CDN profile.
+// customDomainProperties is custom domain to validate. profileName is name
+// of the CDN profile within the resource group. resourceGroupName is name of
+// the resource group within the Azure subscription.
+func (client EndpointsClient) ValidateCustomDomain(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (result ValidateCustomDomainOutput, err error) {
+ req, err := client.ValidateCustomDomainPreparer(endpointName, customDomainProperties, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ValidateCustomDomainSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", resp, "Failure sending request")
+ }
+
+ result, err = client.ValidateCustomDomainResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request.
+func (client EndpointsClient) ValidateCustomDomainPreparer(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain", pathParameters),
+ autorest.WithJSON(customDomainProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ValidateCustomDomainSender sends the ValidateCustomDomain request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) ValidateCustomDomainSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ValidateCustomDomainResponder handles the response to the ValidateCustomDomain request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) ValidateCustomDomainResponder(resp *http.Response) (result ValidateCustomDomainOutput, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,439 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// CustomDomainResourceState enumerates the values for custom domain resource
+// state.
+type CustomDomainResourceState string
+
+const (
+ // Active specifies the active state for custom domain resource state.
+ Active CustomDomainResourceState = "Active"
+ // Creating specifies the creating state for custom domain resource state.
+ Creating CustomDomainResourceState = "Creating"
+ // Deleting specifies the deleting state for custom domain resource state.
+ Deleting CustomDomainResourceState = "Deleting"
+)
+
+// EndpointResourceState enumerates the values for endpoint resource state.
+type EndpointResourceState string
+
+const (
+ // EndpointResourceStateCreating specifies the endpoint resource state
+ // creating state for endpoint resource state.
+ EndpointResourceStateCreating EndpointResourceState = "Creating"
+ // EndpointResourceStateDeleting specifies the endpoint resource state
+ // deleting state for endpoint resource state.
+ EndpointResourceStateDeleting EndpointResourceState = "Deleting"
+ // EndpointResourceStateRunning specifies the endpoint resource state
+ // running state for endpoint resource state.
+ EndpointResourceStateRunning EndpointResourceState = "Running"
+ // EndpointResourceStateStarting specifies the endpoint resource state
+ // starting state for endpoint resource state.
+ EndpointResourceStateStarting EndpointResourceState = "Starting"
+ // EndpointResourceStateStopped specifies the endpoint resource state
+ // stopped state for endpoint resource state.
+ EndpointResourceStateStopped EndpointResourceState = "Stopped"
+ // EndpointResourceStateStopping specifies the endpoint resource state
+ // stopping state for endpoint resource state.
+ EndpointResourceStateStopping EndpointResourceState = "Stopping"
+)
+
+// OriginResourceState enumerates the values for origin resource state.
+type OriginResourceState string
+
+const (
+ // OriginResourceStateActive specifies the origin resource state active
+ // state for origin resource state.
+ OriginResourceStateActive OriginResourceState = "Active"
+ // OriginResourceStateCreating specifies the origin resource state
+ // creating state for origin resource state.
+ OriginResourceStateCreating OriginResourceState = "Creating"
+ // OriginResourceStateDeleting specifies the origin resource state
+ // deleting state for origin resource state.
+ OriginResourceStateDeleting OriginResourceState = "Deleting"
+)
+
+// ProfileResourceState enumerates the values for profile resource state.
+type ProfileResourceState string
+
+const (
+ // ProfileResourceStateActive specifies the profile resource state active
+ // state for profile resource state.
+ ProfileResourceStateActive ProfileResourceState = "Active"
+ // ProfileResourceStateCreating specifies the profile resource state
+ // creating state for profile resource state.
+ ProfileResourceStateCreating ProfileResourceState = "Creating"
+ // ProfileResourceStateDeleting specifies the profile resource state
+ // deleting state for profile resource state.
+ ProfileResourceStateDeleting ProfileResourceState = "Deleting"
+ // ProfileResourceStateDisabled specifies the profile resource state
+ // disabled state for profile resource state.
+ ProfileResourceStateDisabled ProfileResourceState = "Disabled"
+)
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // ProvisioningStateCreating specifies the provisioning state creating
+ // state for provisioning state.
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ // ProvisioningStateFailed specifies the provisioning state failed state
+ // for provisioning state.
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateSucceeded specifies the provisioning state succeeded
+ // state for provisioning state.
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+)
+
+// QueryStringCachingBehavior enumerates the values for query string caching
+// behavior.
+type QueryStringCachingBehavior string
+
+const (
+ // BypassCaching specifies the bypass caching state for query string
+ // caching behavior.
+ BypassCaching QueryStringCachingBehavior = "BypassCaching"
+ // IgnoreQueryString specifies the ignore query string state for query
+ // string caching behavior.
+ IgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString"
+ // NotSet specifies the not set state for query string caching behavior.
+ NotSet QueryStringCachingBehavior = "NotSet"
+ // UseQueryString specifies the use query string state for query string
+ // caching behavior.
+ UseQueryString QueryStringCachingBehavior = "UseQueryString"
+)
+
+// ResourceType enumerates the values for resource type.
+type ResourceType string
+
+const (
+ // MicrosoftCdnProfilesEndpoints specifies the microsoft cdn profiles
+ // endpoints state for resource type.
+ MicrosoftCdnProfilesEndpoints ResourceType = "Microsoft.Cdn/Profiles/Endpoints"
+)
+
+// SkuName enumerates the values for sku name.
+type SkuName string
+
+const (
+ // CustomVerizon specifies the custom verizon state for sku name.
+ CustomVerizon SkuName = "Custom_Verizon"
+ // PremiumVerizon specifies the premium verizon state for sku name.
+ PremiumVerizon SkuName = "Premium_Verizon"
+ // StandardAkamai specifies the standard akamai state for sku name.
+ StandardAkamai SkuName = "Standard_Akamai"
+ // StandardVerizon specifies the standard verizon state for sku name.
+ StandardVerizon SkuName = "Standard_Verizon"
+)
+
+// CheckNameAvailabilityInput is input of CheckNameAvailability API.
+type CheckNameAvailabilityInput struct {
+ Name *string `json:"name,omitempty"`
+ Type ResourceType `json:"type,omitempty"`
+}
+
+// CheckNameAvailabilityOutput is output of check name availability API.
+type CheckNameAvailabilityOutput struct {
+ autorest.Response `json:"-"`
+ NameAvailable *bool `json:"NameAvailable,omitempty"`
+ Reason *string `json:"Reason,omitempty"`
+ Message *string `json:"Message,omitempty"`
+}
+
+// CustomDomain is cDN CustomDomain represents a mapping between a user
+// specified domain name and a CDN endpoint. This is to use custom domain
+// names to represent the URLs for branding purposes.
+type CustomDomain struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *CustomDomainProperties `json:"properties,omitempty"`
+}
+
+// CustomDomainListResult is
+type CustomDomainListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]CustomDomain `json:"value,omitempty"`
+}
+
+// CustomDomainParameters is customDomain properties required for custom
+// domain creation or update.
+type CustomDomainParameters struct {
+ Properties *CustomDomainPropertiesParameters `json:"properties,omitempty"`
+}
+
+// CustomDomainProperties is
+type CustomDomainProperties struct {
+ HostName *string `json:"hostName,omitempty"`
+ ResourceState CustomDomainResourceState `json:"resourceState,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+}
+
+// CustomDomainPropertiesParameters is
+type CustomDomainPropertiesParameters struct {
+ HostName *string `json:"hostName,omitempty"`
+}
+
+// DeepCreatedOrigin is deep created origins within a CDN endpoint.
+type DeepCreatedOrigin struct {
+ Name *string `json:"name,omitempty"`
+ Properties *DeepCreatedOriginProperties `json:"properties,omitempty"`
+}
+
+// DeepCreatedOriginProperties is properties of deep created origin on a CDN
+// endpoint.
+type DeepCreatedOriginProperties struct {
+ HostName *string `json:"hostName,omitempty"`
+ HTTPPort *int32 `json:"httpPort,omitempty"`
+ HTTPSPort *int32 `json:"httpsPort,omitempty"`
+}
+
+// Endpoint is cDN endpoint is the entity within a CDN profile containing
+// configuration information regarding caching behaviors and origins. The CDN
+// endpoint is exposed using the URL format .azureedge.net by
+// default, but custom domains can also be created.
+type Endpoint struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *EndpointProperties `json:"properties,omitempty"`
+}
+
+// EndpointCreateParameters is endpoint properties required for new endpoint
+// creation.
+type EndpointCreateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *EndpointPropertiesCreateParameters `json:"properties,omitempty"`
+}
+
+// EndpointListResult is
+type EndpointListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Endpoint `json:"value,omitempty"`
+}
+
+// EndpointProperties is
+type EndpointProperties struct {
+ HostName *string `json:"hostName,omitempty"`
+ OriginHostHeader *string `json:"originHostHeader,omitempty"`
+ OriginPath *string `json:"originPath,omitempty"`
+ ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
+ IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"`
+ IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
+ IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
+ QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
+ Origins *[]DeepCreatedOrigin `json:"origins,omitempty"`
+ ResourceState EndpointResourceState `json:"resourceState,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+}
+
+// EndpointPropertiesCreateParameters is
+type EndpointPropertiesCreateParameters struct {
+ OriginHostHeader *string `json:"originHostHeader,omitempty"`
+ OriginPath *string `json:"originPath,omitempty"`
+ ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
+ IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"`
+ IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
+ IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
+ QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
+ Origins *[]DeepCreatedOrigin `json:"origins,omitempty"`
+}
+
+// EndpointPropertiesUpdateParameters is
+type EndpointPropertiesUpdateParameters struct {
+ OriginHostHeader *string `json:"originHostHeader,omitempty"`
+ OriginPath *string `json:"originPath,omitempty"`
+ ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
+ IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"`
+ IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
+ IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
+ QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
+}
+
+// EndpointUpdateParameters is endpoint properties required for new endpoint
+// creation.
+type EndpointUpdateParameters struct {
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *EndpointPropertiesUpdateParameters `json:"properties,omitempty"`
+}
+
+// ErrorResponse is
+type ErrorResponse struct {
+ autorest.Response `json:"-"`
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// LoadParameters is parameters required for endpoint load.
+type LoadParameters struct {
+ ContentPaths *[]string `json:"contentPaths,omitempty"`
+}
+
+// Operation is cDN REST API operation
+type Operation struct {
+ Name *string `json:"name,omitempty"`
+ Display *OperationDisplay `json:"display,omitempty"`
+}
+
+// OperationDisplay is
+type OperationDisplay struct {
+ Provider *string `json:"provider,omitempty"`
+ Resource *string `json:"resource,omitempty"`
+ Operation *string `json:"operation,omitempty"`
+}
+
+// OperationListResult is
+type OperationListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Operation `json:"value,omitempty"`
+}
+
+// Origin is cDN origin is the source of the content being delivered via CDN.
+// When the edge nodes represented by an endpoint do not have the requested
+// content cached, they attempt to fetch it from one or more of the
+// configured origins.
+type Origin struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *OriginProperties `json:"properties,omitempty"`
+}
+
+// OriginListResult is
+type OriginListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Origin `json:"value,omitempty"`
+}
+
+// OriginParameters is origin properties needed for origin creation or update.
+type OriginParameters struct {
+ Properties *OriginPropertiesParameters `json:"properties,omitempty"`
+}
+
+// OriginProperties is
+type OriginProperties struct {
+ HostName *string `json:"hostName,omitempty"`
+ HTTPPort *int32 `json:"httpPort,omitempty"`
+ HTTPSPort *int32 `json:"httpsPort,omitempty"`
+ ResourceState OriginResourceState `json:"resourceState,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+}
+
+// OriginPropertiesParameters is
+type OriginPropertiesParameters struct {
+ HostName *string `json:"hostName,omitempty"`
+ HTTPPort *int32 `json:"httpPort,omitempty"`
+ HTTPSPort *int32 `json:"httpsPort,omitempty"`
+}
+
+// Profile is cDN profile represents the top level resource and the entry
+// point into the CDN API. This allows users to set up a logical grouping of
+// endpoints in addition to creating shared configuration settings and
+// selecting pricing tiers and providers.
+type Profile struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ Properties *ProfileProperties `json:"properties,omitempty"`
+}
+
+// ProfileCreateParameters is profile properties required for profile creation.
+type ProfileCreateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+}
+
+// ProfileListResult is
+type ProfileListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Profile `json:"value,omitempty"`
+}
+
+// ProfileProperties is
+type ProfileProperties struct {
+ ResourceState ProfileResourceState `json:"resourceState,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+}
+
+// ProfileUpdateParameters is profile properties required for profile update.
+type ProfileUpdateParameters struct {
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// PurgeParameters is parameters required for endpoint purge.
+type PurgeParameters struct {
+ ContentPaths *[]string `json:"contentPaths,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// Sku is the SKU (pricing tier) of the CDN profile.
+type Sku struct {
+ Name SkuName `json:"name,omitempty"`
+}
+
+// SsoURI is sSO URI required to login to third party web portal.
+type SsoURI struct {
+ autorest.Response `json:"-"`
+ SsoURIValue *string `json:"ssoUriValue,omitempty"`
+}
+
+// TrackedResource is aRM tracked resource
+type TrackedResource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ValidateCustomDomainInput is input of the custom domain to be validated.
+type ValidateCustomDomainInput struct {
+ HostName *string `json:"hostName,omitempty"`
+}
+
+// ValidateCustomDomainOutput is output of custom domain validation.
+type ValidateCustomDomainOutput struct {
+ autorest.Response `json:"-"`
+ CustomDomainValidated *bool `json:"customDomainValidated,omitempty"`
+ Reason *string `json:"reason,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/nameavailability.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/nameavailability.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/nameavailability.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/nameavailability.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,104 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// NameAvailabilityClient is the use these APIs to manage Azure CDN resources
+// through the Azure Resource Manager. You must make sure that requests made
+// to these resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type NameAvailabilityClient struct {
+ ManagementClient
+}
+
+// NewNameAvailabilityClient creates an instance of the NameAvailabilityClient
+// client.
+func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient {
+ return NewNameAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewNameAvailabilityClientWithBaseURI creates an instance of the
+// NameAvailabilityClient client.
+func NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient {
+ return NameAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckNameAvailability sends the check name availability request.
+//
+// checkNameAvailabilityInput is input to check.
+func (client NameAvailabilityClient) CheckNameAvailability(checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) {
+ req, err := client.CheckNameAvailabilityPreparer(checkNameAvailabilityInput)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client NameAvailabilityClient) CheckNameAvailabilityPreparer(checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.Cdn/checkNameAvailability"),
+ autorest.WithJSON(checkNameAvailabilityInput),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client NameAvailabilityClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client NameAvailabilityClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/operations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/operations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/operations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/operations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,99 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// OperationsClient is the use these APIs to manage Azure CDN resources
+// through the Azure Resource Manager. You must make sure that requests made
+// to these resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type OperationsClient struct {
+ ManagementClient
+}
+
+// NewOperationsClient creates an instance of the OperationsClient client.
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewOperationsClientWithBaseURI creates an instance of the OperationsClient
+// client.
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List sends the list request.
+func (client OperationsClient) List() (result OperationListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client OperationsClient) ListPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.Cdn/operations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/origins.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/origins.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/origins.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/origins.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,394 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// OriginsClient is the use these APIs to manage Azure CDN resources through
+// the Azure Resource Manager. You must make sure that requests made to these
+// resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type OriginsClient struct {
+ ManagementClient
+}
+
+// NewOriginsClient creates an instance of the OriginsClient client.
+func NewOriginsClient(subscriptionID string) OriginsClient {
+ return NewOriginsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewOriginsClientWithBaseURI creates an instance of the OriginsClient client.
+func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsClient {
+ return OriginsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create sends the create request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// originName is name of the origin, an arbitrary value but it needs to be
+// unique under endpoint originProperties is origin properties endpointName
+// is name of the endpoint within the CDN profile. profileName is name of the
+// CDN profile within the resource group. resourceGroupName is name of the
+// resource group within the Azure subscription.
+func (client OriginsClient) Create(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client OriginsClient) CreatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "originName": autorest.Encode("path", originName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
+ autorest.WithJSON(originProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client OriginsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client OriginsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteIfExists sends the delete if exists request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// originName is name of the origin. Must be unique within endpoint.
+// endpointName is name of the endpoint within the CDN profile. profileName
+// is name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client OriginsClient) DeleteIfExists(originName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteIfExistsPreparer(originName, endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteIfExistsSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteIfExistsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteIfExistsPreparer prepares the DeleteIfExists request.
+func (client OriginsClient) DeleteIfExistsPreparer(originName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "originName": autorest.Encode("path", originName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
+// http.Response Body if it receives an error.
+func (client OriginsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always
+// closes the http.Response Body.
+func (client OriginsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get sends the get request.
+//
+// originName is name of the origin, an arbitrary value but it needs to be
+// unique under endpoint endpointName is name of the endpoint within the CDN
+// profile. profileName is name of the CDN profile within the resource group.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client OriginsClient) Get(originName string, endpointName string, profileName string, resourceGroupName string) (result Origin, err error) {
+ req, err := client.GetPreparer(originName, endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client OriginsClient) GetPreparer(originName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "originName": autorest.Encode("path", originName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client OriginsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client OriginsClient) GetResponder(resp *http.Response) (result Origin, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByEndpoint sends the list by endpoint request.
+//
+// endpointName is name of the endpoint within the CDN profile. profileName is
+// name of the CDN profile within the resource group. resourceGroupName is
+// name of the resource group within the Azure subscription.
+func (client OriginsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result OriginListResult, err error) {
+ req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByEndpointSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByEndpointResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByEndpointPreparer prepares the ListByEndpoint request.
+func (client OriginsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByEndpointSender sends the ListByEndpoint request. The method will close the
+// http.Response Body if it receives an error.
+func (client OriginsClient) ListByEndpointSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByEndpointResponder handles the response to the ListByEndpoint request. The method always
+// closes the http.Response Body.
+func (client OriginsClient) ListByEndpointResponder(resp *http.Response) (result OriginListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update sends the update request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// originName is name of the origin. Must be unique within endpoint.
+// originProperties is origin properties endpointName is name of the endpoint
+// within the CDN profile. profileName is name of the CDN profile within the
+// resource group. resourceGroupName is name of the resource group within the
+// Azure subscription.
+func (client OriginsClient) Update(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.UpdatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client OriginsClient) UpdatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "originName": autorest.Encode("path", originName),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
+ autorest.WithJSON(originProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client OriginsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client OriginsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/profiles.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/profiles.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/profiles.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/profiles.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,501 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ProfilesClient is the use these APIs to manage Azure CDN resources through
+// the Azure Resource Manager. You must make sure that requests made to these
+// resources are secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type ProfilesClient struct {
+ ManagementClient
+}
+
+// NewProfilesClient creates an instance of the ProfilesClient client.
+func NewProfilesClient(subscriptionID string) ProfilesClient {
+ return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient
+// client.
+func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient {
+ return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create sends the create request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// profileName is name of the CDN profile within the resource group.
+// profileProperties is profile properties needed for creation.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) Create(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(profileName, profileProperties, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client ProfilesClient) CreatePreparer(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
+ autorest.WithJSON(profileProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteIfExists sends the delete if exists request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// profileName is name of the CDN profile within the resource group.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) DeleteIfExists(profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteIfExistsPreparer(profileName, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteIfExistsSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteIfExistsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteIfExistsPreparer prepares the DeleteIfExists request.
+func (client ProfilesClient) DeleteIfExistsPreparer(profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// GenerateSsoURI sends the generate sso uri request.
+//
+// profileName is name of the CDN profile within the resource group.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) GenerateSsoURI(profileName string, resourceGroupName string) (result SsoURI, err error) {
+ req, err := client.GenerateSsoURIPreparer(profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GenerateSsoURISender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", resp, "Failure sending request")
+ }
+
+ result, err = client.GenerateSsoURIResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GenerateSsoURIPreparer prepares the GenerateSsoURI request.
+func (client ProfilesClient) GenerateSsoURIPreparer(profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GenerateSsoURISender sends the GenerateSsoURI request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) GenerateSsoURISender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GenerateSsoURIResponder handles the response to the GenerateSsoURI request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) GenerateSsoURIResponder(resp *http.Response) (result SsoURI, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get sends the get request.
+//
+// profileName is name of the CDN profile within the resource group.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) Get(profileName string, resourceGroupName string) (result Profile, err error) {
+ req, err := client.GetPreparer(profileName, resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ProfilesClient) GetPreparer(profileName string, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup sends the list by resource group request.
+//
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) ListByResourceGroup(resourceGroupName string) (result ProfileListResult, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client ProfilesClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListBySubscriptionID sends the list by subscription id request.
+func (client ProfilesClient) ListBySubscriptionID() (result ProfileListResult, err error) {
+ req, err := client.ListBySubscriptionIDPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListBySubscriptionIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", resp, "Failure sending request")
+ }
+
+ result, err = client.ListBySubscriptionIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
+func (client ProfilesClient) ListBySubscriptionIDPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) ListBySubscriptionIDResponder(resp *http.Response) (result ProfileListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update sends the update request. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// profileName is name of the CDN profile within the resource group.
+// profileProperties is profile properties needed for update.
+// resourceGroupName is name of the resource group within the Azure
+// subscription.
+func (client ProfilesClient) Update(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.UpdatePreparer(profileName, profileProperties, resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client ProfilesClient) UpdatePreparer(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
+ autorest.WithJSON(profileProperties),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cdn/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cdn/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package cdn
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "cdn", "2016-04-02")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/CHANGELOG.md juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/CHANGELOG.md
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/CHANGELOG.md 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,74 +0,0 @@
-# CHANGELOG
-
------
-
-## `v0.3.0-beta`
-
-- Corrected unintentional struct field renaming and client renaming in v0.2.0-beta
-
------
-
-## `v0.2.0-beta`
-
-- Added support for DNS, Redis, and Web site services
-- Updated Storage service to API version 2015-06-15
-- Updated Network to include routing table support
-- Address https://github.com/Azure/azure-sdk-for-go/issues/232
-- Address https://github.com/Azure/azure-sdk-for-go/issues/231
-- Address https://github.com/Azure/azure-sdk-for-go/issues/230
-- Address https://github.com/Azure/azure-sdk-for-go/issues/224
-- Address https://github.com/Azure/azure-sdk-for-go/issues/184
-- Address https://github.com/Azure/azure-sdk-for-go/issues/183
-
-------
-
-## `v0.1.1-beta`
-
-- Improves the UserAgent string to disambiguate arm packages from others in the SDK
-- Improves setting the http.Response into generated results (reduces likelihood of a nil reference)
-- Adds gofmt, golint, and govet to Travis CI for the arm packages
-
-##### Fixed Issues
-
-- https://github.com/Azure/azure-sdk-for-go/issues/196
-- https://github.com/Azure/azure-sdk-for-go/issues/213
-
-------
-
-## v0.1.0-beta
-
-This release addresses the issues raised against the alpha release and adds more features. Most
-notably, to address the challenges of encoding JSON
-(see the [comments](https://github.com/Azure/go-autorest#handling-empty-values) in the
-[go-autorest](https://github.com/Azure/go-autorest) package) by using pointers for *all* structure
-fields (with the exception of enumerations). The
-[go-autorest/autorest/to](https://github.com/Azure/go-autorest/tree/master/autorest/to) package
-provides helpers to convert to / from pointers. The examples demonstrate their usage.
-
-Additionally, the packages now align with Go coding standards and pass both `golint` and `govet`.
-Accomplishing this required renaming various fields and parameters (such as changing Url to URL).
-
-##### Changes
-
-- Changed request / response structures to use pointer fields.
-- Changed methods to return `error` instead of `autorest.Error`.
-- Re-divided methods to ease asynchronous requests.
-- Added paged results support.
-- Added a UserAgent string.
-- Added changes necessary to pass golint and govet.
-- Updated README.md with details on asynchronous requests and paging.
-- Saved package dependencies through Godep (for the entire SDK).
-
-##### Fixed Issues:
-
-- https://github.com/Azure/azure-sdk-for-go/issues/205
-- https://github.com/Azure/azure-sdk-for-go/issues/206
-- https://github.com/Azure/azure-sdk-for-go/issues/211
-- https://github.com/Azure/azure-sdk-for-go/issues/212
-
------
-
-## v0.1.0-alpha
-
-This release introduces the Azure Resource Manager packages generated from the corresponding
-[Swagger API](http://swagger.io) [definitions](https://github.com/Azure/azure-rest-api-specs).
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/accounts.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/accounts.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/accounts.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/accounts.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,636 @@
+package cognitiveservices
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AccountsClient is the cognitive Services Management Client
+type AccountsClient struct {
+ ManagementClient
+}
+
+// NewAccountsClient creates an instance of the AccountsClient client.
+func NewAccountsClient(subscriptionID string) AccountsClient {
+ return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountsClientWithBaseURI creates an instance of the AccountsClient
+// client.
+func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
+ return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create Cognitive Services Account. Accounts is a resource group wide
+// resource type. It holds the keys for developer to access intelligent APIs.
+// It's also the resource type for billing.
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only. parameters is the parameters to provide for the created
+// account.
+func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters) (result Account, err error) {
+ req, err := client.CreatePreparer(resourceGroupName, accountName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client AccountsClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a Cognitive Services account from the resource group.
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only.
+func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountsClient) DeletePreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) 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
+}
+
+// GetProperties returns a Cognitive Services account specified by the
+// parameters.
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only.
+func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) {
+ req, err := client.GetPropertiesPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "GetProperties", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetPropertiesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "GetProperties", resp, "Failure sending request")
+ }
+
+ result, err = client.GetPropertiesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "GetProperties", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPropertiesPreparer prepares the GetProperties request.
+func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetPropertiesSender sends the GetProperties request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetPropertiesResponder handles the response to the GetProperties request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List returns all the resources of a particular type belonging to a
+// subscription.
+func (client AccountsClient) List() (result AccountListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup returns all the resources of a particular type
+// belonging to a resource group
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription.
+func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListKeys lists the account keys for the specified Cognitive Services
+// account.
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Congitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only.
+func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListSkus list available SKUs for the requested Cognitive Services account
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only.
+func (client AccountsClient) ListSkus(resourceGroupName string, accountName string) (result AccountEnumerateSkusResult, err error) {
+ req, err := client.ListSkusPreparer(resourceGroupName, accountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListSkus", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSkusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListSkus", resp, "Failure sending request")
+ }
+
+ result, err = client.ListSkusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "ListSkus", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListSkusPreparer prepares the ListSkus request.
+func (client AccountsClient) ListSkusPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSkusSender sends the ListSkus request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListSkusSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListSkusResponder handles the response to the ListSkus request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListSkusResponder(resp *http.Response) (result AccountEnumerateSkusResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RegenerateKey regenerates the specified account key for the specified
+// Cognitive Services account.
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only. body is regenerate key parameters.
+func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, body RegenerateKeyParameters) (result AccountKeys, err error) {
+ req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "RegenerateKey", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegenerateKeySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "RegenerateKey", resp, "Failure sending request")
+ }
+
+ result, err = client.RegenerateKeyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "RegenerateKey", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegenerateKeyPreparer prepares the RegenerateKey request.
+func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, body RegenerateKeyParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegenerateKeySender sends the RegenerateKey request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update updates a Cognitive Services account
+//
+// resourceGroupName is the name of the resource group within the user's
+// subscription. accountName is the name of the cognitive services account
+// within the specified resource group. Cognitive Services account names must
+// be between 3 and 24 characters in length and use numbers and lower-case
+// letters only. body is the parameters to provide for the created account.
+func (client AccountsClient) Update(resourceGroupName string, accountName string, body AccountUpdateParameters) (result Account, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, accountName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "cognitiveservices.AccountsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, body AccountUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,58 @@
+// Package cognitiveservices implements the Azure ARM Cognitiveservices
+// service API version 2016-02-01-preview.
+//
+// Cognitive Services Management Client
+package cognitiveservices
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Cognitiveservices
+ APIVersion = "2016-02-01-preview"
+
+ // DefaultBaseURI is the default URI used for the service Cognitiveservices
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Cognitiveservices.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,184 @@
+package cognitiveservices
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// KeyName enumerates the values for key name.
+type KeyName string
+
+const (
+ // Key1 specifies the key 1 state for key name.
+ Key1 KeyName = "Key1"
+ // Key2 specifies the key 2 state for key name.
+ Key2 KeyName = "Key2"
+)
+
+// Kind enumerates the values for kind.
+type Kind string
+
+const (
+ // ComputerVision specifies the computer vision state for kind.
+ ComputerVision Kind = "ComputerVision"
+ // Emotion specifies the emotion state for kind.
+ Emotion Kind = "Emotion"
+ // Face specifies the face state for kind.
+ Face Kind = "Face"
+ // LUIS specifies the luis state for kind.
+ LUIS Kind = "LUIS"
+ // Recommendations specifies the recommendations state for kind.
+ Recommendations Kind = "Recommendations"
+ // Speech specifies the speech state for kind.
+ Speech Kind = "Speech"
+ // TextAnalytics specifies the text analytics state for kind.
+ TextAnalytics Kind = "TextAnalytics"
+ // WebLM specifies the web lm state for kind.
+ WebLM Kind = "WebLM"
+)
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // Creating specifies the creating state for provisioning state.
+ Creating ProvisioningState = "Creating"
+ // Failed specifies the failed state for provisioning state.
+ Failed ProvisioningState = "Failed"
+ // ResolvingDNS specifies the resolving dns state for provisioning state.
+ ResolvingDNS ProvisioningState = "ResolvingDNS"
+ // Succeeded specifies the succeeded state for provisioning state.
+ Succeeded ProvisioningState = "Succeeded"
+)
+
+// SkuName enumerates the values for sku name.
+type SkuName string
+
+const (
+ // F0 specifies the f0 state for sku name.
+ F0 SkuName = "F0"
+ // S0 specifies the s0 state for sku name.
+ S0 SkuName = "S0"
+ // S1 specifies the s1 state for sku name.
+ S1 SkuName = "S1"
+ // S2 specifies the s2 state for sku name.
+ S2 SkuName = "S2"
+ // S3 specifies the s3 state for sku name.
+ S3 SkuName = "S3"
+ // S4 specifies the s4 state for sku name.
+ S4 SkuName = "S4"
+)
+
+// SkuTier enumerates the values for sku tier.
+type SkuTier string
+
+const (
+ // Free specifies the free state for sku tier.
+ Free SkuTier = "Free"
+ // Premium specifies the premium state for sku tier.
+ Premium SkuTier = "Premium"
+ // Standard specifies the standard state for sku tier.
+ Standard SkuTier = "Standard"
+)
+
+// Account is cognitive Services Account is an Azure resource representing the
+// provisioned account, its type, location and SKU.
+type Account struct {
+ autorest.Response `json:"-"`
+ Etag *string `json:"etag,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Properties *AccountProperties `json:"properties,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// AccountCreateParameters is the parameters to provide for the account.
+type AccountCreateParameters struct {
+ Sku *Sku `json:"sku,omitempty"`
+ Kind Kind `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
+}
+
+// AccountEnumerateSkusResult is the list of cognitive services accounts
+// operation response.
+type AccountEnumerateSkusResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ResourceAndSku `json:"value,omitempty"`
+}
+
+// AccountKeys is the access keys for the cognitive services account.
+type AccountKeys struct {
+ autorest.Response `json:"-"`
+ Key1 *string `json:"key1,omitempty"`
+ Key2 *string `json:"key2,omitempty"`
+}
+
+// AccountListResult is the list of cognitive services accounts operation
+// response.
+type AccountListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Account `json:"value,omitempty"`
+}
+
+// AccountProperties is
+type AccountProperties struct {
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ Endpoint *string `json:"endpoint,omitempty"`
+}
+
+// AccountUpdateParameters is the parameters to provide for the account.
+type AccountUpdateParameters struct {
+ Sku *Sku `json:"sku,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// Error is
+type Error struct {
+ ErrorProperty *ErrorBody `json:"error,omitempty"`
+}
+
+// ErrorBody is
+type ErrorBody struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// RegenerateKeyParameters is regenerate key parameters.
+type RegenerateKeyParameters struct {
+ KeyName KeyName `json:"keyName,omitempty"`
+}
+
+// ResourceAndSku is
+type ResourceAndSku struct {
+ ResourceType *string `json:"resourceType,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+}
+
+// Sku is the SKU of the cognitive services account.
+type Sku struct {
+ Name SkuName `json:"name,omitempty"`
+ Tier SkuTier `json:"tier,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/cognitiveservices/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package cognitiveservices
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "cognitiveservices", "2016-02-01-preview")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// AvailabilitySetsClient is the the Compute Management Client.
@@ -46,21 +46,21 @@
// resourceGroupName is the name of the resource group. name is parameters
// supplied to the Create Availability Set operation. parameters is
// parameters supplied to the Create Availability Set operation.
-func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, ae error) {
+func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -69,29 +69,29 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters AvailabilitySet) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -100,7 +100,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -111,21 +111,21 @@
//
// resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set.
-func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabilitySetName string) (result autorest.Response, ae error) {
+func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, availabilitySetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request")
}
return
@@ -134,28 +134,27 @@
// DeletePreparer prepares the Delete request.
func (client AvailabilitySetsClient) DeletePreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "availabilitySetName": url.QueryEscape(availabilitySetName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "availabilitySetName": autorest.Encode("path", availabilitySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -164,7 +163,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -174,21 +173,21 @@
//
// resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set.
-func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilitySetName string) (result AvailabilitySet, ae error) {
+func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
req, err := client.GetPreparer(resourceGroupName, availabilitySetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request")
}
return
@@ -197,28 +196,27 @@
// GetPreparer prepares the Get request.
func (client AvailabilitySetsClient) GetPreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "availabilitySetName": url.QueryEscape(availabilitySetName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "availabilitySetName": autorest.Encode("path", availabilitySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -227,7 +225,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -237,21 +235,21 @@
// List the operation to list the availability sets.
//
// resourceGroupName is the name of the resource group.
-func (client AvailabilitySetsClient) List(resourceGroupName string) (result AvailabilitySetListResult, ae error) {
+func (client AvailabilitySetsClient) List(resourceGroupName string) (result AvailabilitySetListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request")
}
return
@@ -260,27 +258,26 @@
// ListPreparer prepares the List request.
func (client AvailabilitySetsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -289,33 +286,33 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListAvailableSizes lists virtual-machine-sizes available to be used for an
-// availability set.
+// ListAvailableSizes lists all available virtual machine sizes that can be
+// used to create a new virtual machine in an existing availability set.
//
// resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set.
-func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, ae error) {
+func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
req, err := client.ListAvailableSizesPreparer(resourceGroupName, availabilitySetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "ListAvailableSizes", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request")
}
resp, err := client.ListAvailableSizesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "ListAvailableSizes", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request")
}
result, err = client.ListAvailableSizesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/AvailabilitySetsClient", "ListAvailableSizes", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request")
}
return
@@ -324,28 +321,27 @@
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
func (client AvailabilitySetsClient) ListAvailableSizesPreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "availabilitySetName": url.QueryEscape(availabilitySetName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "availabilitySetName": autorest.Encode("path", availabilitySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
@@ -354,7 +350,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,7 @@
+// Package compute implements the Azure ARM Compute service API version
+// 2016-03-30.
+//
+// The Compute Management Client.
package compute
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,26 +18,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Compute
- APIVersion = "2015-06-15"
+ APIVersion = "2016-03-30"
// DefaultBaseURI is the default URI used for the service Compute
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the the Compute Management Client.
+// ManagementClient is the base client for Compute.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +52,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,44 @@
+// Package compute implements the Azure ARM Compute service API version
+// 2016-03-30.
+//
+// The Container Service Client.
+package compute
+
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Compute
+ APIVersion = "2016-03-30"
+
+ // DefaultBaseURI is the default URI used for the service Compute
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Compute.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/containerserviceoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/containerserviceoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/containerserviceoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/containerserviceoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,292 @@
+package compute
+
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ContainerServiceOperationsClient is the the Container Service Client.
+type ContainerServiceOperationsClient struct {
+ ManagementClient
+}
+
+// NewContainerServiceOperationsClient creates an instance of the
+// ContainerServiceOperationsClient client.
+func NewContainerServiceOperationsClient(subscriptionID string) ContainerServiceOperationsClient {
+ return NewContainerServiceOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewContainerServiceOperationsClientWithBaseURI creates an instance of the
+// ContainerServiceOperationsClient client.
+func NewContainerServiceOperationsClientWithBaseURI(baseURI string, subscriptionID string) ContainerServiceOperationsClient {
+ return ContainerServiceOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate the operation to create or update a container service. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. containerServiceName
+// is the name of the container service within the given subscription and
+// resource group. parameters is parameters supplied to the Create Container
+// Service operation.
+func (client ContainerServiceOperationsClient) CreateOrUpdate(resourceGroupName string, containerServiceName string, parameters ContainerService, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, containerServiceName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ContainerServiceOperationsClient) CreateOrUpdatePreparer(resourceGroupName string, containerServiceName string, parameters ContainerService, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "containerServiceName": autorest.Encode("path", containerServiceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ContainerServiceOperationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ContainerServiceOperationsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Delete the operation to delete a container service. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. containerServiceName
+// is the name of the container service within the given subscription and
+// resource group.
+func (client ContainerServiceOperationsClient) Delete(resourceGroupName string, containerServiceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, containerServiceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ContainerServiceOperationsClient) DeletePreparer(resourceGroupName string, containerServiceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "containerServiceName": autorest.Encode("path", containerServiceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ContainerServiceOperationsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ContainerServiceOperationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get the operation to get a container service.
+//
+// resourceGroupName is the name of the resource group. containerServiceName
+// is the name of the container service within the given subscription and
+// resource group.
+func (client ContainerServiceOperationsClient) Get(resourceGroupName string, containerServiceName string) (result ContainerService, err error) {
+ req, err := client.GetPreparer(resourceGroupName, containerServiceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ContainerServiceOperationsClient) GetPreparer(resourceGroupName string, containerServiceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "containerServiceName": autorest.Encode("path", containerServiceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ContainerServiceOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ContainerServiceOperationsClient) GetResponder(resp *http.Response) (result ContainerService, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List the operation to list container services.
+//
+// resourceGroupName is the name of the resource group.
+func (client ContainerServiceOperationsClient) List(resourceGroupName string) (result ContainerServiceListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ContainerServiceOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ContainerServiceOperationsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ContainerServiceOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ContainerServiceOperationsClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,261 @@
+package compute
+
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// ContainerServiceOchestratorTypes enumerates the values for container
+// service ochestrator types.
+type ContainerServiceOchestratorTypes string
+
+const (
+ // DCOS specifies the dcos state for container service ochestrator types.
+ DCOS ContainerServiceOchestratorTypes = "DCOS"
+ // Swarm specifies the swarm state for container service ochestrator types.
+ Swarm ContainerServiceOchestratorTypes = "Swarm"
+)
+
+// ContainerServiceVMSizeTypes enumerates the values for container service vm
+// size types.
+type ContainerServiceVMSizeTypes string
+
+const (
+ // StandardA0 specifies the standard a0 state for container service vm
+ // size types.
+ StandardA0 ContainerServiceVMSizeTypes = "Standard_A0"
+ // StandardA1 specifies the standard a1 state for container service vm
+ // size types.
+ StandardA1 ContainerServiceVMSizeTypes = "Standard_A1"
+ // StandardA10 specifies the standard a10 state for container service vm
+ // size types.
+ StandardA10 ContainerServiceVMSizeTypes = "Standard_A10"
+ // StandardA11 specifies the standard a11 state for container service vm
+ // size types.
+ StandardA11 ContainerServiceVMSizeTypes = "Standard_A11"
+ // StandardA2 specifies the standard a2 state for container service vm
+ // size types.
+ StandardA2 ContainerServiceVMSizeTypes = "Standard_A2"
+ // StandardA3 specifies the standard a3 state for container service vm
+ // size types.
+ StandardA3 ContainerServiceVMSizeTypes = "Standard_A3"
+ // StandardA4 specifies the standard a4 state for container service vm
+ // size types.
+ StandardA4 ContainerServiceVMSizeTypes = "Standard_A4"
+ // StandardA5 specifies the standard a5 state for container service vm
+ // size types.
+ StandardA5 ContainerServiceVMSizeTypes = "Standard_A5"
+ // StandardA6 specifies the standard a6 state for container service vm
+ // size types.
+ StandardA6 ContainerServiceVMSizeTypes = "Standard_A6"
+ // StandardA7 specifies the standard a7 state for container service vm
+ // size types.
+ StandardA7 ContainerServiceVMSizeTypes = "Standard_A7"
+ // StandardA8 specifies the standard a8 state for container service vm
+ // size types.
+ StandardA8 ContainerServiceVMSizeTypes = "Standard_A8"
+ // StandardA9 specifies the standard a9 state for container service vm
+ // size types.
+ StandardA9 ContainerServiceVMSizeTypes = "Standard_A9"
+ // StandardD1 specifies the standard d1 state for container service vm
+ // size types.
+ StandardD1 ContainerServiceVMSizeTypes = "Standard_D1"
+ // StandardD11 specifies the standard d11 state for container service vm
+ // size types.
+ StandardD11 ContainerServiceVMSizeTypes = "Standard_D11"
+ // StandardD11V2 specifies the standard d11v2 state for container service
+ // vm size types.
+ StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2"
+ // StandardD12 specifies the standard d12 state for container service vm
+ // size types.
+ StandardD12 ContainerServiceVMSizeTypes = "Standard_D12"
+ // StandardD12V2 specifies the standard d12v2 state for container service
+ // vm size types.
+ StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2"
+ // StandardD13 specifies the standard d13 state for container service vm
+ // size types.
+ StandardD13 ContainerServiceVMSizeTypes = "Standard_D13"
+ // StandardD13V2 specifies the standard d13v2 state for container service
+ // vm size types.
+ StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2"
+ // StandardD14 specifies the standard d14 state for container service vm
+ // size types.
+ StandardD14 ContainerServiceVMSizeTypes = "Standard_D14"
+ // StandardD14V2 specifies the standard d14v2 state for container service
+ // vm size types.
+ StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2"
+ // StandardD1V2 specifies the standard d1v2 state for container service vm
+ // size types.
+ StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2"
+ // StandardD2 specifies the standard d2 state for container service vm
+ // size types.
+ StandardD2 ContainerServiceVMSizeTypes = "Standard_D2"
+ // StandardD2V2 specifies the standard d2v2 state for container service vm
+ // size types.
+ StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2"
+ // StandardD3 specifies the standard d3 state for container service vm
+ // size types.
+ StandardD3 ContainerServiceVMSizeTypes = "Standard_D3"
+ // StandardD3V2 specifies the standard d3v2 state for container service vm
+ // size types.
+ StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2"
+ // StandardD4 specifies the standard d4 state for container service vm
+ // size types.
+ StandardD4 ContainerServiceVMSizeTypes = "Standard_D4"
+ // StandardD4V2 specifies the standard d4v2 state for container service vm
+ // size types.
+ StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2"
+ // StandardD5V2 specifies the standard d5v2 state for container service vm
+ // size types.
+ StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2"
+ // StandardDS1 specifies the standard ds1 state for container service vm
+ // size types.
+ StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1"
+ // StandardDS11 specifies the standard ds11 state for container service vm
+ // size types.
+ StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11"
+ // StandardDS12 specifies the standard ds12 state for container service vm
+ // size types.
+ StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12"
+ // StandardDS13 specifies the standard ds13 state for container service vm
+ // size types.
+ StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13"
+ // StandardDS14 specifies the standard ds14 state for container service vm
+ // size types.
+ StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14"
+ // StandardDS2 specifies the standard ds2 state for container service vm
+ // size types.
+ StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2"
+ // StandardDS3 specifies the standard ds3 state for container service vm
+ // size types.
+ StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3"
+ // StandardDS4 specifies the standard ds4 state for container service vm
+ // size types.
+ StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4"
+ // StandardG1 specifies the standard g1 state for container service vm
+ // size types.
+ StandardG1 ContainerServiceVMSizeTypes = "Standard_G1"
+ // StandardG2 specifies the standard g2 state for container service vm
+ // size types.
+ StandardG2 ContainerServiceVMSizeTypes = "Standard_G2"
+ // StandardG3 specifies the standard g3 state for container service vm
+ // size types.
+ StandardG3 ContainerServiceVMSizeTypes = "Standard_G3"
+ // StandardG4 specifies the standard g4 state for container service vm
+ // size types.
+ StandardG4 ContainerServiceVMSizeTypes = "Standard_G4"
+ // StandardG5 specifies the standard g5 state for container service vm
+ // size types.
+ StandardG5 ContainerServiceVMSizeTypes = "Standard_G5"
+ // StandardGS1 specifies the standard gs1 state for container service vm
+ // size types.
+ StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1"
+ // StandardGS2 specifies the standard gs2 state for container service vm
+ // size types.
+ StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2"
+ // StandardGS3 specifies the standard gs3 state for container service vm
+ // size types.
+ StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3"
+ // StandardGS4 specifies the standard gs4 state for container service vm
+ // size types.
+ StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4"
+ // StandardGS5 specifies the standard gs5 state for container service vm
+ // size types.
+ StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5"
+)
+
+// ContainerService is container service
+type ContainerService struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *ContainerServiceProperties `json:"properties,omitempty"`
+}
+
+// ContainerServiceAgentPoolProfile is profile for container service agent pool
+type ContainerServiceAgentPoolProfile struct {
+ Name *string `json:"name,omitempty"`
+ Count *int32 `json:"count,omitempty"`
+ VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"`
+ DNSPrefix *string `json:"dnsPrefix,omitempty"`
+ Fqdn *string `json:"fqdn,omitempty"`
+}
+
+// ContainerServiceDiagnosticsProfile is
+type ContainerServiceDiagnosticsProfile struct {
+ VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"`
+}
+
+// ContainerServiceLinuxProfile is profile for Linux VMs
+type ContainerServiceLinuxProfile struct {
+ AdminUsername *string `json:"adminUsername,omitempty"`
+ SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"`
+}
+
+// ContainerServiceListResult is the List Container Service operation response
+type ContainerServiceListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ContainerService `json:"value,omitempty"`
+}
+
+// ContainerServiceMasterProfile is profile for container service master
+type ContainerServiceMasterProfile struct {
+ Count *int32 `json:"count,omitempty"`
+ DNSPrefix *string `json:"dnsPrefix,omitempty"`
+ Fqdn *string `json:"fqdn,omitempty"`
+}
+
+// ContainerServiceOrchestratorProfile is profile for Orchestrator
+type ContainerServiceOrchestratorProfile struct {
+ OrchestratorType ContainerServiceOchestratorTypes `json:"orchestratorType,omitempty"`
+}
+
+// ContainerServiceProperties is properties of container service
+type ContainerServiceProperties struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"`
+ MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"`
+ AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"`
+ WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"`
+ LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"`
+ DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
+}
+
+// ContainerServiceSSHConfiguration is sSH configuration for Linux based VMs
+// running on Azure
+type ContainerServiceSSHConfiguration struct {
+ PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"`
+}
+
+// ContainerServiceSSHPublicKey is contains information about SSH certificate
+// public key data.
+type ContainerServiceSSHPublicKey struct {
+ KeyData *string `json:"keyData,omitempty"`
+}
+
+// ContainerServiceVMDiagnostics is describes VM Diagnostics.
+type ContainerServiceVMDiagnostics struct {
+ Enabled *bool `json:"enabled,omitempty"`
+ StorageURI *string `json:"storageUri,omitempty"`
+}
+
+// ContainerServiceWindowsProfile is profile for Windows VMs
+type ContainerServiceWindowsProfile struct {
+ AdminUsername *string `json:"adminUsername,omitempty"`
+ AdminPassword *string `json:"adminPassword,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/containerservice/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,29 @@
+package compute
+
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "compute", "2016-03-30")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
@@ -58,6 +58,14 @@
FromImage DiskCreateOptionTypes = "fromImage"
)
+// InstanceViewTypes enumerates the values for instance view types.
+type InstanceViewTypes string
+
+const (
+ // InstanceView specifies the instance view state for instance view types.
+ InstanceView InstanceViewTypes = "instanceView"
+)
+
// OperatingSystemTypes enumerates the values for operating system types.
type OperatingSystemTypes string
@@ -68,36 +76,6 @@
Windows OperatingSystemTypes = "Windows"
)
-// OperationStatus enumerates the values for operation status.
-type OperationStatus string
-
-const (
- // Failed specifies the failed state for operation status.
- Failed OperationStatus = "Failed"
- // InProgress specifies the in progress state for operation status.
- InProgress OperationStatus = "InProgress"
- // Succeeded specifies the succeeded state for operation status.
- Succeeded OperationStatus = "Succeeded"
-)
-
-// OperationStatusEnum enumerates the values for operation status enum.
-type OperationStatusEnum string
-
-const (
- // OperationStatusEnumFailed specifies the operation status enum failed
- // state for operation status enum.
- OperationStatusEnumFailed OperationStatusEnum = "Failed"
- // OperationStatusEnumInProgress specifies the operation status enum in
- // progress state for operation status enum.
- OperationStatusEnumInProgress OperationStatusEnum = "InProgress"
- // OperationStatusEnumPreempted specifies the operation status enum
- // preempted state for operation status enum.
- OperationStatusEnumPreempted OperationStatusEnum = "Preempted"
- // OperationStatusEnumSucceeded specifies the operation status enum
- // succeeded state for operation status enum.
- OperationStatusEnumSucceeded OperationStatusEnum = "Succeeded"
-)
-
// PassNames enumerates the values for pass names.
type PassNames string
@@ -149,14 +127,6 @@
Manual UpgradeMode = "Manual"
)
-// UsageUnit enumerates the values for usage unit.
-type UsageUnit string
-
-const (
- // Count specifies the count state for usage unit.
- Count UsageUnit = "Count"
-)
-
// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual
// machine scale set sku scale type.
type VirtualMachineScaleSetSkuScaleType string
@@ -250,6 +220,9 @@
// StandardD14V2 specifies the standard d14v2 state for virtual machine
// size types.
StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2"
+ // StandardD15V2 specifies the standard d15v2 state for virtual machine
+ // size types.
+ StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2"
// StandardD1V2 specifies the standard d1v2 state for virtual machine size
// types.
StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2"
@@ -280,24 +253,54 @@
// StandardDS11 specifies the standard ds11 state for virtual machine size
// types.
StandardDS11 VirtualMachineSizeTypes = "Standard_DS11"
+ // StandardDS11V2 specifies the standard ds11v2 state for virtual machine
+ // size types.
+ StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2"
// StandardDS12 specifies the standard ds12 state for virtual machine size
// types.
StandardDS12 VirtualMachineSizeTypes = "Standard_DS12"
+ // StandardDS12V2 specifies the standard ds12v2 state for virtual machine
+ // size types.
+ StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2"
// StandardDS13 specifies the standard ds13 state for virtual machine size
// types.
StandardDS13 VirtualMachineSizeTypes = "Standard_DS13"
+ // StandardDS13V2 specifies the standard ds13v2 state for virtual machine
+ // size types.
+ StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2"
// StandardDS14 specifies the standard ds14 state for virtual machine size
// types.
StandardDS14 VirtualMachineSizeTypes = "Standard_DS14"
+ // StandardDS14V2 specifies the standard ds14v2 state for virtual machine
+ // size types.
+ StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2"
+ // StandardDS15V2 specifies the standard ds15v2 state for virtual machine
+ // size types.
+ StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2"
+ // StandardDS1V2 specifies the standard ds1v2 state for virtual machine
+ // size types.
+ StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2"
// StandardDS2 specifies the standard ds2 state for virtual machine size
// types.
StandardDS2 VirtualMachineSizeTypes = "Standard_DS2"
+ // StandardDS2V2 specifies the standard ds2v2 state for virtual machine
+ // size types.
+ StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2"
// StandardDS3 specifies the standard ds3 state for virtual machine size
// types.
StandardDS3 VirtualMachineSizeTypes = "Standard_DS3"
+ // StandardDS3V2 specifies the standard ds3v2 state for virtual machine
+ // size types.
+ StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2"
// StandardDS4 specifies the standard ds4 state for virtual machine size
// types.
StandardDS4 VirtualMachineSizeTypes = "Standard_DS4"
+ // StandardDS4V2 specifies the standard ds4v2 state for virtual machine
+ // size types.
+ StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2"
+ // StandardDS5V2 specifies the standard ds5v2 state for virtual machine
+ // size types.
+ StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2"
// StandardG1 specifies the standard g1 state for virtual machine size
// types.
StandardG1 VirtualMachineSizeTypes = "Standard_G1"
@@ -330,10 +333,10 @@
StandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
)
-// AdditionalUnattendContent is gets or sets additional XML formatted
-// information that can be included in the Unattend.xml file, which is used
-// by Windows Setup. Contents are defined by setting name, component name,
-// and the pass in which the content is a applied.
+// AdditionalUnattendContent is additional XML formatted information that can
+// be included in the Unattend.xml file, which is used by Windows Setup.
+// Contents are defined by setting name, component name, and the pass in
+// which the content is a applied.
type AdditionalUnattendContent struct {
PassName PassNames `json:"passName,omitempty"`
ComponentName ComponentNames `json:"componentName,omitempty"`
@@ -381,8 +384,8 @@
// AvailabilitySetProperties is the instance view of a resource.
type AvailabilitySetProperties struct {
- PlatformUpdateDomainCount *int `json:"platformUpdateDomainCount,omitempty"`
- PlatformFaultDomainCount *int `json:"platformFaultDomainCount,omitempty"`
+ PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"`
+ PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"`
VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"`
Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
}
@@ -402,27 +405,18 @@
// DataDisk is describes a data disk.
type DataDisk struct {
- Lun *int `json:"lun,omitempty"`
+ Lun *int32 `json:"lun,omitempty"`
Name *string `json:"name,omitempty"`
Vhd *VirtualHardDisk `json:"vhd,omitempty"`
Image *VirtualHardDisk `json:"image,omitempty"`
Caching CachingTypes `json:"caching,omitempty"`
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- DiskSizeGB *int `json:"diskSizeGB,omitempty"`
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
}
// DataDiskImage is contains the data disk images information.
type DataDiskImage struct {
- Lun *int `json:"lun,omitempty"`
-}
-
-// DeleteOperationResult is the compute long running operation response.
-type DeleteOperationResult struct {
- OperationID *string `json:"operationId,omitempty"`
- Status OperationStatus `json:"status,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- Error *APIError `json:"error,omitempty"`
+ Lun *int32 `json:"lun,omitempty"`
}
// DiagnosticsProfile is describes a diagnostics profile.
@@ -434,6 +428,7 @@
type DiskEncryptionSettings struct {
DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"`
KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"`
+ Enabled *bool `json:"enabled,omitempty"`
}
// DiskInstanceView is the instance view of the disk.
@@ -492,6 +487,31 @@
type ListUsagesResult struct {
autorest.Response `json:"-"`
Value *[]Usage `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ListUsagesResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ListUsagesResult) ListUsagesResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ListVirtualMachineExtensionImage is
+type ListVirtualMachineExtensionImage struct {
+ autorest.Response `json:"-"`
+ Value *[]VirtualMachineExtensionImage `json:"value,omitempty"`
+}
+
+// ListVirtualMachineImageResource is
+type ListVirtualMachineImageResource struct {
+ autorest.Response `json:"-"`
+ Value *[]VirtualMachineImageResource `json:"value,omitempty"`
}
// LongRunningOperationProperties is compute-specific operation properties,
@@ -500,17 +520,6 @@
Output *map[string]interface{} `json:"output,omitempty"`
}
-// LongRunningOperationResult is the Compute service response for long-running
-// operations.
-type LongRunningOperationResult struct {
- OperationID *string `json:"operationId,omitempty"`
- Status OperationStatusEnum `json:"status,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- Properties *LongRunningOperationProperties `json:"properties,omitempty"`
- Error *APIError `json:"error,omitempty"`
-}
-
// NetworkInterfaceReference is describes a network interface reference.
type NetworkInterfaceReference struct {
ID *string `json:"id,omitempty"`
@@ -537,7 +546,7 @@
Image *VirtualHardDisk `json:"image,omitempty"`
Caching CachingTypes `json:"caching,omitempty"`
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- DiskSizeGB *int `json:"diskSizeGB,omitempty"`
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
}
// OSDiskImage is contains the os disk image information.
@@ -585,7 +594,7 @@
type Sku struct {
Name *string `json:"name,omitempty"`
Tier *string `json:"tier,omitempty"`
- Capacity *int32 `json:"capacity,omitempty"`
+ Capacity *int64 `json:"capacity,omitempty"`
}
// SSHConfiguration is sSH configuration for Linux based VMs running on Azure
@@ -619,9 +628,9 @@
// Usage is describes Compute Resource Usage.
type Usage struct {
- Unit UsageUnit `json:"unit,omitempty"`
- CurrentValue *int `json:"currentValue,omitempty"`
- Limit *int32 `json:"limit,omitempty"`
+ Unit *string `json:"unit,omitempty"`
+ CurrentValue *int32 `json:"currentValue,omitempty"`
+ Limit *int64 `json:"limit,omitempty"`
Name *UsageName `json:"name,omitempty"`
}
@@ -714,10 +723,11 @@
type VirtualMachineExtensionImage struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
- Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
}
// VirtualMachineExtensionImageProperties is describes the properties of a
@@ -743,6 +753,7 @@
// VirtualMachineExtensionProperties is describes the properties of a Virtual
// Machine Extension.
type VirtualMachineExtensionProperties struct {
+ ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
Publisher *string `json:"publisher,omitempty"`
Type *string `json:"type,omitempty"`
TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
@@ -757,10 +768,10 @@
type VirtualMachineImage struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
- Properties *VirtualMachineImageProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *VirtualMachineImageProperties `json:"properties,omitempty"`
}
// VirtualMachineImageProperties is describes the properties of a Virtual
@@ -779,16 +790,10 @@
Tags *map[string]*string `json:"tags,omitempty"`
}
-// VirtualMachineImageResourceList is
-type VirtualMachineImageResourceList struct {
- autorest.Response `json:"-"`
- Value *[]VirtualMachineImageResource `json:"value,omitempty"`
-}
-
// VirtualMachineInstanceView is the instance view of a virtual machine.
type VirtualMachineInstanceView struct {
- PlatformUpdateDomain *int `json:"platformUpdateDomain,omitempty"`
- PlatformFaultDomain *int `json:"platformFaultDomain,omitempty"`
+ PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"`
+ PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"`
RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"`
VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"`
Disks *[]DiskInstanceView `json:"disks,omitempty"`
@@ -826,6 +831,8 @@
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"`
+ LicenseType *string `json:"licenseType,omitempty"`
+ VMID *string `json:"vmId,omitempty"`
}
// VirtualMachineScaleSet is describes a Virtual Machine Scale Set.
@@ -892,8 +899,10 @@
// VirtualMachineScaleSetIPConfigurationProperties is describes a virtual
// machine scale set network profile's IP configuration properties.
type VirtualMachineScaleSetIPConfigurationProperties struct {
- Subnet *APIEntityReference `json:"subnet,omitempty"`
- LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
+ Subnet *APIEntityReference `json:"subnet,omitempty"`
+ ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"`
+ LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
+ LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"`
}
// VirtualMachineScaleSetListResult is the List Virtual Machine operation
@@ -901,6 +910,19 @@
type VirtualMachineScaleSetListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSet `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// VirtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client VirtualMachineScaleSetListResult) VirtualMachineScaleSetListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
}
// VirtualMachineScaleSetListSkusResult is the Virtual Machine Scale Set List
@@ -908,6 +930,19 @@
type VirtualMachineScaleSetListSkusResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// VirtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client VirtualMachineScaleSetListSkusResult) VirtualMachineScaleSetListSkusResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
}
// VirtualMachineScaleSetListWithLinkResult is the List Virtual Machine
@@ -980,6 +1015,7 @@
UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
+ OverProvision *bool `json:"overProvision,omitempty"`
}
// VirtualMachineScaleSetSku is describes an available virtual machine scale
@@ -992,9 +1028,9 @@
// VirtualMachineScaleSetSkuCapacity is describes scaling information of a sku.
type VirtualMachineScaleSetSkuCapacity struct {
- Minimum *int32 `json:"minimum,omitempty"`
- Maximum *int32 `json:"maximum,omitempty"`
- DefaultCapacity *int32 `json:"defaultCapacity,omitempty"`
+ Minimum *int64 `json:"minimum,omitempty"`
+ Maximum *int64 `json:"maximum,omitempty"`
+ DefaultCapacity *int64 `json:"defaultCapacity,omitempty"`
ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"`
}
@@ -1044,8 +1080,8 @@
// machine scale set VM.
type VirtualMachineScaleSetVMInstanceView struct {
autorest.Response `json:"-"`
- PlatformUpdateDomain *int `json:"platformUpdateDomain,omitempty"`
- PlatformFaultDomain *int `json:"platformFaultDomain,omitempty"`
+ PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"`
+ PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"`
RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"`
VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"`
Disks *[]DiskInstanceView `json:"disks,omitempty"`
@@ -1059,6 +1095,19 @@
type VirtualMachineScaleSetVMListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// VirtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client VirtualMachineScaleSetVMListResult) VirtualMachineScaleSetVMListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
}
// VirtualMachineScaleSetVMProfile is describes a virtual machine scale set
@@ -1082,16 +1131,17 @@
DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
+ LicenseType *string `json:"licenseType,omitempty"`
}
// VirtualMachineSize is describes the properties of a VM size.
type VirtualMachineSize struct {
Name *string `json:"name,omitempty"`
- NumberOfCores *int `json:"numberOfCores,omitempty"`
- OsDiskSizeInMB *int `json:"osDiskSizeInMB,omitempty"`
- ResourceDiskSizeInMB *int `json:"resourceDiskSizeInMB,omitempty"`
- MemoryInMB *int `json:"memoryInMB,omitempty"`
- MaxDataDiskCount *int `json:"maxDataDiskCount,omitempty"`
+ NumberOfCores *int32 `json:"numberOfCores,omitempty"`
+ OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"`
+ ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"`
+ MemoryInMB *int32 `json:"memoryInMB,omitempty"`
+ MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"`
}
// VirtualMachineSizeListResult is the List Virtual Machine operation response.
@@ -1104,7 +1154,7 @@
// machine scale set instance view status summary.
type VirtualMachineStatusCodeCount struct {
Code *string `json:"code,omitempty"`
- Count *int `json:"count,omitempty"`
+ Count *int32 `json:"count,omitempty"`
}
// WindowsConfiguration is describes Windows Configuration of the OS Profile.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/usageoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// UsageOperationsClient is the the Compute Management Client.
@@ -44,21 +44,21 @@
// List lists compute usages for a subscription.
//
// location is the location upon which resource usage is queried.
-func (client UsageOperationsClient) List(location string) (result ListUsagesResult, ae error) {
+func (client UsageOperationsClient) List(location string) (result ListUsagesResult, err error) {
req, err := client.ListPreparer(location)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/UsageOperationsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/UsageOperationsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/UsageOperationsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure responding to request")
}
return
@@ -67,27 +67,26 @@
// ListPreparer prepares the List request.
func (client UsageOperationsClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client UsageOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -96,9 +95,33 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ 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 UsageOperationsClient) ListNextResults(lastResults ListUsagesResult) (result ListUsagesResult, err error) {
+ req, err := lastResults.ListUsagesResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.UsageOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "compute", "2015-06-15")
+ return fmt.Sprintf(userAgentFormat, Version(), "compute", "2016-03-30")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineExtensionImagesClient is the the Compute Management Client.
@@ -43,21 +43,21 @@
// Get gets a virtual machine extension image.
//
-func (client VirtualMachineExtensionImagesClient) Get(location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, ae error) {
+func (client VirtualMachineExtensionImagesClient) Get(location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
req, err := client.GetPreparer(location, publisherName, typeParameter, version)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request")
}
return
@@ -66,30 +66,29 @@
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionImagesClient) GetPreparer(location string, publisherName string, typeParameter string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "publisherName": url.QueryEscape(publisherName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "type": url.QueryEscape(typeParameter),
- "version": url.QueryEscape(version),
+ "location": autorest.Encode("path", location),
+ "publisherName": autorest.Encode("path", publisherName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "type": autorest.Encode("path", typeParameter),
+ "version": autorest.Encode("path", version),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -98,7 +97,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -107,21 +106,21 @@
// ListTypes gets a list of virtual machine extension image types.
//
-func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result VirtualMachineImageResourceList, ae error) {
+func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListTypesPreparer(location, publisherName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListTypes", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request")
}
resp, err := client.ListTypesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListTypes", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request")
}
result, err = client.ListTypesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListTypes", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request")
}
return
@@ -130,37 +129,36 @@
// ListTypesPreparer prepares the ListTypes request.
func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "publisherName": url.QueryEscape(publisherName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "publisherName": autorest.Encode("path", publisherName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListTypesSender sends the ListTypes request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListTypesResponder handles the response to the ListTypes request. The method always
// closes the http.Response Body.
-func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -170,70 +168,69 @@
// ListVersions gets a list of virtual machine extension image versions.
//
// filter is the filter to apply on the operation.
-func (client VirtualMachineExtensionImagesClient) ListVersions(location string, publisherName string, typeParameter string, filter string, top *int, orderBy string) (result VirtualMachineImageResourceList, ae error) {
- req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderBy)
+func (client VirtualMachineExtensionImagesClient) ListVersions(location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
+ req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderby)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListVersions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request")
}
resp, err := client.ListVersionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListVersions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request")
}
result, err = client.ListVersionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionImagesClient", "ListVersions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request")
}
return
}
// ListVersionsPreparer prepares the ListVersions request.
-func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location string, publisherName string, typeParameter string, filter string, top *int, orderBy string) (*http.Request, error) {
+func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "publisherName": url.QueryEscape(publisherName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "type": url.QueryEscape(typeParameter),
+ "location": autorest.Encode("path", location),
+ "publisherName": autorest.Encode("path", publisherName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "type": autorest.Encode("path", typeParameter),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", *top)
}
- if len(orderBy) > 0 {
- queryParameters["$orderBy"] = orderBy
+ if len(orderby) > 0 {
+ queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListVersionsSender sends the ListVersions request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListVersionsResponder handles the response to the ListVersions request. The method always
// closes the http.Response Body.
-func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineExtensionsClient is the the Compute Management Client.
@@ -41,126 +41,134 @@
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// CreateOrUpdate the operation to create or update the extension.
+// CreateOrUpdate the operation to create or update the extension. This method
+// may poll for completion. Polling can be canceled by passing the cancel
+// channel argument. The channel will be used to cancel polling and any
+// outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine where the extension should be create or updated.
// vmExtensionName is the name of the virtual machine extension.
// extensionParameters is parameters supplied to the Create Virtual Machine
// Extension operation.
-func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtension, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, vmExtensionName, extensionParameters)
+func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, vmExtensionName, extensionParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) {
+func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmExtensionName": url.QueryEscape(vmExtensionName),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmExtensionName": autorest.Encode("path", vmExtensionName),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
+func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// Delete the operation to delete the extension.
+// Delete the operation to delete the extension. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine where the extension should be deleted. vmExtensionName
// is the name of the virtual machine extension.
-func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, vmName string, vmExtensionName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, vmName, vmExtensionName)
+func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, vmName string, vmExtensionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, vmName, vmExtensionName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName string, vmName string, vmExtensionName string) (*http.Request, error) {
+func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName string, vmName string, vmExtensionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmExtensionName": url.QueryEscape(vmExtensionName),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmExtensionName": autorest.Encode("path", vmExtensionName),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusNoContent, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -169,7 +177,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusNoContent, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -181,21 +189,21 @@
// the virtual machine containing the extension. vmExtensionName is the name
// of the virtual machine extension. expand is the expand expression to apply
// on the operation.
-func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, vmName string, vmExtensionName string, expand string) (result VirtualMachineExtension, ae error) {
+func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, vmName string, vmExtensionName string, expand string) (result VirtualMachineExtension, err error) {
req, err := client.GetPreparer(resourceGroupName, vmName, vmExtensionName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineExtensionsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request")
}
return
@@ -204,32 +212,31 @@
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName string, vmName string, vmExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmExtensionName": url.QueryEscape(vmExtensionName),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmExtensionName": autorest.Encode("path", vmExtensionName),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(expand) > 0 {
- queryParameters["$expand"] = expand
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -238,7 +245,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineImagesClient is the the Compute Management Client.
@@ -43,21 +43,21 @@
// Get gets a virtual machine image.
//
-func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, ae error) {
+func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
req, err := client.GetPreparer(location, publisherName, offer, skus, version)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request")
}
return
@@ -66,31 +66,30 @@
// GetPreparer prepares the Get request.
func (client VirtualMachineImagesClient) GetPreparer(location string, publisherName string, offer string, skus string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "offer": url.QueryEscape(offer),
- "publisherName": url.QueryEscape(publisherName),
- "skus": url.QueryEscape(skus),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "version": url.QueryEscape(version),
+ "location": autorest.Encode("path", location),
+ "offer": autorest.Encode("path", offer),
+ "publisherName": autorest.Encode("path", publisherName),
+ "skus": autorest.Encode("path", skus),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "version": autorest.Encode("path", version),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -99,7 +98,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -109,71 +108,70 @@
// List gets a list of virtual machine images.
//
// filter is the filter to apply on the operation.
-func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int, orderby string) (result VirtualMachineImageResourceList, ae error) {
+func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
-func (client VirtualMachineImagesClient) ListPreparer(location string, publisherName string, offer string, skus string, filter string, top *int, orderby string) (*http.Request, error) {
+func (client VirtualMachineImagesClient) ListPreparer(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "offer": url.QueryEscape(offer),
- "publisherName": url.QueryEscape(publisherName),
- "skus": url.QueryEscape(skus),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "offer": autorest.Encode("path", offer),
+ "publisherName": autorest.Encode("path", publisherName),
+ "skus": autorest.Encode("path", skus),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderby) > 0 {
- queryParameters["$orderby"] = orderby
+ queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -182,21 +180,21 @@
// ListOffers gets a list of virtual machine image offers.
//
-func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result VirtualMachineImageResourceList, ae error) {
+func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListOffersPreparer(location, publisherName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListOffers", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request")
}
resp, err := client.ListOffersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListOffers", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request")
}
result, err = client.ListOffersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListOffers", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request")
}
return
@@ -205,37 +203,36 @@
// ListOffersPreparer prepares the ListOffers request.
func (client VirtualMachineImagesClient) ListOffersPreparer(location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "publisherName": url.QueryEscape(publisherName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "publisherName": autorest.Encode("path", publisherName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListOffersSender sends the ListOffers request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListOffersResponder handles the response to the ListOffers request. The method always
// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -244,21 +241,21 @@
// ListPublishers gets a list of virtual machine image publishers.
//
-func (client VirtualMachineImagesClient) ListPublishers(location string) (result VirtualMachineImageResourceList, ae error) {
+func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPublishersPreparer(location)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListPublishers", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request")
}
resp, err := client.ListPublishersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListPublishers", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request")
}
result, err = client.ListPublishersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListPublishers", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request")
}
return
@@ -267,36 +264,35 @@
// ListPublishersPreparer prepares the ListPublishers request.
func (client VirtualMachineImagesClient) ListPublishersPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListPublishersSender sends the ListPublishers request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListPublishersResponder handles the response to the ListPublishers request. The method always
// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -305,21 +301,21 @@
// ListSkus gets a list of virtual machine image skus.
//
-func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result VirtualMachineImageResourceList, ae error) {
+func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListSkusPreparer(location, publisherName, offer)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListSkus", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request")
}
resp, err := client.ListSkusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListSkus", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request")
}
result, err = client.ListSkusResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineImagesClient", "ListSkus", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request")
}
return
@@ -328,38 +324,37 @@
// ListSkusPreparer prepares the ListSkus request.
func (client VirtualMachineImagesClient) ListSkusPreparer(location string, publisherName string, offer string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "offer": url.QueryEscape(offer),
- "publisherName": url.QueryEscape(publisherName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "offer": autorest.Encode("path", offer),
+ "publisherName": autorest.Encode("path", publisherName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSkusSender sends the ListSkus request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSkusResponder handles the response to the ListSkus request. The method always
// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result VirtualMachineImageResourceList, err error) {
+func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineScaleSetsClient is the the Compute Management Client.
@@ -41,129 +41,138 @@
return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// CreateOrUpdate the operation to create or update a virtual machine scale
-// set.
+// CreateOrUpdate allows you to create or update a virtual machine scale set
+// by providing parameters or a path to pre-configured parameter file. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. name is parameters
// supplied to the Create Virtual Machine Scale Set operation. parameters is
// parameters supplied to the Create Virtual Machine Scale Set operation.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSet, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
+func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters VirtualMachineScaleSet) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) {
+func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// Deallocate the operation to deallocate virtual machines in a virtual
-// machine scale set.
+// Deallocate allows you to deallocate virtual machines in a virtual machine
+// scale set. Shuts down the virtual machines and releases the compute
+// resources. You are not billed for the compute resources that this virtual
+// machine scale set uses. This method may poll for completion. Polling can
+// be canceled by passing the cancel channel argument. The channel will be
+// used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result autorest.Response, ae error) {
- req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Deallocate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request")
}
resp, err := client.DeallocateSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Deallocate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", resp, "Failure sending request")
}
result, err = client.DeallocateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Deallocate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", resp, "Failure responding to request")
}
return
}
// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachineScaleSetsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
autorest.WithJSON(vmInstanceIDs))
}
- return preparer.Prepare(&http.Request{})
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeallocateSender sends the Deallocate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeallocateResponder handles the response to the Deallocate request. The method always
@@ -172,61 +181,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Delete the operation to delete a virtual machine scale set.
+// Delete allows you to delete a virtual machine scale set. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
-func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmScaleSetName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName)
+func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualMachineScaleSetsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK, http.StatusNoContent)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -235,64 +248,68 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
-// DeleteInstances the operation to delete virtual machines in a virtual
-// machine scale set.
+// DeleteInstances allows you to delete virtual machines in a virtual machine
+// scale set. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result autorest.Response, ae error) {
- req, err := client.DeleteInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "DeleteInstances", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request")
}
resp, err := client.DeleteInstancesSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "DeleteInstances", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", resp, "Failure sending request")
}
result, err = client.DeleteInstancesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "DeleteInstances", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", resp, "Failure responding to request")
}
return
}
// DeleteInstancesPreparer prepares the DeleteInstances request.
-func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters),
autorest.WithJSON(vmInstanceIDs),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteInstancesSender sends the DeleteInstances request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always
@@ -301,31 +318,31 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Get the operation to get a virtual machine scale set.
+// Get display information about a virtual machine scale set.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
-func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSet, ae error) {
+func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSet, err error) {
req, err := client.GetPreparer(resourceGroupName, vmScaleSetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request")
}
return
@@ -334,28 +351,27 @@
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetsClient) GetPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -364,33 +380,32 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetInstanceView the operation to get a virtual machine scale set instance
-// view.
+// GetInstanceView displays status of a virtual machine scale set instance.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
-func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetInstanceView, ae error) {
+func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) {
req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "GetInstanceView", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request")
}
resp, err := client.GetInstanceViewSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "GetInstanceView", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request")
}
result, err = client.GetInstanceViewResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "GetInstanceView", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request")
}
return
@@ -399,28 +414,27 @@
// GetInstanceViewPreparer prepares the GetInstanceView request.
func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetInstanceViewSender sends the GetInstanceView request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always
@@ -429,32 +443,31 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// List the operation to list virtual machine scale sets under a resource
-// group.
+// List lists all virtual machine scale sets under a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, ae error) {
+func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request")
}
return
@@ -463,27 +476,26 @@
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -492,32 +504,56 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListAll gets the list of Virtual Machine Scale Sets in the subscription.
-// Use nextLink property in the response to get the next page of Virtual
-// Machine Scale Sets. Do this till nextLink is not null to fetch all the
-// Virtual Machine Scale Sets.
-func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, ae error) {
+// ListNextResults retrieves the next set of results, if any.
+func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) {
+ req, err := lastResults.VirtualMachineScaleSetListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAll lists all Virtual Machine Scale Sets in the subscription. Use
+// nextLink property in the response to get the next page of Virtual Machine
+// Scale Sets. Do this till nextLink is not null to fetch all the Virtual
+// Machine Scale Sets.
+func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -526,26 +562,25 @@
// ListAllPreparer prepares the ListAll request.
func (client VirtualMachineScaleSetsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -554,7 +589,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -562,10 +597,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, ae error) {
+func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) {
req, err := lastResults.VirtualMachineScaleSetListWithLinkResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -574,37 +609,38 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to next results request request")
}
return
}
-// ListSkus the operation to list available skus for a virtual machine scale
-// set.
+// ListSkus displays available skus for your virtual machine scale set
+// including the minimum and maximum vm instances allowed for a particular
+// sku.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
-func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetListSkusResult, ae error) {
+func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetListSkusResult, err error) {
req, err := client.ListSkusPreparer(resourceGroupName, vmScaleSetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListSkus", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request")
}
resp, err := client.ListSkusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListSkus", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request")
}
result, err = client.ListSkusResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "ListSkus", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request")
}
return
@@ -613,28 +649,27 @@
// ListSkusPreparer prepares the ListSkus request.
func (client VirtualMachineScaleSetsClient) ListSkusPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSkusSender sends the ListSkus request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSkusResponder handles the response to the ListSkus request. The method always
@@ -643,69 +678,98 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// PowerOff the operation to power off (stop) virtual machines in a virtual
-// machine scale set.
+// ListSkusNextResults retrieves the next set of results, if any.
+func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) {
+ req, err := lastResults.VirtualMachineScaleSetListSkusResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSkusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListSkusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PowerOff allows you to power off (stop) virtual machines in a virtual
+// machine scale set. Note that resources are still attached and you are
+// getting charged for the resources. Use deallocate to release resources.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result autorest.Response, ae error) {
- req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "PowerOff", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request")
}
resp, err := client.PowerOffSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "PowerOff", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", resp, "Failure sending request")
}
result, err = client.PowerOffResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "PowerOff", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", resp, "Failure responding to request")
}
return
}
// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachineScaleSetsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
autorest.WithJSON(vmInstanceIDs))
}
- return preparer.Prepare(&http.Request{})
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PowerOffSender sends the PowerOff request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// PowerOffResponder handles the response to the PowerOff request. The method always
@@ -714,68 +778,139 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Reimage allows you to re-image(update the version of the installed
+// operating system) virtual machines in a virtual machine scale set. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. vmScaleSetName is the
+// name of the virtual machine scale set.
+func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ReimageSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", resp, "Failure sending request")
+ }
+
+ result, err = client.ReimageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ReimagePreparer prepares the Reimage request.
+func (client VirtualMachineScaleSetsClient) ReimagePreparer(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ReimageSender sends the Reimage request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ReimageResponder handles the response to the Reimage request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Restart the operation to restart virtual machines in a virtual machine
-// scale set.
+// Restart allows you to restart virtual machines in a virtual machine scale
+// set. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result autorest.Response, ae error) {
- req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Restart", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request")
}
resp, err := client.RestartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Restart", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", resp, "Failure sending request")
}
result, err = client.RestartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Restart", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", resp, "Failure responding to request")
}
return
}
// RestartPreparer prepares the Restart request.
-func (client VirtualMachineScaleSetsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
autorest.WithJSON(vmInstanceIDs))
}
- return preparer.Prepare(&http.Request{})
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestartSender sends the Restart request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RestartResponder handles the response to the Restart request. The method always
@@ -784,68 +919,71 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Start the operation to start virtual machines in a virtual machine scale
-// set.
+// Start allows you to start virtual machines in a virtual machine scale set.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result autorest.Response, ae error) {
- req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Start", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request")
}
resp, err := client.StartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Start", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", resp, "Failure sending request")
}
result, err = client.StartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "Start", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", resp, "Failure responding to request")
}
return
}
// StartPreparer prepares the Start request.
-func (client VirtualMachineScaleSetsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
autorest.WithJSON(vmInstanceIDs))
}
- return preparer.Prepare(&http.Request{})
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// StartResponder handles the response to the Start request. The method always
@@ -854,64 +992,68 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// UpdateInstances the operation to manually upgrade virtual machines in a
-// virtual machine scale set.
+// UpdateInstances allows you to manually upgrade virtual machines in a
+// virtual machine scale set. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of
// virtual machine scale set instance IDs.
-func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result autorest.Response, ae error) {
- req, err := client.UpdateInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs)
+func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.UpdateInstancesPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "UpdateInstances", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request")
}
resp, err := client.UpdateInstancesSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "UpdateInstances", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", resp, "Failure sending request")
}
result, err = client.UpdateInstancesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetsClient", "UpdateInstances", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", resp, "Failure responding to request")
}
return
}
// UpdateInstancesPreparer prepares the UpdateInstances request.
-func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) {
+func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters),
autorest.WithJSON(vmInstanceIDs),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateInstancesSender sends the UpdateInstances request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always
@@ -920,7 +1062,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineScaleSetVMsClient is the the Compute Management Client.
@@ -41,57 +41,63 @@
return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// Deallocate the operation to deallocate a virtual machine scale set.
+// Deallocate allows you to deallocate a virtual machine scale set virtual
+// machine. Shuts down the virtual machine and releases the compute
+// resources. You are not billed for the compute resources that this virtual
+// machine uses. This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, vmScaleSetName string, instanceID string) (result autorest.Response, ae error) {
- req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, instanceID)
+func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Deallocate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request")
}
resp, err := client.DeallocateSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Deallocate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", resp, "Failure sending request")
}
result, err = client.DeallocateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Deallocate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", resp, "Failure responding to request")
}
return
}
// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
+func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeallocateSender sends the Deallocate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeallocateResponder handles the response to the Deallocate request. The method always
@@ -100,63 +106,67 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Delete the operation to delete a virtual machine scale set.
+// Delete allows you to delete a virtual machine scale set. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, vmScaleSetName string, instanceID string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, instanceID)
+func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualMachineScaleSetVMsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
+func (client VirtualMachineScaleSetVMsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -165,32 +175,32 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
-// Get the operation to get a virtual machine scale set virtual machine.
+// Get displays information about a virtual machine scale set virtual machine.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, ae error) {
+func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
req, err := client.GetPreparer(resourceGroupName, vmScaleSetName, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request")
}
return
@@ -199,29 +209,28 @@
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetVMsClient) GetPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -230,34 +239,34 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetInstanceView the operation to get a virtual machine scale set virtual
+// GetInstanceView displays the status of a virtual machine scale set virtual
// machine.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, ae error) {
+func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) {
req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "GetInstanceView", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request")
}
resp, err := client.GetInstanceViewSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "GetInstanceView", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request")
}
result, err = client.GetInstanceViewResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "GetInstanceView", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request")
}
return
@@ -266,29 +275,28 @@
// GetInstanceViewPreparer prepares the GetInstanceView request.
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetInstanceViewSender sends the GetInstanceView request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always
@@ -297,35 +305,35 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// List the operation to list virtual machine scale sets VMs.
+// List lists all virtual machines in a VM scale sets.
//
// resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set.
// filter is the filter to apply on the operation. selectParameter is the
// list parameters. expand is the expand expression to apply on the
// operation.
-func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, ae error) {
+func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request")
}
return
@@ -334,37 +342,36 @@
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetVMsClient) ListPreparer(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(selectParameter) > 0 {
- queryParameters["$select"] = selectParameter
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
if len(expand) > 0 {
- queryParameters["$expand"] = expand
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -373,64 +380,92 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// PowerOff the operation to power off (stop) a virtual machine scale set.
+// ListNextResults retrieves the next set of results, if any.
+func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) {
+ req, err := lastResults.VirtualMachineScaleSetVMListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PowerOff allows you to power off (stop) a virtual machine in a VM scale
+// set. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, vmScaleSetName string, instanceID string) (result autorest.Response, ae error) {
- req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, instanceID)
+func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "PowerOff", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request")
}
resp, err := client.PowerOffSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "PowerOff", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", resp, "Failure sending request")
}
result, err = client.PowerOffResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "PowerOff", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", resp, "Failure responding to request")
}
return
}
// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
+func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PowerOffSender sends the PowerOff request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// PowerOffResponder handles the response to the PowerOff request. The method always
@@ -439,63 +474,137 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Reimage allows you to re-image(update the version of the installed
+// operating system) a virtual machine scale set instance. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. vmScaleSetName is the
+// name of the virtual machine scale set. instanceID is the instance id of
+// the virtual machine.
+func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ReimageSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", resp, "Failure sending request")
+ }
+
+ result, err = client.ReimageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ReimagePreparer prepares the Reimage request.
+func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ReimageSender sends the Reimage request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ReimageResponder handles the response to the Reimage request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Restart the operation to restart a virtual machine scale set.
+// Restart allows you to restart a virtual machine in a VM scale set. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, vmScaleSetName string, instanceID string) (result autorest.Response, ae error) {
- req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, instanceID)
+func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Restart", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request")
}
resp, err := client.RestartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Restart", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", resp, "Failure sending request")
}
result, err = client.RestartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Restart", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", resp, "Failure responding to request")
}
return
}
// RestartPreparer prepares the Restart request.
-func (client VirtualMachineScaleSetVMsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
+func (client VirtualMachineScaleSetVMsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestartSender sends the Restart request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RestartResponder handles the response to the Restart request. The method always
@@ -504,63 +613,67 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Start the operation to start a virtual machine scale set.
+// Start allows you to start a virtual machine in a VM scale set. This method
+// may poll for completion. Polling can be canceled by passing the cancel
+// channel argument. The channel will be used to cancel polling and any
+// outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
// the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vmScaleSetName string, instanceID string) (result autorest.Response, ae error) {
- req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, instanceID)
+func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Start", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request")
}
resp, err := client.StartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Start", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", resp, "Failure sending request")
}
result, err = client.StartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineScaleSetVMsClient", "Start", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", resp, "Failure responding to request")
}
return
}
// StartPreparer prepares the Start request.
-func (client VirtualMachineScaleSetVMsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
+func (client VirtualMachineScaleSetVMsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instanceId": url.QueryEscape(instanceID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmScaleSetName": url.QueryEscape(vmScaleSetName),
+ "instanceId": autorest.Encode("path", instanceID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// StartResponder handles the response to the Start request. The method always
@@ -569,7 +682,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachinesClient is the the Compute Management Client.
@@ -41,190 +41,201 @@
return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// Capture captures the VM by copying VirtualHardDisks of the VM and outputs a
-// template that can be used to create similar VMs.
+// Capture captures the VM by copying virtual hard disks of the VM and outputs
+// a template that can be used to create similar VMs. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. parameters is parameters supplied to the Capture
// Virtual Machine operation.
-func (client VirtualMachinesClient) Capture(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters) (result VirtualMachineCaptureResult, ae error) {
- req, err := client.CapturePreparer(resourceGroupName, vmName, parameters)
+func (client VirtualMachinesClient) Capture(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CapturePreparer(resourceGroupName, vmName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Capture", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request")
}
resp, err := client.CaptureSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Capture", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", resp, "Failure sending request")
}
result, err = client.CaptureResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Capture", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", resp, "Failure responding to request")
}
return
}
// CapturePreparer prepares the Capture request.
-func (client VirtualMachinesClient) CapturePreparer(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters) (*http.Request, error) {
+func (client VirtualMachinesClient) CapturePreparer(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CaptureSender sends the Capture request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) CaptureSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CaptureResponder handles the response to the Capture request. The method always
// closes the http.Response Body.
-func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) {
+func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// CreateOrUpdate the operation to create or update a virtual machine.
+// CreateOrUpdate the operation to create or update a virtual machine. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. parameters is parameters supplied to the Create
// Virtual Machine operation.
-func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmName string, parameters VirtualMachine) (result VirtualMachine, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, parameters)
+func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, vmName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachinesClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, parameters VirtualMachine) (*http.Request, error) {
+func (client VirtualMachinesClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) {
+func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Deallocate shuts down the Virtual Machine and releases the compute
// resources. You are not billed for the compute resources that this Virtual
-// Machine uses.
+// Machine uses. This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) Deallocate(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
- req, err := client.DeallocatePreparer(resourceGroupName, vmName)
+func (client VirtualMachinesClient) Deallocate(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeallocatePreparer(resourceGroupName, vmName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Deallocate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request")
}
resp, err := client.DeallocateSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Deallocate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", resp, "Failure sending request")
}
result, err = client.DeallocateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Deallocate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", resp, "Failure responding to request")
}
return
}
// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachinesClient) DeallocatePreparer(resourceGroupName string, vmName string) (*http.Request, error) {
+func (client VirtualMachinesClient) DeallocatePreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeallocateSender sends the Deallocate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeallocateResponder handles the response to the Deallocate request. The method always
@@ -233,61 +244,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Delete the operation to delete a virtual machine.
+// Delete the operation to delete a virtual machine. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) Delete(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, vmName)
+func (client VirtualMachinesClient) Delete(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, vmName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualMachinesClient) DeletePreparer(resourceGroupName string, vmName string) (*http.Request, error) {
+func (client VirtualMachinesClient) DeletePreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNoContent)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -296,7 +311,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -306,21 +321,21 @@
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) Generalize(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
+func (client VirtualMachinesClient) Generalize(resourceGroupName string, vmName string) (result autorest.Response, err error) {
req, err := client.GeneralizePreparer(resourceGroupName, vmName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Generalize", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request")
}
resp, err := client.GeneralizeSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Generalize", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request")
}
result, err = client.GeneralizeResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Generalize", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request")
}
return
@@ -329,28 +344,27 @@
// GeneralizePreparer prepares the Generalize request.
func (client VirtualMachinesClient) GeneralizePreparer(resourceGroupName string, vmName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GeneralizeSender sends the Generalize request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GeneralizeResponder handles the response to the Generalize request. The method always
@@ -359,7 +373,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -369,55 +383,54 @@
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. expand is the expand expression to apply on the
-// operation.
-func (client VirtualMachinesClient) Get(resourceGroupName string, vmName string, expand string) (result VirtualMachine, ae error) {
+// operation. Possible values include: 'instanceView'
+func (client VirtualMachinesClient) Get(resourceGroupName string, vmName string, expand InstanceViewTypes) (result VirtualMachine, err error) {
req, err := client.GetPreparer(resourceGroupName, vmName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client VirtualMachinesClient) GetPreparer(resourceGroupName string, vmName string, expand string) (*http.Request, error) {
+func (client VirtualMachinesClient) GetPreparer(resourceGroupName string, vmName string, expand InstanceViewTypes) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- if len(expand) > 0 {
- queryParameters["$expand"] = expand
+ if len(string(expand)) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -426,7 +439,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -436,21 +449,21 @@
// List the operation to list virtual machines under a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, ae error) {
+func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request")
}
return
@@ -459,27 +472,26 @@
// ListPreparer prepares the List request.
func (client VirtualMachinesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -488,7 +500,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -496,10 +508,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, ae error) {
+func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
req, err := lastResults.VirtualMachineListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -508,12 +520,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -522,21 +534,21 @@
// ListAll gets the list of Virtual Machines in the subscription. Use nextLink
// property in the response to get the next page of Virtual Machines. Do this
// till nextLink is not null to fetch all the Virtual Machines.
-func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, ae error) {
+func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -545,26 +557,25 @@
// ListAllPreparer prepares the ListAll request.
func (client VirtualMachinesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -573,7 +584,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -581,10 +592,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, ae error) {
+func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
req, err := lastResults.VirtualMachineListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -593,37 +604,37 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to next results request request")
}
return
}
-// ListAvailableSizes lists virtual-machine-sizes available to be used for a
-// virtual machine.
+// ListAvailableSizes lists all available virtual machine sizes it can be
+// resized to for a virtual machine.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) ListAvailableSizes(resourceGroupName string, vmName string) (result VirtualMachineSizeListResult, ae error) {
+func (client VirtualMachinesClient) ListAvailableSizes(resourceGroupName string, vmName string) (result VirtualMachineSizeListResult, err error) {
req, err := client.ListAvailableSizesPreparer(resourceGroupName, vmName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAvailableSizes", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request")
}
resp, err := client.ListAvailableSizesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAvailableSizes", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request")
}
result, err = client.ListAvailableSizesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "ListAvailableSizes", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request")
}
return
@@ -632,28 +643,27 @@
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
func (client VirtualMachinesClient) ListAvailableSizesPreparer(resourceGroupName string, vmName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
@@ -662,62 +672,66 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// PowerOff the operation to power off (stop) a virtual machine.
+// PowerOff the operation to power off (stop) a virtual machine. This method
+// may poll for completion. Polling can be canceled by passing the cancel
+// channel argument. The channel will be used to cancel polling and any
+// outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) PowerOff(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
- req, err := client.PowerOffPreparer(resourceGroupName, vmName)
+func (client VirtualMachinesClient) PowerOff(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.PowerOffPreparer(resourceGroupName, vmName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "PowerOff", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request")
}
resp, err := client.PowerOffSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "PowerOff", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", resp, "Failure sending request")
}
result, err = client.PowerOffResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "PowerOff", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", resp, "Failure responding to request")
}
return
}
// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachinesClient) PowerOffPreparer(resourceGroupName string, vmName string) (*http.Request, error) {
+func (client VirtualMachinesClient) PowerOffPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PowerOffSender sends the PowerOff request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// PowerOffResponder handles the response to the PowerOff request. The method always
@@ -726,61 +740,132 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Restart the operation to restart a virtual machine.
+// Redeploy the operation to redeploy a virtual machine. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) Restart(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
- req, err := client.RestartPreparer(resourceGroupName, vmName)
+func (client VirtualMachinesClient) Redeploy(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RedeployPreparer(resourceGroupName, vmName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RedeploySender(req)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Restart", "Failure preparing request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", resp, "Failure sending request")
+ }
+
+ result, err = client.RedeployResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RedeployPreparer prepares the Redeploy request.
+func (client VirtualMachinesClient) RedeployPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// RedeploySender sends the Redeploy request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachinesClient) RedeploySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// RedeployResponder handles the response to the Redeploy request. The method always
+// closes the http.Response Body.
+func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Restart the operation to restart a virtual machine. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. vmName is the name of
+// the virtual machine.
+func (client VirtualMachinesClient) Restart(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RestartPreparer(resourceGroupName, vmName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request")
}
resp, err := client.RestartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Restart", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", resp, "Failure sending request")
}
result, err = client.RestartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Restart", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", resp, "Failure responding to request")
}
return
}
// RestartPreparer prepares the Restart request.
-func (client VirtualMachinesClient) RestartPreparer(resourceGroupName string, vmName string) (*http.Request, error) {
+func (client VirtualMachinesClient) RestartPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestartSender sends the Restart request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) RestartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RestartResponder handles the response to the Restart request. The method always
@@ -789,61 +874,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Start the operation to start a virtual machine.
+// Start the operation to start a virtual machine. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
-func (client VirtualMachinesClient) Start(resourceGroupName string, vmName string) (result autorest.Response, ae error) {
- req, err := client.StartPreparer(resourceGroupName, vmName)
+func (client VirtualMachinesClient) Start(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(resourceGroupName, vmName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Start", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request")
}
resp, err := client.StartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Start", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", resp, "Failure sending request")
}
result, err = client.StartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachinesClient", "Start", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", resp, "Failure responding to request")
}
return
}
// StartPreparer prepares the Start request.
-func (client VirtualMachinesClient) StartPreparer(resourceGroupName string, vmName string) (*http.Request, error) {
+func (client VirtualMachinesClient) StartPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vmName": url.QueryEscape(vmName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) StartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// StartResponder handles the response to the Start request. The method always
@@ -852,7 +941,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// VirtualMachineSizesClient is the the Compute Management Client.
@@ -41,24 +41,25 @@
return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// List lists virtual-machine-sizes available in a location for a subscription.
+// List lists all available virtual machine sizes for a subscription in a
+// location.
//
// location is the location upon which virtual-machine-sizes is queried.
-func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, ae error) {
+func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) {
req, err := client.ListPreparer(location)
if err != nil {
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineSizesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute/VirtualMachineSizesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "compute/VirtualMachineSizesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request")
}
return
@@ -67,27 +68,26 @@
// ListPreparer prepares the List request.
func (client VirtualMachineSizesClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -96,7 +96,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,278 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ArtifactOperationsClient is the the DevTest Labs Client.
+type ArtifactOperationsClient struct {
+ ManagementClient
+}
+
+// NewArtifactOperationsClient creates an instance of the
+// ArtifactOperationsClient client.
+func NewArtifactOperationsClient(subscriptionID string) ArtifactOperationsClient {
+ return NewArtifactOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewArtifactOperationsClientWithBaseURI creates an instance of the
+// ArtifactOperationsClient client.
+func NewArtifactOperationsClientWithBaseURI(baseURI string, subscriptionID string) ArtifactOperationsClient {
+ return ArtifactOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// GenerateArmTemplate generates an ARM template for the given artifact,
+// uploads the required files to a storage account, and validates the
+// generated artifact.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. artifactSourceName is the name of the artifact source. name is
+// the name of the artifact.
+func (client ArtifactOperationsClient) GenerateArmTemplate(resourceGroupName string, labName string, artifactSourceName string, name string, generateArmTemplateRequest GenerateArmTemplateRequest) (result ArmTemplateInfo, err error) {
+ req, err := client.GenerateArmTemplatePreparer(resourceGroupName, labName, artifactSourceName, name, generateArmTemplateRequest)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GenerateArmTemplate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GenerateArmTemplateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GenerateArmTemplate", resp, "Failure sending request")
+ }
+
+ result, err = client.GenerateArmTemplateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GenerateArmTemplate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GenerateArmTemplatePreparer prepares the GenerateArmTemplate request.
+func (client ArtifactOperationsClient) GenerateArmTemplatePreparer(resourceGroupName string, labName string, artifactSourceName string, name string, generateArmTemplateRequest GenerateArmTemplateRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "artifactSourceName": autorest.Encode("path", artifactSourceName),
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate", pathParameters),
+ autorest.WithJSON(generateArmTemplateRequest),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GenerateArmTemplateSender sends the GenerateArmTemplate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactOperationsClient) GenerateArmTemplateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GenerateArmTemplateResponder handles the response to the GenerateArmTemplate request. The method always
+// closes the http.Response Body.
+func (client ArtifactOperationsClient) GenerateArmTemplateResponder(resp *http.Response) (result ArmTemplateInfo, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetResource get artifact.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. artifactSourceName is the name of the artifact source. name is
+// the name of the artifact.
+func (client ArtifactOperationsClient) GetResource(resourceGroupName string, labName string, artifactSourceName string, name string) (result Artifact, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, artifactSourceName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client ArtifactOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, artifactSourceName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "artifactSourceName": autorest.Encode("path", artifactSourceName),
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client ArtifactOperationsClient) GetResourceResponder(resp *http.Response) (result Artifact, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list artifacts in a given artifact source.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. artifactSourceName is the name of the artifact source. filter is
+// the filter to apply on the operation. top is the maximum number of
+// resources to return from the operation. orderBy is the ordering expression
+// for the results, using OData notation.
+func (client ArtifactOperationsClient) List(resourceGroupName string, labName string, artifactSourceName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationArtifact, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, artifactSourceName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ArtifactOperationsClient) ListPreparer(resourceGroupName string, labName string, artifactSourceName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "artifactSourceName": autorest.Encode("path", artifactSourceName),
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ArtifactOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationArtifact, 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 ArtifactOperationsClient) ListNextResults(lastResults ResponseWithContinuationArtifact) (result ResponseWithContinuationArtifact, err error) {
+ req, err := lastResults.ResponseWithContinuationArtifactPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactsourceoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactsourceoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactsourceoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/artifactsourceoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,399 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ArtifactSourceOperationsClient is the the DevTest Labs Client.
+type ArtifactSourceOperationsClient struct {
+ ManagementClient
+}
+
+// NewArtifactSourceOperationsClient creates an instance of the
+// ArtifactSourceOperationsClient client.
+func NewArtifactSourceOperationsClient(subscriptionID string) ArtifactSourceOperationsClient {
+ return NewArtifactSourceOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewArtifactSourceOperationsClientWithBaseURI creates an instance of the
+// ArtifactSourceOperationsClient client.
+func NewArtifactSourceOperationsClientWithBaseURI(baseURI string, subscriptionID string) ArtifactSourceOperationsClient {
+ return ArtifactSourceOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing artifact source.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the artifact source.
+func (client ArtifactSourceOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, artifactSource ArtifactSource) (result ArtifactSource, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, artifactSource)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client ArtifactSourceOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, artifactSource ArtifactSource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}", pathParameters),
+ autorest.WithJSON(artifactSource),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactSourceOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client ArtifactSourceOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result ArtifactSource, 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
+}
+
+// DeleteResource delete artifact source.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the artifact source.
+func (client ArtifactSourceOperationsClient) DeleteResource(resourceGroupName string, labName string, name string) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client ArtifactSourceOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactSourceOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client ArtifactSourceOperationsClient) DeleteResourceResponder(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
+}
+
+// GetResource get artifact source.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the artifact source.
+func (client ArtifactSourceOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result ArtifactSource, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client ArtifactSourceOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactSourceOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client ArtifactSourceOperationsClient) GetResourceResponder(resp *http.Response) (result ArtifactSource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list artifact sources in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client ArtifactSourceOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationArtifactSource, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ArtifactSourceOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactSourceOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ArtifactSourceOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationArtifactSource, 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 ArtifactSourceOperationsClient) ListNextResults(lastResults ResponseWithContinuationArtifactSource) (result ResponseWithContinuationArtifactSource, err error) {
+ req, err := lastResults.ResponseWithContinuationArtifactSourcePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of artifact sources.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the artifact source.
+func (client ArtifactSourceOperationsClient) PatchResource(resourceGroupName string, labName string, name string, artifactSource ArtifactSource) (result ArtifactSource, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, labName, name, artifactSource)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ArtifactSourceOperationsClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client ArtifactSourceOperationsClient) PatchResourcePreparer(resourceGroupName string, labName string, name string, artifactSource ArtifactSource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{name}", pathParameters),
+ autorest.WithJSON(artifactSource),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ArtifactSourceOperationsClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client ArtifactSourceOperationsClient) PatchResourceResponder(resp *http.Response) (result ArtifactSource, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,58 @@
+// Package devtestlabs implements the Azure ARM Devtestlabs service API
+// version 2016-05-15.
+//
+// The DevTest Labs Client.
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Devtestlabs
+ APIVersion = "2016-05-15"
+
+ // DefaultBaseURI is the default URI used for the service Devtestlabs
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Devtestlabs.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/costoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/costoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/costoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/costoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,106 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// CostOperationsClient is the the DevTest Labs Client.
+type CostOperationsClient struct {
+ ManagementClient
+}
+
+// NewCostOperationsClient creates an instance of the CostOperationsClient
+// client.
+func NewCostOperationsClient(subscriptionID string) CostOperationsClient {
+ return NewCostOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCostOperationsClientWithBaseURI creates an instance of the
+// CostOperationsClient client.
+func NewCostOperationsClientWithBaseURI(baseURI string, subscriptionID string) CostOperationsClient {
+ return CostOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// GetResource get cost.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the cost.
+func (client CostOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result Cost, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CostOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CostOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CostOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client CostOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client CostOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client CostOperationsClient) GetResourceResponder(resp *http.Response) (result Cost, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/customimageoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/customimageoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/customimageoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/customimageoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,343 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// CustomImageOperationsClient is the the DevTest Labs Client.
+type CustomImageOperationsClient struct {
+ ManagementClient
+}
+
+// NewCustomImageOperationsClient creates an instance of the
+// CustomImageOperationsClient client.
+func NewCustomImageOperationsClient(subscriptionID string) CustomImageOperationsClient {
+ return NewCustomImageOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCustomImageOperationsClientWithBaseURI creates an instance of the
+// CustomImageOperationsClient client.
+func NewCustomImageOperationsClientWithBaseURI(baseURI string, subscriptionID string) CustomImageOperationsClient {
+ return CustomImageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing custom image. This
+// operation can take a while to complete. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the custom image.
+func (client CustomImageOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, customImage CustomImage, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, customImage, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client CustomImageOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, customImage CustomImage, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}", pathParameters),
+ autorest.WithJSON(customImage),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomImageOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client CustomImageOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteResource delete custom image. This operation can take a while to
+// complete. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the custom image.
+func (client CustomImageOperationsClient) DeleteResource(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client CustomImageOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomImageOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client CustomImageOperationsClient) DeleteResourceResponder(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
+}
+
+// GetResource get custom image.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the custom image.
+func (client CustomImageOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result CustomImage, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client CustomImageOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomImageOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client CustomImageOperationsClient) GetResourceResponder(resp *http.Response) (result CustomImage, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list custom images in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client CustomImageOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationCustomImage, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client CustomImageOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client CustomImageOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client CustomImageOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationCustomImage, 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 CustomImageOperationsClient) ListNextResults(lastResults ResponseWithContinuationCustomImage) (result ResponseWithContinuationCustomImage, err error) {
+ req, err := lastResults.ResponseWithContinuationCustomImagePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.CustomImageOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/formulaoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/formulaoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/formulaoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/formulaoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,338 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// FormulaOperationsClient is the the DevTest Labs Client.
+type FormulaOperationsClient struct {
+ ManagementClient
+}
+
+// NewFormulaOperationsClient creates an instance of the
+// FormulaOperationsClient client.
+func NewFormulaOperationsClient(subscriptionID string) FormulaOperationsClient {
+ return NewFormulaOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewFormulaOperationsClientWithBaseURI creates an instance of the
+// FormulaOperationsClient client.
+func NewFormulaOperationsClientWithBaseURI(baseURI string, subscriptionID string) FormulaOperationsClient {
+ return FormulaOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing Formula. This
+// operation can take a while to complete. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the formula.
+func (client FormulaOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, formula Formula, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, formula, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client FormulaOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, formula Formula, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}", pathParameters),
+ autorest.WithJSON(formula),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client FormulaOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client FormulaOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteResource delete formula.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the formula.
+func (client FormulaOperationsClient) DeleteResource(resourceGroupName string, labName string, name string) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client FormulaOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client FormulaOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client FormulaOperationsClient) DeleteResourceResponder(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
+}
+
+// GetResource get formula.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the formula.
+func (client FormulaOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result Formula, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client FormulaOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client FormulaOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client FormulaOperationsClient) GetResourceResponder(resp *http.Response) (result Formula, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list formulas in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client FormulaOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationFormula, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client FormulaOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client FormulaOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client FormulaOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationFormula, 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 FormulaOperationsClient) ListNextResults(lastResults ResponseWithContinuationFormula) (result ResponseWithContinuationFormula, err error) {
+ req, err := lastResults.ResponseWithContinuationFormulaPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.FormulaOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/galleryimageoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/galleryimageoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/galleryimageoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/galleryimageoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,140 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// GalleryImageOperationsClient is the the DevTest Labs Client.
+type GalleryImageOperationsClient struct {
+ ManagementClient
+}
+
+// NewGalleryImageOperationsClient creates an instance of the
+// GalleryImageOperationsClient client.
+func NewGalleryImageOperationsClient(subscriptionID string) GalleryImageOperationsClient {
+ return NewGalleryImageOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewGalleryImageOperationsClientWithBaseURI creates an instance of the
+// GalleryImageOperationsClient client.
+func NewGalleryImageOperationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageOperationsClient {
+ return GalleryImageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List list gallery images in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client GalleryImageOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationGalleryImage, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client GalleryImageOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client GalleryImageOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client GalleryImageOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationGalleryImage, 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 GalleryImageOperationsClient) ListNextResults(lastResults ResponseWithContinuationGalleryImage) (result ResponseWithContinuationGalleryImage, err error) {
+ req, err := lastResults.ResponseWithContinuationGalleryImagePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.GalleryImageOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/laboperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/laboperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/laboperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/laboperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,719 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// LabOperationsClient is the the DevTest Labs Client.
+type LabOperationsClient struct {
+ ManagementClient
+}
+
+// NewLabOperationsClient creates an instance of the LabOperationsClient
+// client.
+func NewLabOperationsClient(subscriptionID string) LabOperationsClient {
+ return NewLabOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewLabOperationsClientWithBaseURI creates an instance of the
+// LabOperationsClient client.
+func NewLabOperationsClientWithBaseURI(baseURI string, subscriptionID string) LabOperationsClient {
+ return LabOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateEnvironment create virtual machines in a Lab. This operation can take
+// a while to complete. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) CreateEnvironment(resourceGroupName string, name string, labVirtualMachine LabVirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateEnvironmentPreparer(resourceGroupName, name, labVirtualMachine, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateEnvironment", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateEnvironmentSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateEnvironment", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateEnvironmentResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateEnvironment", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateEnvironmentPreparer prepares the CreateEnvironment request.
+func (client LabOperationsClient) CreateEnvironmentPreparer(resourceGroupName string, name string, labVirtualMachine LabVirtualMachine, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment", pathParameters),
+ autorest.WithJSON(labVirtualMachine),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateEnvironmentSender sends the CreateEnvironment request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) CreateEnvironmentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateEnvironmentResponder handles the response to the CreateEnvironment request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) CreateEnvironmentResponder(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
+}
+
+// CreateOrUpdateResource create or replace an existing Lab. This operation
+// can take a while to complete. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) CreateOrUpdateResource(resourceGroupName string, name string, lab Lab, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, name, lab, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client LabOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, name string, lab Lab, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}", pathParameters),
+ autorest.WithJSON(lab),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteResource delete lab. This operation can take a while to complete.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) DeleteResource(resourceGroupName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client LabOperationsClient) DeleteResourcePreparer(resourceGroupName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) DeleteResourceResponder(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
+}
+
+// GenerateUploadURI generate a URI for uploading custom disk images to a Lab.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) GenerateUploadURI(resourceGroupName string, name string, generateUploadURIParameter GenerateUploadURIParameter) (result GenerateUploadURIResponse, err error) {
+ req, err := client.GenerateUploadURIPreparer(resourceGroupName, name, generateUploadURIParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GenerateUploadURI", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GenerateUploadURISender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GenerateUploadURI", resp, "Failure sending request")
+ }
+
+ result, err = client.GenerateUploadURIResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GenerateUploadURI", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GenerateUploadURIPreparer prepares the GenerateUploadURI request.
+func (client LabOperationsClient) GenerateUploadURIPreparer(resourceGroupName string, name string, generateUploadURIParameter GenerateUploadURIParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri", pathParameters),
+ autorest.WithJSON(generateUploadURIParameter),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GenerateUploadURISender sends the GenerateUploadURI request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) GenerateUploadURISender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GenerateUploadURIResponder handles the response to the GenerateUploadURI request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) GenerateUploadURIResponder(resp *http.Response) (result GenerateUploadURIResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetResource get lab.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) GetResource(resourceGroupName string, name string) (result Lab, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client LabOperationsClient) GetResourcePreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) GetResourceResponder(resp *http.Response) (result Lab, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup list labs in a resource group.
+//
+// resourceGroupName is the name of the resource group. filter is the filter
+// to apply on the operation. top is the maximum number of resources to
+// return from the operation. orderBy is the ordering expression for the
+// results, using OData notation.
+func (client LabOperationsClient) ListByResourceGroup(resourceGroupName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationLab, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client LabOperationsClient) ListByResourceGroupPreparer(resourceGroupName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) ListByResourceGroupResponder(resp *http.Response) (result ResponseWithContinuationLab, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroupNextResults retrieves the next set of results, if any.
+func (client LabOperationsClient) ListByResourceGroupNextResults(lastResults ResponseWithContinuationLab) (result ResponseWithContinuationLab, err error) {
+ req, err := lastResults.ResponseWithContinuationLabPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListBySubscription list labs in a subscription.
+//
+// filter is the filter to apply on the operation. top is the maximum number
+// of resources to return from the operation. orderBy is the ordering
+// expression for the results, using OData notation.
+func (client LabOperationsClient) ListBySubscription(filter string, top *int32, orderBy string) (result ResponseWithContinuationLab, err error) {
+ req, err := client.ListBySubscriptionPreparer(filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", resp, "Failure sending request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client LabOperationsClient) ListBySubscriptionPreparer(filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/labs", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) ListBySubscriptionResponder(resp *http.Response) (result ResponseWithContinuationLab, 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 LabOperationsClient) ListBySubscriptionNextResults(lastResults ResponseWithContinuationLab) (result ResponseWithContinuationLab, err error) {
+ req, err := lastResults.ResponseWithContinuationLabPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListBySubscription", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListVhds list disk images available for custom image creation.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) ListVhds(resourceGroupName string, name string) (result ResponseWithContinuationLabVhd, err error) {
+ req, err := client.ListVhdsPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListVhdsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", resp, "Failure sending request")
+ }
+
+ result, err = client.ListVhdsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListVhdsPreparer prepares the ListVhds request.
+func (client LabOperationsClient) ListVhdsPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListVhdsSender sends the ListVhds request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) ListVhdsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListVhdsResponder handles the response to the ListVhds request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) ListVhdsResponder(resp *http.Response) (result ResponseWithContinuationLabVhd, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListVhdsNextResults retrieves the next set of results, if any.
+func (client LabOperationsClient) ListVhdsNextResults(lastResults ResponseWithContinuationLabVhd) (result ResponseWithContinuationLabVhd, err error) {
+ req, err := lastResults.ResponseWithContinuationLabVhdPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListVhdsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListVhdsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "ListVhds", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of labs.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the lab.
+func (client LabOperationsClient) PatchResource(resourceGroupName string, name string, lab Lab) (result Lab, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, name, lab)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.LabOperationsClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client LabOperationsClient) PatchResourcePreparer(resourceGroupName string, name string, lab Lab) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}", pathParameters),
+ autorest.WithJSON(lab),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client LabOperationsClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client LabOperationsClient) PatchResourceResponder(resp *http.Response) (result Lab, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,859 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// CustomImageOsType enumerates the values for custom image os type.
+type CustomImageOsType string
+
+const (
+ // Linux specifies the linux state for custom image os type.
+ Linux CustomImageOsType = "Linux"
+ // None specifies the none state for custom image os type.
+ None CustomImageOsType = "None"
+ // Windows specifies the windows state for custom image os type.
+ Windows CustomImageOsType = "Windows"
+)
+
+// EnableStatus enumerates the values for enable status.
+type EnableStatus string
+
+const (
+ // Disabled specifies the disabled state for enable status.
+ Disabled EnableStatus = "Disabled"
+ // Enabled specifies the enabled state for enable status.
+ Enabled EnableStatus = "Enabled"
+)
+
+// LabCostType enumerates the values for lab cost type.
+type LabCostType string
+
+const (
+ // Projected specifies the projected state for lab cost type.
+ Projected LabCostType = "Projected"
+ // Reported specifies the reported state for lab cost type.
+ Reported LabCostType = "Reported"
+ // Unavailable specifies the unavailable state for lab cost type.
+ Unavailable LabCostType = "Unavailable"
+)
+
+// LabStorageType enumerates the values for lab storage type.
+type LabStorageType string
+
+const (
+ // Premium specifies the premium state for lab storage type.
+ Premium LabStorageType = "Premium"
+ // Standard specifies the standard state for lab storage type.
+ Standard LabStorageType = "Standard"
+)
+
+// LinuxOsState enumerates the values for linux os state.
+type LinuxOsState string
+
+const (
+ // DeprovisionApplied specifies the deprovision applied state for linux os
+ // state.
+ DeprovisionApplied LinuxOsState = "DeprovisionApplied"
+ // DeprovisionRequested specifies the deprovision requested state for
+ // linux os state.
+ DeprovisionRequested LinuxOsState = "DeprovisionRequested"
+ // NonDeprovisioned specifies the non deprovisioned state for linux os
+ // state.
+ NonDeprovisioned LinuxOsState = "NonDeprovisioned"
+)
+
+// PolicyEvaluatorType enumerates the values for policy evaluator type.
+type PolicyEvaluatorType string
+
+const (
+ // AllowedValuesPolicy specifies the allowed values policy state for
+ // policy evaluator type.
+ AllowedValuesPolicy PolicyEvaluatorType = "AllowedValuesPolicy"
+ // MaxValuePolicy specifies the max value policy state for policy
+ // evaluator type.
+ MaxValuePolicy PolicyEvaluatorType = "MaxValuePolicy"
+)
+
+// PolicyFactName enumerates the values for policy fact name.
+type PolicyFactName string
+
+const (
+ // PolicyFactNameGalleryImage specifies the policy fact name gallery image
+ // state for policy fact name.
+ PolicyFactNameGalleryImage PolicyFactName = "GalleryImage"
+ // PolicyFactNameLabVMCount specifies the policy fact name lab vm count
+ // state for policy fact name.
+ PolicyFactNameLabVMCount PolicyFactName = "LabVmCount"
+ // PolicyFactNameLabVMSize specifies the policy fact name lab vm size
+ // state for policy fact name.
+ PolicyFactNameLabVMSize PolicyFactName = "LabVmSize"
+ // PolicyFactNameUserOwnedLabVMCount specifies the policy fact name user
+ // owned lab vm count state for policy fact name.
+ PolicyFactNameUserOwnedLabVMCount PolicyFactName = "UserOwnedLabVmCount"
+ // PolicyFactNameUserOwnedLabVMCountInSubnet specifies the policy fact
+ // name user owned lab vm count in subnet state for policy fact name.
+ PolicyFactNameUserOwnedLabVMCountInSubnet PolicyFactName = "UserOwnedLabVmCountInSubnet"
+)
+
+// PolicyStatus enumerates the values for policy status.
+type PolicyStatus string
+
+const (
+ // PolicyStatusDisabled specifies the policy status disabled state for
+ // policy status.
+ PolicyStatusDisabled PolicyStatus = "Disabled"
+ // PolicyStatusEnabled specifies the policy status enabled state for
+ // policy status.
+ PolicyStatusEnabled PolicyStatus = "Enabled"
+)
+
+// SourceControlType enumerates the values for source control type.
+type SourceControlType string
+
+const (
+ // GitHub specifies the git hub state for source control type.
+ GitHub SourceControlType = "GitHub"
+ // VsoGit specifies the vso git state for source control type.
+ VsoGit SourceControlType = "VsoGit"
+)
+
+// SubscriptionNotificationState enumerates the values for subscription
+// notification state.
+type SubscriptionNotificationState string
+
+const (
+ // Deleted specifies the deleted state for subscription notification state.
+ Deleted SubscriptionNotificationState = "Deleted"
+ // NotDefined specifies the not defined state for subscription
+ // notification state.
+ NotDefined SubscriptionNotificationState = "NotDefined"
+ // Registered specifies the registered state for subscription notification
+ // state.
+ Registered SubscriptionNotificationState = "Registered"
+ // Suspended specifies the suspended state for subscription notification
+ // state.
+ Suspended SubscriptionNotificationState = "Suspended"
+ // Unregistered specifies the unregistered state for subscription
+ // notification state.
+ Unregistered SubscriptionNotificationState = "Unregistered"
+ // Warned specifies the warned state for subscription notification state.
+ Warned SubscriptionNotificationState = "Warned"
+)
+
+// UsagePermissionType enumerates the values for usage permission type.
+type UsagePermissionType string
+
+const (
+ // Allow specifies the allow state for usage permission type.
+ Allow UsagePermissionType = "Allow"
+ // Default specifies the default state for usage permission type.
+ Default UsagePermissionType = "Default"
+ // Deny specifies the deny state for usage permission type.
+ Deny UsagePermissionType = "Deny"
+)
+
+// WindowsOsState enumerates the values for windows os state.
+type WindowsOsState string
+
+const (
+ // NonSysprepped specifies the non sysprepped state for windows os state.
+ NonSysprepped WindowsOsState = "NonSysprepped"
+ // SysprepApplied specifies the sysprep applied state for windows os state.
+ SysprepApplied WindowsOsState = "SysprepApplied"
+ // SysprepRequested specifies the sysprep requested state for windows os
+ // state.
+ SysprepRequested WindowsOsState = "SysprepRequested"
+)
+
+// ApplyArtifactsRequest is request body for applying artifacts to a virtual
+// machine.
+type ApplyArtifactsRequest struct {
+ Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
+}
+
+// ArmTemplateInfo is information about a generated ARM template.
+type ArmTemplateInfo struct {
+ autorest.Response `json:"-"`
+ Template *map[string]interface{} `json:"template,omitempty"`
+ Parameters *map[string]interface{} `json:"parameters,omitempty"`
+}
+
+// Artifact is an artifact.
+type Artifact struct {
+ autorest.Response `json:"-"`
+ Properties *ArtifactProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ArtifactDeploymentStatusProperties is properties of an artifact deployment.
+type ArtifactDeploymentStatusProperties struct {
+ DeploymentStatus *string `json:"deploymentStatus,omitempty"`
+ ArtifactsApplied *int32 `json:"artifactsApplied,omitempty"`
+ TotalArtifacts *int32 `json:"totalArtifacts,omitempty"`
+}
+
+// ArtifactInstallProperties is properties of an artifact.
+type ArtifactInstallProperties struct {
+ ArtifactID *string `json:"artifactId,omitempty"`
+ Parameters *[]ArtifactParameterProperties `json:"parameters,omitempty"`
+}
+
+// ArtifactParameterProperties is properties of an artifact parameter.
+type ArtifactParameterProperties struct {
+ Name *string `json:"name,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// ArtifactProperties is properties of an artifact.
+type ArtifactProperties struct {
+ Title *string `json:"title,omitempty"`
+ Description *string `json:"description,omitempty"`
+ FilePath *string `json:"filePath,omitempty"`
+ Icon *string `json:"icon,omitempty"`
+ TargetOsType *string `json:"targetOsType,omitempty"`
+ Parameters *map[string]interface{} `json:"parameters,omitempty"`
+}
+
+// ArtifactSource is properties of an artifact source.
+type ArtifactSource struct {
+ autorest.Response `json:"-"`
+ Properties *ArtifactSourceProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ArtifactSourceProperties is properties of an artifact source.
+type ArtifactSourceProperties struct {
+ DisplayName *string `json:"displayName,omitempty"`
+ URI *string `json:"uri,omitempty"`
+ SourceType SourceControlType `json:"sourceType,omitempty"`
+ FolderPath *string `json:"folderPath,omitempty"`
+ BranchRef *string `json:"branchRef,omitempty"`
+ SecurityToken *string `json:"securityToken,omitempty"`
+ Status EnableStatus `json:"status,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// CloudError is
+type CloudError struct {
+ Error *CloudErrorBody `json:"error,omitempty"`
+}
+
+// CloudErrorBody is
+type CloudErrorBody struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Target *string `json:"target,omitempty"`
+ Details *[]CloudErrorBody `json:"details,omitempty"`
+}
+
+// Cost is a cost item.
+type Cost struct {
+ autorest.Response `json:"-"`
+ Properties *CostProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// CostPerDayProperties is the properties of a lab cost item.
+type CostPerDayProperties struct {
+ Date *date.Time `json:"date,omitempty"`
+ Cost *float64 `json:"cost,omitempty"`
+ CostType LabCostType `json:"costType,omitempty"`
+}
+
+// CostProperties is properties of a cost item.
+type CostProperties struct {
+ CurrencyCode *string `json:"currencyCode,omitempty"`
+ Costs *[]CostPerDayProperties `json:"costs,omitempty"`
+ ResourceCosts *[]ResourceCostProperties `json:"resourceCosts,omitempty"`
+}
+
+// CustomImage is a custom image.
+type CustomImage struct {
+ autorest.Response `json:"-"`
+ Properties *CustomImageProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// CustomImageProperties is properties of a custom image.
+type CustomImageProperties struct {
+ VM *CustomImagePropertiesFromVM `json:"vm,omitempty"`
+ Vhd *CustomImagePropertiesCustom `json:"vhd,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Author *string `json:"author,omitempty"`
+ CreationDate *date.Time `json:"creationDate,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// CustomImagePropertiesCustom is properties for creating a custom image from
+// a VHD.
+type CustomImagePropertiesCustom struct {
+ ImageName *string `json:"imageName,omitempty"`
+ SysPrep *bool `json:"sysPrep,omitempty"`
+ OsType CustomImageOsType `json:"osType,omitempty"`
+}
+
+// CustomImagePropertiesFromVM is properties for creating a custom image from
+// a virtual machine.
+type CustomImagePropertiesFromVM struct {
+ SourceVMID *string `json:"sourceVmId,omitempty"`
+ WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"`
+ LinuxOsInfo *LinuxOsInfo `json:"linuxOsInfo,omitempty"`
+}
+
+// DayDetails is properties of a daily schedule.
+type DayDetails struct {
+ Time *string `json:"time,omitempty"`
+}
+
+// EvaluatePoliciesProperties is properties for evaluating a policy set.
+type EvaluatePoliciesProperties struct {
+ FactName *string `json:"factName,omitempty"`
+ FactData *string `json:"factData,omitempty"`
+ ValueOffset *string `json:"valueOffset,omitempty"`
+}
+
+// EvaluatePoliciesRequest is request body for evaluating a policy set.
+type EvaluatePoliciesRequest struct {
+ Policies *[]EvaluatePoliciesProperties `json:"policies,omitempty"`
+}
+
+// EvaluatePoliciesResponse is response body for evaluating a policy set.
+type EvaluatePoliciesResponse struct {
+ autorest.Response `json:"-"`
+ Results *[]PolicySetResult `json:"results,omitempty"`
+}
+
+// Formula is a formula.
+type Formula struct {
+ autorest.Response `json:"-"`
+ Properties *FormulaProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// FormulaProperties is properties of a formula.
+type FormulaProperties struct {
+ Description *string `json:"description,omitempty"`
+ Author *string `json:"author,omitempty"`
+ OsType *string `json:"osType,omitempty"`
+ CreationDate *date.Time `json:"creationDate,omitempty"`
+ FormulaContent *LabVirtualMachine `json:"formulaContent,omitempty"`
+ VM *FormulaPropertiesFromVM `json:"vm,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// FormulaPropertiesFromVM is information about a VM from which a formula is
+// to be created.
+type FormulaPropertiesFromVM struct {
+ LabVMID *string `json:"labVmId,omitempty"`
+}
+
+// GalleryImage is a gallery image.
+type GalleryImage struct {
+ Properties *GalleryImageProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// GalleryImageProperties is properties of a gallery image.
+type GalleryImageProperties struct {
+ Author *string `json:"author,omitempty"`
+ CreatedDate *date.Time `json:"createdDate,omitempty"`
+ Description *string `json:"description,omitempty"`
+ ImageReference *GalleryImageReference `json:"imageReference,omitempty"`
+ Icon *string `json:"icon,omitempty"`
+ Enabled *bool `json:"enabled,omitempty"`
+}
+
+// GalleryImageReference is the reference information for an Azure Marketplace
+// image.
+type GalleryImageReference struct {
+ Offer *string `json:"offer,omitempty"`
+ Publisher *string `json:"publisher,omitempty"`
+ Sku *string `json:"sku,omitempty"`
+ OsType *string `json:"osType,omitempty"`
+ Version *string `json:"version,omitempty"`
+}
+
+// GenerateArmTemplateRequest is parameters for generating an ARM template for
+// deploying artifacts.
+type GenerateArmTemplateRequest struct {
+ VirtualMachineName *string `json:"virtualMachineName,omitempty"`
+ Parameters *[]ParameterInfo `json:"parameters,omitempty"`
+ Location *string `json:"location,omitempty"`
+}
+
+// GenerateUploadURIParameter is properties for generating an upload URI.
+type GenerateUploadURIParameter struct {
+ BlobName *string `json:"blobName,omitempty"`
+}
+
+// GenerateUploadURIResponse is reponse body for generating an upload URI.
+type GenerateUploadURIResponse struct {
+ autorest.Response `json:"-"`
+ UploadURI *string `json:"uploadUri,omitempty"`
+}
+
+// HourDetails is properties of an hourly schedule.
+type HourDetails struct {
+ Minute *int32 `json:"minute,omitempty"`
+}
+
+// Lab is a lab.
+type Lab struct {
+ autorest.Response `json:"-"`
+ Properties *LabProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// LabProperties is properties of a lab.
+type LabProperties struct {
+ DefaultStorageAccount *string `json:"defaultStorageAccount,omitempty"`
+ ArtifactsStorageAccount *string `json:"artifactsStorageAccount,omitempty"`
+ VaultName *string `json:"vaultName,omitempty"`
+ LabStorageType LabStorageType `json:"labStorageType,omitempty"`
+ CreatedDate *date.Time `json:"createdDate,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// LabVhd is properties of a VHD in the lab.
+type LabVhd struct {
+ ID *string `json:"id,omitempty"`
+}
+
+// LabVirtualMachine is a virtual machine.
+type LabVirtualMachine struct {
+ autorest.Response `json:"-"`
+ Properties *LabVirtualMachineProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// LabVirtualMachineProperties is properties of a virtual machine.
+type LabVirtualMachineProperties struct {
+ Notes *string `json:"notes,omitempty"`
+ OwnerObjectID *string `json:"ownerObjectId,omitempty"`
+ CreatedByUserID *string `json:"createdByUserId,omitempty"`
+ CreatedByUser *string `json:"createdByUser,omitempty"`
+ ComputeID *string `json:"computeId,omitempty"`
+ CustomImageID *string `json:"customImageId,omitempty"`
+ OsType *string `json:"osType,omitempty"`
+ Size *string `json:"size,omitempty"`
+ UserName *string `json:"userName,omitempty"`
+ Password *string `json:"password,omitempty"`
+ SSHKey *string `json:"sshKey,omitempty"`
+ IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"`
+ Fqdn *string `json:"fqdn,omitempty"`
+ LabSubnetName *string `json:"labSubnetName,omitempty"`
+ LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"`
+ DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"`
+ Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"`
+ ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"`
+ GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// LinuxOsInfo is information about a Linux OS.
+type LinuxOsInfo struct {
+ LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"`
+}
+
+// ParameterInfo is
+type ParameterInfo struct {
+ Name *string `json:"name,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// Policy is a Policy.
+type Policy struct {
+ autorest.Response `json:"-"`
+ Properties *PolicyProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// PolicyProperties is properties of a Policy.
+type PolicyProperties struct {
+ Description *string `json:"description,omitempty"`
+ Status PolicyStatus `json:"status,omitempty"`
+ FactName PolicyFactName `json:"factName,omitempty"`
+ FactData *string `json:"factData,omitempty"`
+ Threshold *string `json:"threshold,omitempty"`
+ EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// PolicySetResult is result of a policy set evaluation.
+type PolicySetResult struct {
+ HasError *bool `json:"hasError,omitempty"`
+ PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"`
+}
+
+// PolicyViolation is policy violation.
+type PolicyViolation struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// ResourceCostProperties is the properties of a resource cost item.
+type ResourceCostProperties struct {
+ Resourcename *string `json:"resourcename,omitempty"`
+ ResourceGroupName *string `json:"resourceGroupName,omitempty"`
+ ResourceCost *float64 `json:"resourceCost,omitempty"`
+ Owner *string `json:"owner,omitempty"`
+ Category *string `json:"category,omitempty"`
+ Exists *bool `json:"exists,omitempty"`
+ ResourceType *string `json:"resourceType,omitempty"`
+}
+
+// ResponseWithContinuationArtifact is the response of a list operation.
+type ResponseWithContinuationArtifact struct {
+ autorest.Response `json:"-"`
+ Value *[]Artifact `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationArtifactPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationArtifact) ResponseWithContinuationArtifactPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationArtifactSource is the response of a list operation.
+type ResponseWithContinuationArtifactSource struct {
+ autorest.Response `json:"-"`
+ Value *[]ArtifactSource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationArtifactSourcePreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationArtifactSource) ResponseWithContinuationArtifactSourcePreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationCustomImage is the response of a list operation.
+type ResponseWithContinuationCustomImage struct {
+ autorest.Response `json:"-"`
+ Value *[]CustomImage `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationCustomImagePreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationCustomImage) ResponseWithContinuationCustomImagePreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationFormula is the response of a list operation.
+type ResponseWithContinuationFormula struct {
+ autorest.Response `json:"-"`
+ Value *[]Formula `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationFormulaPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationFormula) ResponseWithContinuationFormulaPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationGalleryImage is the response of a list operation.
+type ResponseWithContinuationGalleryImage struct {
+ autorest.Response `json:"-"`
+ Value *[]GalleryImage `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationGalleryImagePreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationGalleryImage) ResponseWithContinuationGalleryImagePreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationLab is the response of a list operation.
+type ResponseWithContinuationLab struct {
+ autorest.Response `json:"-"`
+ Value *[]Lab `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationLabPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationLab) ResponseWithContinuationLabPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationLabVhd is the response of a list operation.
+type ResponseWithContinuationLabVhd struct {
+ autorest.Response `json:"-"`
+ Value *[]LabVhd `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationLabVhdPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationLabVhd) ResponseWithContinuationLabVhdPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationLabVirtualMachine is the response of a list
+// operation.
+type ResponseWithContinuationLabVirtualMachine struct {
+ autorest.Response `json:"-"`
+ Value *[]LabVirtualMachine `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationLabVirtualMachinePreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationLabVirtualMachine) ResponseWithContinuationLabVirtualMachinePreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationPolicy is the response of a list operation.
+type ResponseWithContinuationPolicy struct {
+ autorest.Response `json:"-"`
+ Value *[]Policy `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationPolicyPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationPolicy) ResponseWithContinuationPolicyPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationSchedule is the response of a list operation.
+type ResponseWithContinuationSchedule struct {
+ autorest.Response `json:"-"`
+ Value *[]Schedule `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationSchedulePreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationSchedule) ResponseWithContinuationSchedulePreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResponseWithContinuationVirtualNetwork is the response of a list operation.
+type ResponseWithContinuationVirtualNetwork struct {
+ autorest.Response `json:"-"`
+ Value *[]VirtualNetwork `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResponseWithContinuationVirtualNetworkPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResponseWithContinuationVirtualNetwork) ResponseWithContinuationVirtualNetworkPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// Schedule is a schedule.
+type Schedule struct {
+ autorest.Response `json:"-"`
+ Properties *ScheduleProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ScheduleProperties is properties of a schedule.
+type ScheduleProperties struct {
+ Status EnableStatus `json:"status,omitempty"`
+ TaskType *string `json:"taskType,omitempty"`
+ WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"`
+ DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"`
+ HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"`
+ TimeZoneID *string `json:"timeZoneId,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// Subnet is
+type Subnet struct {
+ ResourceID *string `json:"resourceId,omitempty"`
+ LabSubnetName *string `json:"labSubnetName,omitempty"`
+ AllowPublicIP UsagePermissionType `json:"allowPublicIp,omitempty"`
+}
+
+// SubnetOverride is property overrides on a subnet of a virtual network.
+type SubnetOverride struct {
+ ResourceID *string `json:"resourceId,omitempty"`
+ LabSubnetName *string `json:"labSubnetName,omitempty"`
+ UseInVMCreationPermission UsagePermissionType `json:"useInVmCreationPermission,omitempty"`
+ UsePublicIPAddressPermission UsagePermissionType `json:"usePublicIpAddressPermission,omitempty"`
+}
+
+// SubscriptionNotification is
+type SubscriptionNotification struct {
+ RegistrationDate *string `json:"registrationDate,omitempty"`
+ State SubscriptionNotificationState `json:"state,omitempty"`
+ Properties *SubscriptionNotificationProperties `json:"properties,omitempty"`
+}
+
+// SubscriptionNotificationProperties is
+type SubscriptionNotificationProperties struct {
+ TenantID *string `json:"tenantId,omitempty"`
+}
+
+// VirtualNetwork is a virtual network.
+type VirtualNetwork struct {
+ autorest.Response `json:"-"`
+ Properties *VirtualNetworkProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// VirtualNetworkProperties is properties of a virtual network.
+type VirtualNetworkProperties struct {
+ AllowedSubnets *[]Subnet `json:"allowedSubnets,omitempty"`
+ Description *string `json:"description,omitempty"`
+ ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"`
+ SubnetOverrides *[]SubnetOverride `json:"subnetOverrides,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
+}
+
+// WeekDetails is properties of a weekly schedule.
+type WeekDetails struct {
+ Weekdays *[]string `json:"weekdays,omitempty"`
+ Time *string `json:"time,omitempty"`
+}
+
+// WindowsOsInfo is information about a Windows OS.
+type WindowsOsInfo struct {
+ WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,409 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// PolicyOperationsClient is the the DevTest Labs Client.
+type PolicyOperationsClient struct {
+ ManagementClient
+}
+
+// NewPolicyOperationsClient creates an instance of the PolicyOperationsClient
+// client.
+func NewPolicyOperationsClient(subscriptionID string) PolicyOperationsClient {
+ return NewPolicyOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPolicyOperationsClientWithBaseURI creates an instance of the
+// PolicyOperationsClient client.
+func NewPolicyOperationsClientWithBaseURI(baseURI string, subscriptionID string) PolicyOperationsClient {
+ return PolicyOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing policy.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. policySetName is the name of the policy set. name is the name of
+// the policy.
+func (client PolicyOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, policySetName string, name string, policy Policy) (result Policy, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, policySetName, name, policy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client PolicyOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, policySetName string, name string, policy Policy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "policySetName": autorest.Encode("path", policySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}", pathParameters),
+ autorest.WithJSON(policy),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicyOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client PolicyOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result Policy, 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
+}
+
+// DeleteResource delete policy.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. policySetName is the name of the policy set. name is the name of
+// the policy.
+func (client PolicyOperationsClient) DeleteResource(resourceGroupName string, labName string, policySetName string, name string) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, policySetName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client PolicyOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, policySetName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "policySetName": autorest.Encode("path", policySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicyOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client PolicyOperationsClient) DeleteResourceResponder(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
+}
+
+// GetResource get policy.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. policySetName is the name of the policy set. name is the name of
+// the policy.
+func (client PolicyOperationsClient) GetResource(resourceGroupName string, labName string, policySetName string, name string) (result Policy, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, policySetName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client PolicyOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, policySetName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "policySetName": autorest.Encode("path", policySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicyOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client PolicyOperationsClient) GetResourceResponder(resp *http.Response) (result Policy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list policies in a given policy set.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. policySetName is the name of the policy set. filter is the filter
+// to apply on the operation. top is the maximum number of resources to
+// return from the operation. orderBy is the ordering expression for the
+// results, using OData notation.
+func (client PolicyOperationsClient) List(resourceGroupName string, labName string, policySetName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationPolicy, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, policySetName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client PolicyOperationsClient) ListPreparer(resourceGroupName string, labName string, policySetName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "policySetName": autorest.Encode("path", policySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicyOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client PolicyOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationPolicy, 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 PolicyOperationsClient) ListNextResults(lastResults ResponseWithContinuationPolicy) (result ResponseWithContinuationPolicy, err error) {
+ req, err := lastResults.ResponseWithContinuationPolicyPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of policies.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. policySetName is the name of the policy set. name is the name of
+// the policy.
+func (client PolicyOperationsClient) PatchResource(resourceGroupName string, labName string, policySetName string, name string, policy Policy) (result Policy, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, labName, policySetName, name, policy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicyOperationsClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client PolicyOperationsClient) PatchResourcePreparer(resourceGroupName string, labName string, policySetName string, name string, policy Policy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "policySetName": autorest.Encode("path", policySetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{name}", pathParameters),
+ autorest.WithJSON(policy),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicyOperationsClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client PolicyOperationsClient) PatchResourceResponder(resp *http.Response) (result Policy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyset.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyset.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyset.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/policyset.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,107 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// PolicySetClient is the the DevTest Labs Client.
+type PolicySetClient struct {
+ ManagementClient
+}
+
+// NewPolicySetClient creates an instance of the PolicySetClient client.
+func NewPolicySetClient(subscriptionID string) PolicySetClient {
+ return NewPolicySetClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPolicySetClientWithBaseURI creates an instance of the PolicySetClient
+// client.
+func NewPolicySetClientWithBaseURI(baseURI string, subscriptionID string) PolicySetClient {
+ return PolicySetClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// EvaluatePolicies evaluates Lab Policy.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the policy set.
+func (client PolicySetClient) EvaluatePolicies(resourceGroupName string, labName string, name string, evaluatePoliciesRequest EvaluatePoliciesRequest) (result EvaluatePoliciesResponse, err error) {
+ req, err := client.EvaluatePoliciesPreparer(resourceGroupName, labName, name, evaluatePoliciesRequest)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicySetClient", "EvaluatePolicies", nil, "Failure preparing request")
+ }
+
+ resp, err := client.EvaluatePoliciesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.PolicySetClient", "EvaluatePolicies", resp, "Failure sending request")
+ }
+
+ result, err = client.EvaluatePoliciesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.PolicySetClient", "EvaluatePolicies", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// EvaluatePoliciesPreparer prepares the EvaluatePolicies request.
+func (client PolicySetClient) EvaluatePoliciesPreparer(resourceGroupName string, labName string, name string, evaluatePoliciesRequest EvaluatePoliciesRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{name}/evaluatePolicies", pathParameters),
+ autorest.WithJSON(evaluatePoliciesRequest),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// EvaluatePoliciesSender sends the EvaluatePolicies request. The method will close the
+// http.Response Body if it receives an error.
+func (client PolicySetClient) EvaluatePoliciesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// EvaluatePoliciesResponder handles the response to the EvaluatePolicies request. The method always
+// closes the http.Response Body.
+func (client PolicySetClient) EvaluatePoliciesResponder(resp *http.Response) (result EvaluatePoliciesResponse, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/scheduleoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/scheduleoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/scheduleoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/scheduleoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,467 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ScheduleOperationsClient is the the DevTest Labs Client.
+type ScheduleOperationsClient struct {
+ ManagementClient
+}
+
+// NewScheduleOperationsClient creates an instance of the
+// ScheduleOperationsClient client.
+func NewScheduleOperationsClient(subscriptionID string) ScheduleOperationsClient {
+ return NewScheduleOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewScheduleOperationsClientWithBaseURI creates an instance of the
+// ScheduleOperationsClient client.
+func NewScheduleOperationsClientWithBaseURI(baseURI string, subscriptionID string) ScheduleOperationsClient {
+ return ScheduleOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing schedule.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the schedule.
+func (client ScheduleOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, schedule Schedule) (result Schedule, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, schedule)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client ScheduleOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, schedule Schedule) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
+ autorest.WithJSON(schedule),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result Schedule, 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
+}
+
+// DeleteResource delete schedule.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the schedule.
+func (client ScheduleOperationsClient) DeleteResource(resourceGroupName string, labName string, name string) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client ScheduleOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) DeleteResourceResponder(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
+}
+
+// Execute execute a schedule. This operation can take a while to complete.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the schedule.
+func (client ScheduleOperationsClient) Execute(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ExecutePreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "Execute", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ExecuteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "Execute", resp, "Failure sending request")
+ }
+
+ result, err = client.ExecuteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "Execute", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ExecutePreparer prepares the Execute request.
+func (client ScheduleOperationsClient) ExecutePreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/execute", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ExecuteSender sends the Execute request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) ExecuteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ExecuteResponder handles the response to the Execute request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) ExecuteResponder(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
+}
+
+// GetResource get schedule.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the schedule.
+func (client ScheduleOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result Schedule, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client ScheduleOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) GetResourceResponder(resp *http.Response) (result Schedule, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list schedules in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client ScheduleOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationSchedule, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ScheduleOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationSchedule, 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 ScheduleOperationsClient) ListNextResults(lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) {
+ req, err := lastResults.ResponseWithContinuationSchedulePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of schedules.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the schedule.
+func (client ScheduleOperationsClient) PatchResource(resourceGroupName string, labName string, name string, schedule Schedule) (result Schedule, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, labName, name, schedule)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.ScheduleOperationsClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client ScheduleOperationsClient) PatchResourcePreparer(resourceGroupName string, labName string, name string, schedule Schedule) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
+ autorest.WithJSON(schedule),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduleOperationsClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client ScheduleOperationsClient) PatchResourceResponder(resp *http.Response) (result Schedule, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "devtestlabs", "2016-05-15")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualmachine.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualmachine.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualmachine.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualmachine.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,615 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// VirtualMachineClient is the the DevTest Labs Client.
+type VirtualMachineClient struct {
+ ManagementClient
+}
+
+// NewVirtualMachineClient creates an instance of the VirtualMachineClient
+// client.
+func NewVirtualMachineClient(subscriptionID string) VirtualMachineClient {
+ return NewVirtualMachineClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVirtualMachineClientWithBaseURI creates an instance of the
+// VirtualMachineClient client.
+func NewVirtualMachineClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineClient {
+ return VirtualMachineClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// ApplyArtifacts apply artifacts to Lab VM. This operation can take a while
+// to complete. This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) ApplyArtifacts(resourceGroupName string, labName string, name string, applyArtifactsRequest ApplyArtifactsRequest, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ApplyArtifactsPreparer(resourceGroupName, labName, name, applyArtifactsRequest, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "ApplyArtifacts", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ApplyArtifactsSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "ApplyArtifacts", resp, "Failure sending request")
+ }
+
+ result, err = client.ApplyArtifactsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "ApplyArtifacts", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ApplyArtifactsPreparer prepares the ApplyArtifacts request.
+func (client VirtualMachineClient) ApplyArtifactsPreparer(resourceGroupName string, labName string, name string, applyArtifactsRequest ApplyArtifactsRequest, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts", pathParameters),
+ autorest.WithJSON(applyArtifactsRequest),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ApplyArtifactsSender sends the ApplyArtifacts request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) ApplyArtifactsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ApplyArtifactsResponder handles the response to the ApplyArtifacts request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) ApplyArtifactsResponder(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
+}
+
+// CreateOrUpdateResource create or replace an existing Virtual Machine. This
+// operation can take a while to complete. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, labVirtualMachine, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client VirtualMachineClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}", pathParameters),
+ autorest.WithJSON(labVirtualMachine),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) CreateOrUpdateResourceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteResource delete virtual machine. This operation can take a while to
+// complete. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) DeleteResource(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client VirtualMachineClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) DeleteResourceResponder(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
+}
+
+// GetResource get virtual machine.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) GetResource(resourceGroupName string, labName string, name string) (result LabVirtualMachine, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client VirtualMachineClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) GetResourceResponder(resp *http.Response) (result LabVirtualMachine, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list virtual machines in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client VirtualMachineClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationLabVirtualMachine, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VirtualMachineClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) ListResponder(resp *http.Response) (result ResponseWithContinuationLabVirtualMachine, 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 VirtualMachineClient) ListNextResults(lastResults ResponseWithContinuationLabVirtualMachine) (result ResponseWithContinuationLabVirtualMachine, err error) {
+ req, err := lastResults.ResponseWithContinuationLabVirtualMachinePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of virtual machines.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) PatchResource(resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine) (result LabVirtualMachine, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, labName, name, labVirtualMachine)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client VirtualMachineClient) PatchResourcePreparer(resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}", pathParameters),
+ autorest.WithJSON(labVirtualMachine),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) PatchResourceResponder(resp *http.Response) (result LabVirtualMachine, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Start start a Lab VM. This operation can take a while to complete. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) Start(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Start", nil, "Failure preparing request")
+ }
+
+ resp, err := client.StartSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Start", resp, "Failure sending request")
+ }
+
+ result, err = client.StartResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Start", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// StartPreparer prepares the Start request.
+func (client VirtualMachineClient) StartPreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/start", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// StartSender sends the Start request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) StartSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// StartResponder handles the response to the Start request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) StartResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Stop stop a Lab VM. This operation can take a while to complete. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual Machine.
+func (client VirtualMachineClient) Stop(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StopPreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Stop", nil, "Failure preparing request")
+ }
+
+ resp, err := client.StopSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Stop", resp, "Failure sending request")
+ }
+
+ result, err = client.StopResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualMachineClient", "Stop", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// StopPreparer prepares the Stop request.
+func (client VirtualMachineClient) StopPreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/stop", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// StopSender sends the Stop request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualMachineClient) StopSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// StopResponder handles the response to the Stop request. The method always
+// closes the http.Response Body.
+func (client VirtualMachineClient) StopResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualnetworkoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualnetworkoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualnetworkoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/devtestlabs/virtualnetworkoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,409 @@
+package devtestlabs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// VirtualNetworkOperationsClient is the the DevTest Labs Client.
+type VirtualNetworkOperationsClient struct {
+ ManagementClient
+}
+
+// NewVirtualNetworkOperationsClient creates an instance of the
+// VirtualNetworkOperationsClient client.
+func NewVirtualNetworkOperationsClient(subscriptionID string) VirtualNetworkOperationsClient {
+ return NewVirtualNetworkOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVirtualNetworkOperationsClientWithBaseURI creates an instance of the
+// VirtualNetworkOperationsClient client.
+func NewVirtualNetworkOperationsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkOperationsClient {
+ return VirtualNetworkOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateResource create or replace an existing virtual network. This
+// operation can take a while to complete. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual network.
+func (client VirtualNetworkOperationsClient) CreateOrUpdateResource(resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateResourcePreparer(resourceGroupName, labName, name, virtualNetwork, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "CreateOrUpdateResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "CreateOrUpdateResource", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "CreateOrUpdateResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateResourcePreparer prepares the CreateOrUpdateResource request.
+func (client VirtualNetworkOperationsClient) CreateOrUpdateResourcePreparer(resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}", pathParameters),
+ autorest.WithJSON(virtualNetwork),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateResourceSender sends the CreateOrUpdateResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkOperationsClient) CreateOrUpdateResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResourceResponder handles the response to the CreateOrUpdateResource request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkOperationsClient) CreateOrUpdateResourceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteResource delete virtual network. This operation can take a while to
+// complete. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual network.
+func (client VirtualNetworkOperationsClient) DeleteResource(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteResourcePreparer(resourceGroupName, labName, name, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "DeleteResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteResourceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "DeleteResource", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "DeleteResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteResourcePreparer prepares the DeleteResource request.
+func (client VirtualNetworkOperationsClient) DeleteResourcePreparer(resourceGroupName string, labName string, name string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteResourceSender sends the DeleteResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkOperationsClient) DeleteResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResourceResponder handles the response to the DeleteResource request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkOperationsClient) DeleteResourceResponder(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
+}
+
+// GetResource get virtual network.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual network.
+func (client VirtualNetworkOperationsClient) GetResource(resourceGroupName string, labName string, name string) (result VirtualNetwork, err error) {
+ req, err := client.GetResourcePreparer(resourceGroupName, labName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "GetResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "GetResource", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "GetResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetResourcePreparer prepares the GetResource request.
+func (client VirtualNetworkOperationsClient) GetResourcePreparer(resourceGroupName string, labName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetResourceSender sends the GetResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkOperationsClient) GetResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResourceResponder handles the response to the GetResource request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkOperationsClient) GetResourceResponder(resp *http.Response) (result VirtualNetwork, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list virtual networks in a given lab.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. filter is the filter to apply on the operation. top is the
+// maximum number of resources to return from the operation. orderBy is the
+// ordering expression for the results, using OData notation.
+func (client VirtualNetworkOperationsClient) List(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (result ResponseWithContinuationVirtualNetwork, err error) {
+ req, err := client.ListPreparer(resourceGroupName, labName, filter, top, orderBy)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VirtualNetworkOperationsClient) ListPreparer(resourceGroupName string, labName string, filter string, top *int32, orderBy string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderBy) > 0 {
+ queryParameters["$orderBy"] = autorest.Encode("query", orderBy)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkOperationsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationVirtualNetwork, 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 VirtualNetworkOperationsClient) ListNextResults(lastResults ResponseWithContinuationVirtualNetwork) (result ResponseWithContinuationVirtualNetwork, err error) {
+ req, err := lastResults.ResponseWithContinuationVirtualNetworkPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// PatchResource modify properties of virtual networks.
+//
+// resourceGroupName is the name of the resource group. labName is the name of
+// the lab. name is the name of the virtual network.
+func (client VirtualNetworkOperationsClient) PatchResource(resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork) (result VirtualNetwork, err error) {
+ req, err := client.PatchResourcePreparer(resourceGroupName, labName, name, virtualNetwork)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "PatchResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "PatchResource", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "devtestlabs.VirtualNetworkOperationsClient", "PatchResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchResourcePreparer prepares the PatchResource request.
+func (client VirtualNetworkOperationsClient) PatchResourcePreparer(resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "labName": autorest.Encode("path", labName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}", pathParameters),
+ autorest.WithJSON(virtualNetwork),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchResourceSender sends the PatchResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkOperationsClient) PatchResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResourceResponder handles the response to the PatchResource request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkOperationsClient) PatchResourceResponder(resp *http.Response) (result VirtualNetwork, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,5 @@
+// Package dns implements the Azure ARM Dns service API version 2016-04-01.
+//
package dns
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,26 +16,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Dns
- APIVersion = "2015-11-01"
+ APIVersion = "2016-04-01"
// DefaultBaseURI is the default URI used for the service Dns
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the client for managing DNS zones and record.
+// ManagementClient is the base client for Dns.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +50,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,12 +14,145 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// HtpStatusCode enumerates the values for htp status code.
+type HtpStatusCode string
+
+const (
+ // Accepted specifies the accepted state for htp status code.
+ Accepted HtpStatusCode = "Accepted"
+ // Ambiguous specifies the ambiguous state for htp status code.
+ Ambiguous HtpStatusCode = "Ambiguous"
+ // BadGateway specifies the bad gateway state for htp status code.
+ BadGateway HtpStatusCode = "BadGateway"
+ // BadRequest specifies the bad request state for htp status code.
+ BadRequest HtpStatusCode = "BadRequest"
+ // Conflict specifies the conflict state for htp status code.
+ Conflict HtpStatusCode = "Conflict"
+ // Continue specifies the continue state for htp status code.
+ Continue HtpStatusCode = "Continue"
+ // Created specifies the created state for htp status code.
+ Created HtpStatusCode = "Created"
+ // ExpectationFailed specifies the expectation failed state for htp status
+ // code.
+ ExpectationFailed HtpStatusCode = "ExpectationFailed"
+ // Forbidden specifies the forbidden state for htp status code.
+ Forbidden HtpStatusCode = "Forbidden"
+ // Found specifies the found state for htp status code.
+ Found HtpStatusCode = "Found"
+ // GatewayTimeout specifies the gateway timeout state for htp status code.
+ GatewayTimeout HtpStatusCode = "GatewayTimeout"
+ // Gone specifies the gone state for htp status code.
+ Gone HtpStatusCode = "Gone"
+ // HTTPVersionNotSupported specifies the http version not supported state
+ // for htp status code.
+ HTTPVersionNotSupported HtpStatusCode = "HttpVersionNotSupported"
+ // InternalServerError specifies the internal server error state for htp
+ // status code.
+ InternalServerError HtpStatusCode = "InternalServerError"
+ // LengthRequired specifies the length required state for htp status code.
+ LengthRequired HtpStatusCode = "LengthRequired"
+ // MethodNotAllowed specifies the method not allowed state for htp status
+ // code.
+ MethodNotAllowed HtpStatusCode = "MethodNotAllowed"
+ // Moved specifies the moved state for htp status code.
+ Moved HtpStatusCode = "Moved"
+ // MovedPermanently specifies the moved permanently state for htp status
+ // code.
+ MovedPermanently HtpStatusCode = "MovedPermanently"
+ // MultipleChoices specifies the multiple choices state for htp status
+ // code.
+ MultipleChoices HtpStatusCode = "MultipleChoices"
+ // NoContent specifies the no content state for htp status code.
+ NoContent HtpStatusCode = "NoContent"
+ // NonAuthoritativeInformation specifies the non authoritative information
+ // state for htp status code.
+ NonAuthoritativeInformation HtpStatusCode = "NonAuthoritativeInformation"
+ // NotAcceptable specifies the not acceptable state for htp status code.
+ NotAcceptable HtpStatusCode = "NotAcceptable"
+ // NotFound specifies the not found state for htp status code.
+ NotFound HtpStatusCode = "NotFound"
+ // NotImplemented specifies the not implemented state for htp status code.
+ NotImplemented HtpStatusCode = "NotImplemented"
+ // NotModified specifies the not modified state for htp status code.
+ NotModified HtpStatusCode = "NotModified"
+ // OK specifies the ok state for htp status code.
+ OK HtpStatusCode = "OK"
+ // PartialContent specifies the partial content state for htp status code.
+ PartialContent HtpStatusCode = "PartialContent"
+ // PaymentRequired specifies the payment required state for htp status
+ // code.
+ PaymentRequired HtpStatusCode = "PaymentRequired"
+ // PreconditionFailed specifies the precondition failed state for htp
+ // status code.
+ PreconditionFailed HtpStatusCode = "PreconditionFailed"
+ // ProxyAuthenticationRequired specifies the proxy authentication required
+ // state for htp status code.
+ ProxyAuthenticationRequired HtpStatusCode = "ProxyAuthenticationRequired"
+ // Redirect specifies the redirect state for htp status code.
+ Redirect HtpStatusCode = "Redirect"
+ // RedirectKeepVerb specifies the redirect keep verb state for htp status
+ // code.
+ RedirectKeepVerb HtpStatusCode = "RedirectKeepVerb"
+ // RedirectMethod specifies the redirect method state for htp status code.
+ RedirectMethod HtpStatusCode = "RedirectMethod"
+ // RequestedRangeNotSatisfiable specifies the requested range not
+ // satisfiable state for htp status code.
+ RequestedRangeNotSatisfiable HtpStatusCode = "RequestedRangeNotSatisfiable"
+ // RequestEntityTooLarge specifies the request entity too large state for
+ // htp status code.
+ RequestEntityTooLarge HtpStatusCode = "RequestEntityTooLarge"
+ // RequestTimeout specifies the request timeout state for htp status code.
+ RequestTimeout HtpStatusCode = "RequestTimeout"
+ // RequestURITooLong specifies the request uri too long state for htp
+ // status code.
+ RequestURITooLong HtpStatusCode = "RequestUriTooLong"
+ // ResetContent specifies the reset content state for htp status code.
+ ResetContent HtpStatusCode = "ResetContent"
+ // SeeOther specifies the see other state for htp status code.
+ SeeOther HtpStatusCode = "SeeOther"
+ // ServiceUnavailable specifies the service unavailable state for htp
+ // status code.
+ ServiceUnavailable HtpStatusCode = "ServiceUnavailable"
+ // SwitchingProtocols specifies the switching protocols state for htp
+ // status code.
+ SwitchingProtocols HtpStatusCode = "SwitchingProtocols"
+ // TemporaryRedirect specifies the temporary redirect state for htp status
+ // code.
+ TemporaryRedirect HtpStatusCode = "TemporaryRedirect"
+ // Unauthorized specifies the unauthorized state for htp status code.
+ Unauthorized HtpStatusCode = "Unauthorized"
+ // UnsupportedMediaType specifies the unsupported media type state for htp
+ // status code.
+ UnsupportedMediaType HtpStatusCode = "UnsupportedMediaType"
+ // Unused specifies the unused state for htp status code.
+ Unused HtpStatusCode = "Unused"
+ // UpgradeRequired specifies the upgrade required state for htp status
+ // code.
+ UpgradeRequired HtpStatusCode = "UpgradeRequired"
+ // UseProxy specifies the use proxy state for htp status code.
+ UseProxy HtpStatusCode = "UseProxy"
+)
+
+// OperationStatus enumerates the values for operation status.
+type OperationStatus string
+
+const (
+ // Failed specifies the failed state for operation status.
+ Failed OperationStatus = "Failed"
+ // InProgress specifies the in progress state for operation status.
+ InProgress OperationStatus = "InProgress"
+ // Succeeded specifies the succeeded state for operation status.
+ Succeeded OperationStatus = "Succeeded"
)
// RecordType enumerates the values for record type.
@@ -56,6 +189,19 @@
Ipv4Address *string `json:"ipv4Address,omitempty"`
}
+// CloudError is
+type CloudError struct {
+ Error *CloudErrorBody `json:"error,omitempty"`
+}
+
+// CloudErrorBody is
+type CloudErrorBody struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Target *string `json:"target,omitempty"`
+ Details *[]CloudErrorBody `json:"details,omitempty"`
+}
+
// CnameRecord is a CNAME record.
type CnameRecord struct {
Cname *string `json:"cname,omitempty"`
@@ -63,7 +209,7 @@
// MxRecord is an MX record.
type MxRecord struct {
- Preference *int `json:"preference,omitempty"`
+ Preference *int32 `json:"preference,omitempty"`
Exchange *string `json:"exchange,omitempty"`
}
@@ -84,18 +230,10 @@
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
Etag *string `json:"etag,omitempty"`
Properties *RecordSetProperties `json:"properties,omitempty"`
}
-// RecordSetCreateOrUpdateParameters is parameters supplied to create or
-// update a RecordSet.
-type RecordSetCreateOrUpdateParameters struct {
- RecordSet *RecordSet `json:"RecordSet,omitempty"`
-}
-
// RecordSetListResult is the response to a RecordSet List operation.
type RecordSetListResult struct {
autorest.Response `json:"-"`
@@ -103,19 +241,37 @@
NextLink *string `json:"nextLink,omitempty"`
}
+// RecordSetListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client RecordSetListResult) RecordSetListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
// RecordSetProperties is represents the properties of the records in the
// RecordSet.
type RecordSetProperties struct {
- TTL *int32 `json:"TTL,omitempty"`
- ARecords *[]ARecord `json:"ARecords,omitempty"`
- AAAARecords *[]AaaaRecord `json:"AAAARecords,omitempty"`
- MXRecords *[]MxRecord `json:"MXRecords,omitempty"`
- NSRecords *[]NsRecord `json:"NSRecords,omitempty"`
- PTRRecords *[]PtrRecord `json:"PTRRecords,omitempty"`
- SRVRecords *[]SrvRecord `json:"SRVRecords,omitempty"`
- TXTRecords *[]TxtRecord `json:"TXTRecords,omitempty"`
- CNAMERecord *CnameRecord `json:"CNAMERecord,omitempty"`
- SOARecord *SoaRecord `json:"SOARecord,omitempty"`
+ Metadata *map[string]*string `json:"metadata,omitempty"`
+ TTL *int64 `json:"TTL,omitempty"`
+ ARecords *[]ARecord `json:"ARecords,omitempty"`
+ AAAARecords *[]AaaaRecord `json:"AAAARecords,omitempty"`
+ MXRecords *[]MxRecord `json:"MXRecords,omitempty"`
+ NSRecords *[]NsRecord `json:"NSRecords,omitempty"`
+ PTRRecords *[]PtrRecord `json:"PTRRecords,omitempty"`
+ SRVRecords *[]SrvRecord `json:"SRVRecords,omitempty"`
+ TXTRecords *[]TxtRecord `json:"TXTRecords,omitempty"`
+ CNAMERecord *CnameRecord `json:"CNAMERecord,omitempty"`
+ SOARecord *SoaRecord `json:"SOARecord,omitempty"`
+}
+
+// RecordSetUpdateParameters is parameters supplied to update a RecordSet.
+type RecordSetUpdateParameters struct {
+ RecordSet *RecordSet `json:"RecordSet,omitempty"`
}
// Resource is
@@ -131,18 +287,18 @@
type SoaRecord struct {
Host *string `json:"host,omitempty"`
Email *string `json:"email,omitempty"`
- SerialNumber *int32 `json:"serialNumber,omitempty"`
- RefreshTime *int32 `json:"refreshTime,omitempty"`
- RetryTime *int32 `json:"retryTime,omitempty"`
- ExpireTime *int32 `json:"expireTime,omitempty"`
- MinimumTTL *int32 `json:"minimumTTL,omitempty"`
+ SerialNumber *int64 `json:"serialNumber,omitempty"`
+ RefreshTime *int64 `json:"refreshTime,omitempty"`
+ RetryTime *int64 `json:"retryTime,omitempty"`
+ ExpireTime *int64 `json:"expireTime,omitempty"`
+ MinimumTTL *int64 `json:"minimumTTL,omitempty"`
}
// SrvRecord is an SRV record.
type SrvRecord struct {
- Priority *int `json:"priority,omitempty"`
- Weight *int `json:"weight,omitempty"`
- Port *int `json:"port,omitempty"`
+ Priority *int32 `json:"priority,omitempty"`
+ Weight *int32 `json:"weight,omitempty"`
+ Port *int32 `json:"port,omitempty"`
Target *string `json:"target,omitempty"`
}
@@ -168,9 +324,13 @@
Properties *ZoneProperties `json:"properties,omitempty"`
}
-// ZoneCreateOrUpdateParameters is parameters supplied to create a zone.
-type ZoneCreateOrUpdateParameters struct {
- Zone *Zone `json:"Zone,omitempty"`
+// ZoneDeleteResult is the response to a Zone Delete operation.
+type ZoneDeleteResult struct {
+ autorest.Response `json:"-"`
+ AzureAsyncOperation *string `json:"azureAsyncOperation,omitempty"`
+ Status OperationStatus `json:"status,omitempty"`
+ StatusCode HtpStatusCode `json:"statusCode,omitempty"`
+ RequestID *string `json:"requestId,omitempty"`
}
// ZoneListResult is the response to a Zone List or ListAll operation.
@@ -180,8 +340,21 @@
NextLink *string `json:"nextLink,omitempty"`
}
+// ZoneListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ZoneListResult) ZoneListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
// ZoneProperties is represents the properties of the zone.
type ZoneProperties struct {
- MaxNumberOfRecordSets *int32 `json:"maxNumberOfRecordSets,omitempty"`
- NumberOfRecordSets *int32 `json:"numberOfRecordSets,omitempty"`
+ MaxNumberOfRecordSets *int64 `json:"maxNumberOfRecordSets,omitempty"`
+ NumberOfRecordSets *int64 `json:"numberOfRecordSets,omitempty"`
+ NameServers *[]string `json:"nameServers,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/recordsets.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/recordsets.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/recordsets.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/recordsets.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,17 +14,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// RecordSetsClient is the client for managing DNS zones and record.
+// RecordSetsClient is the client for the RecordSets methods of the Dns
+// service.
type RecordSetsClient struct {
ManagementClient
}
@@ -40,64 +41,72 @@
return RecordSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// CreateOrUpdate creates a RecordSet within a DNS zone.
+// CreateOrUpdate creates or Updates a RecordSet within a DNS zone.
//
// resourceGroupName is the name of the resource group. zoneName is the name
-// of the zone without a terminating dot. recordType is the type of DNS
-// record. Possible values for this parameter include: 'A', 'AAAA', 'CNAME',
-// 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' relativeRecordSetName is the name
-// of the RecordSet, relative to the name of the zone. parameters is
-// parameters supplied to the CreateOrUpdate operation. ifMatch is the etag
-// of RecordSet. ifNoneMatch is defines the If-None-Match condition. Set to
-// '*' to force Create-If-Not-Exist. Other values will be ignored.
-func (client RecordSetsClient) CreateOrUpdate(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSetCreateOrUpdateParameters, ifMatch string, ifNoneMatch string) (result RecordSet, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, zoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch)
+// of the zone without a terminating dot. relativeRecordSetName is the name
+// of the RecordSet, relative to the name of the zone. recordType is the type
+// of DNS record. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS',
+// 'PTR', 'SOA', 'SRV', 'TXT' parameters is parameters supplied to the
+// CreateOrUpdate operation. ifMatch is the etag of Recordset. ifNoneMatch is
+// defines the If-None-Match condition. Set to '*' to force
+// Create-If-Not-Exist. Other values will be ignored.
+func (client RecordSetsClient) CreateOrUpdate(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/RecordSetsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client RecordSetsClient) CreateOrUpdatePreparer(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSetCreateOrUpdateParameters, ifMatch string, ifNoneMatch string) (*http.Request, error) {
+func (client RecordSetsClient) CreateOrUpdatePreparer(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "recordType": url.QueryEscape(string(recordType)),
+ "recordType": autorest.Encode("path", recordType),
"relativeRecordSetName": relativeRecordSetName,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ if len(ifMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-Match", autorest.String(ifMatch)))
+ }
+ if len(ifNoneMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
+ }
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -106,7 +115,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -116,59 +125,68 @@
// Delete removes a RecordSet from a DNS zone.
//
// resourceGroupName is the name of the resource group. zoneName is the name
-// of the zone without a terminating dot. recordType is the type of DNS
-// record. Possible values for this parameter include: 'A', 'AAAA', 'CNAME',
-// 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' relativeRecordSetName is the name
-// of the RecordSet, relative to the name of the zone. ifMatch is defines the
-// If-Match condition. The delete operation will be performed only if the
-// ETag of the zone on the server matches this value.
-func (client RecordSetsClient) Delete(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, ifMatch string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, zoneName, recordType, relativeRecordSetName, ifMatch)
+// of the zone without a terminating dot. relativeRecordSetName is the name
+// of the RecordSet, relative to the name of the zone. recordType is the type
+// of DNS record. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS',
+// 'PTR', 'SOA', 'SRV', 'TXT' ifMatch is defines the If-Match condition. The
+// delete operation will be performed only if the ETag of the zone on the
+// server matches this value. ifNoneMatch is defines the If-None-Match
+// condition. The delete operation will be performed only if the ETag of the
+// zone on the server does not match this value.
+func (client RecordSetsClient) Delete(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string, ifNoneMatch string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch, ifNoneMatch)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client RecordSetsClient) DeletePreparer(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, ifMatch string) (*http.Request, error) {
+func (client RecordSetsClient) DeletePreparer(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string, ifNoneMatch string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "recordType": url.QueryEscape(string(recordType)),
+ "recordType": autorest.Encode("path", recordType),
"relativeRecordSetName": relativeRecordSetName,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ if len(ifMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-Match", autorest.String(ifMatch)))
+ }
+ if len(ifNoneMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
+ }
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -177,7 +195,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -186,57 +204,56 @@
// Get gets a RecordSet.
//
// resourceGroupName is the name of the resource group. zoneName is the name
-// of the zone without a terminating dot. recordType is the type of DNS
-// record. Possible values for this parameter include: 'A', 'AAAA', 'CNAME',
-// 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' relativeRecordSetName is the name
-// of the RecordSet, relative to the name of the zone.
-func (client RecordSetsClient) Get(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string) (result RecordSet, ae error) {
- req, err := client.GetPreparer(resourceGroupName, zoneName, recordType, relativeRecordSetName)
+// of the zone without a terminating dot. relativeRecordSetName is the name
+// of the RecordSet, relative to the name of the zone. recordType is the type
+// of DNS record. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS',
+// 'PTR', 'SOA', 'SRV', 'TXT'
+func (client RecordSetsClient) Get(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) {
+ req, err := client.GetPreparer(resourceGroupName, zoneName, relativeRecordSetName, recordType)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/RecordSetsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client RecordSetsClient) GetPreparer(resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string) (*http.Request, error) {
+func (client RecordSetsClient) GetPreparer(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "recordType": url.QueryEscape(string(recordType)),
+ "recordType": autorest.Encode("path", recordType),
"relativeRecordSetName": relativeRecordSetName,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -245,154 +262,275 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// List lists the RecordSets of a specified type in a DNS zone.
+// ListAllInResourceGroup lists all RecordSets in a DNS zone.
//
// resourceGroupName is the name of the resource group that contains the zone.
-// zoneName is the name of the zone from which to enumerate RecordsSets.
-// recordType is the type of record sets to enumerate. Possible values for
-// this parameter include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA',
-// 'SRV', 'TXT' top is query parameters. If null is passed returns the
-// default number of zones. filter is the filter to apply on the operation.
-func (client RecordSetsClient) List(resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (result RecordSetListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, zoneName, recordType, top, filter)
+// zoneName is the name of the zone from which to enumerate RecordSets. top
+// is query parameters. If null is passed returns the default number of
+// zones.
+func (client RecordSetsClient) ListAllInResourceGroup(resourceGroupName string, zoneName string, top string) (result RecordSetListResult, err error) {
+ req, err := client.ListAllInResourceGroupPreparer(resourceGroupName, zoneName, top)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", nil, "Failure preparing request")
}
- resp, err := client.ListSender(req)
+ resp, err := client.ListAllInResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", resp, "Failure sending request")
}
- result, err = client.ListResponder(resp)
+ result, err = client.ListAllInResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/RecordSetsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", resp, "Failure responding to request")
}
return
}
-// ListPreparer prepares the List request.
-func (client RecordSetsClient) ListPreparer(resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (*http.Request, error) {
+// ListAllInResourceGroupPreparer prepares the ListAllInResourceGroup request.
+func (client RecordSetsClient) ListAllInResourceGroupPreparer(resourceGroupName string, zoneName string, top string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "recordType": url.QueryEscape(string(recordType)),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(top) > 0 {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$top"] = autorest.Encode("query", top)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/recordsets", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSender sends the List request. The method will close the
+// ListAllInResourceGroupSender sends the ListAllInResourceGroup request. The method will close the
// http.Response Body if it receives an error.
-func (client RecordSetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client RecordSetsClient) ListAllInResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListResponder handles the response to the List request. The method always
+// ListAllInResourceGroupResponder handles the response to the ListAllInResourceGroup request. The method always
// closes the http.Response Body.
-func (client RecordSetsClient) ListResponder(resp *http.Response) (result RecordSetListResult, err error) {
+func (client RecordSetsClient) ListAllInResourceGroupResponder(resp *http.Response) (result RecordSetListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListAll lists all RecordSets in a DNS zone.
+// ListAllInResourceGroupNextResults retrieves the next set of results, if any.
+func (client RecordSetsClient) ListAllInResourceGroupNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
+ req, err := lastResults.RecordSetListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAllInResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAllInResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllInResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListByType lists the RecordSets of a specified type in a DNS zone.
//
// resourceGroupName is the name of the resource group that contains the zone.
-// zoneName is the name of the zone from which to enumerate RecordSets. top
+// zoneName is the name of the zone from which to enumerate RecordsSets.
+// recordType is the type of record sets to enumerate. Possible values
+// include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' top
// is query parameters. If null is passed returns the default number of
-// zones. filter is the filter to apply on the operation.
-func (client RecordSetsClient) ListAll(resourceGroupName string, zoneName string, top string, filter string) (result RecordSetListResult, ae error) {
- req, err := client.ListAllPreparer(resourceGroupName, zoneName, top, filter)
+// zones.
+func (client RecordSetsClient) ListByType(resourceGroupName string, zoneName string, recordType RecordType, top string) (result RecordSetListResult, err error) {
+ req, err := client.ListByTypePreparer(resourceGroupName, zoneName, recordType, top)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", nil, "Failure preparing request")
}
- resp, err := client.ListAllSender(req)
+ resp, err := client.ListByTypeSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/RecordSetsClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure sending request")
}
- result, err = client.ListAllResponder(resp)
+ result, err = client.ListByTypeResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/RecordSetsClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure responding to request")
}
return
}
-// ListAllPreparer prepares the ListAll request.
-func (client RecordSetsClient) ListAllPreparer(resourceGroupName string, zoneName string, top string, filter string) (*http.Request, error) {
+// ListByTypePreparer prepares the ListByType request.
+func (client RecordSetsClient) ListByTypePreparer(resourceGroupName string, zoneName string, recordType RecordType, top string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "recordType": autorest.Encode("path", recordType),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(top) > 0 {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByTypeSender sends the ListByType request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecordSetsClient) ListByTypeSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByTypeResponder handles the response to the ListByType request. The method always
+// closes the http.Response Body.
+func (client RecordSetsClient) ListByTypeResponder(resp *http.Response) (result RecordSetListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByTypeNextResults retrieves the next set of results, if any.
+func (client RecordSetsClient) ListByTypeNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
+ req, err := lastResults.RecordSetListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", nil, "Failure preparing next results request request")
}
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ if req == nil {
+ return
}
- return autorest.Prepare(&http.Request{},
+ resp, err := client.ListByTypeSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListByTypeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Update updates a RecordSet within a DNS zone.
+//
+// resourceGroupName is the name of the resource group. zoneName is the name
+// of the zone without a terminating dot. relativeRecordSetName is the name
+// of the RecordSet, relative to the name of the zone. recordType is the type
+// of DNS record. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS',
+// 'PTR', 'SOA', 'SRV', 'TXT' parameters is parameters supplied to the Update
+// operation. ifMatch is the etag of Zone. ifNoneMatch is defines the
+// If-None-Match condition. Set to '*' to force Create-If-Not-Exist. Other
+// values will be ignored.
+func (client RecordSetsClient) Update(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client RecordSetsClient) UpdatePreparer(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "recordType": autorest.Encode("path", recordType),
+ "relativeRecordSetName": relativeRecordSetName,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
- autorest.AsGet(),
+ autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/recordsets"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
+ autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
+ if len(ifMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-Match", autorest.String(ifMatch)))
+ }
+ if len(ifNoneMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
+ }
+ return preparer.Prepare(&http.Request{})
}
-// ListAllSender sends the ListAll request. The method will close the
+// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
-func (client RecordSetsClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client RecordSetsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListAllResponder handles the response to the ListAll request. The method always
+// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
-func (client RecordSetsClient) ListAllResponder(resp *http.Response) (result RecordSetListResult, err error) {
+func (client RecordSetsClient) UpdateResponder(resp *http.Response) (result RecordSet, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "dns", "2015-11-01")
+ return fmt.Sprintf(userAgentFormat, Version(), "dns", "2016-04-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/zones.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/zones.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/dns/zones.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/dns/zones.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,17 +14,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ZonesClient is the client for managing DNS zones and record.
+// ZonesClient is the client for the Zones methods of the Dns service.
type ZonesClient struct {
ManagementClient
}
@@ -39,59 +39,67 @@
return ZonesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// CreateOrUpdate creates a DNS zone within a resource group.
+// CreateOrUpdate creates or Updates a DNS zone within a resource group.
//
// resourceGroupName is the name of the resource group. zoneName is the name
// of the zone without a terminating dot. parameters is parameters supplied
// to the CreateOrUpdate operation. ifMatch is the etag of Zone. ifNoneMatch
// is defines the If-None-Match condition. Set to '*' to force
// Create-If-Not-Exist. Other values will be ignored.
-func (client ZonesClient) CreateOrUpdate(resourceGroupName string, zoneName string, parameters ZoneCreateOrUpdateParameters, ifMatch string, ifNoneMatch string) (result Zone, ae error) {
+func (client ZonesClient) CreateOrUpdate(resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/ZonesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ZonesClient) CreateOrUpdatePreparer(resourceGroupName string, zoneName string, parameters ZoneCreateOrUpdateParameters, ifMatch string, ifNoneMatch string) (*http.Request, error) {
+func (client ZonesClient) CreateOrUpdatePreparer(resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ if len(ifMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-Match", autorest.String(ifMatch)))
+ }
+ if len(ifNoneMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
+ }
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ZonesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -100,64 +108,78 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// Delete removes a DNS zone from a resource group.
+// Delete removes a DNS zone from a resource group. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. zoneName is the name
// of the zone without a terminating dot. ifMatch is defines the If-Match
// condition. The delete operation will be performed only if the ETag of the
-// zone on the server matches this value.
-func (client ZonesClient) Delete(resourceGroupName string, zoneName string, ifMatch string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, zoneName, ifMatch)
+// zone on the server matches this value. ifNoneMatch is defines the
+// If-None-Match condition. The delete operation will be performed only if
+// the ETag of the zone on the server does not match this value.
+func (client ZonesClient) Delete(resourceGroupName string, zoneName string, ifMatch string, ifNoneMatch string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, zoneName, ifMatch, ifNoneMatch, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/ZonesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client ZonesClient) DeletePreparer(resourceGroupName string, zoneName string, ifMatch string) (*http.Request, error) {
+func (client ZonesClient) DeletePreparer(resourceGroupName string, zoneName string, ifMatch string, ifNoneMatch string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ if len(ifMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-Match", autorest.String(ifMatch)))
+ }
+ if len(ifNoneMatch) > 0 {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
+ }
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ZonesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -166,7 +188,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -176,21 +198,21 @@
//
// resourceGroupName is the name of the resource group. zoneName is the name
// of the zone without a terminating dot.
-func (client ZonesClient) Get(resourceGroupName string, zoneName string) (result Zone, ae error) {
+func (client ZonesClient) Get(resourceGroupName string, zoneName string) (result Zone, err error) {
req, err := client.GetPreparer(resourceGroupName, zoneName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/ZonesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", resp, "Failure responding to request")
}
return
@@ -199,28 +221,27 @@
// GetPreparer prepares the Get request.
func (client ZonesClient) GetPreparer(resourceGroupName string, zoneName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "zoneName": url.QueryEscape(zoneName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "zoneName": autorest.Encode("path", zoneName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ZonesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -229,147 +250,186 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListZonesInResourceGroup lists the DNS zones within a resource group.
+// ListInResourceGroup lists the DNS zones within a resource group.
//
// resourceGroupName is the name of the resource group. top is query
-// parameters. If null is passed returns the default number of zones. filter
-// is the filter to apply on the operation.
-func (client ZonesClient) ListZonesInResourceGroup(resourceGroupName string, top string, filter string) (result ZoneListResult, ae error) {
- req, err := client.ListZonesInResourceGroupPreparer(resourceGroupName, top, filter)
+// parameters. If null is passed returns the default number of zones.
+func (client ZonesClient) ListInResourceGroup(resourceGroupName string, top string) (result ZoneListResult, err error) {
+ req, err := client.ListInResourceGroupPreparer(resourceGroupName, top)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInResourceGroup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", nil, "Failure preparing request")
}
- resp, err := client.ListZonesInResourceGroupSender(req)
+ resp, err := client.ListInResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInResourceGroup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", resp, "Failure sending request")
}
- result, err = client.ListZonesInResourceGroupResponder(resp)
+ result, err = client.ListInResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInResourceGroup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", resp, "Failure responding to request")
}
return
}
-// ListZonesInResourceGroupPreparer prepares the ListZonesInResourceGroup request.
-func (client ZonesClient) ListZonesInResourceGroupPreparer(resourceGroupName string, top string, filter string) (*http.Request, error) {
+// ListInResourceGroupPreparer prepares the ListInResourceGroup request.
+func (client ZonesClient) ListInResourceGroupPreparer(resourceGroupName string, top string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(top) > 0 {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$top"] = autorest.Encode("query", top)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListZonesInResourceGroupSender sends the ListZonesInResourceGroup request. The method will close the
+// ListInResourceGroupSender sends the ListInResourceGroup request. The method will close the
// http.Response Body if it receives an error.
-func (client ZonesClient) ListZonesInResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client ZonesClient) ListInResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListZonesInResourceGroupResponder handles the response to the ListZonesInResourceGroup request. The method always
+// ListInResourceGroupResponder handles the response to the ListInResourceGroup request. The method always
// closes the http.Response Body.
-func (client ZonesClient) ListZonesInResourceGroupResponder(resp *http.Response) (result ZoneListResult, err error) {
+func (client ZonesClient) ListInResourceGroupResponder(resp *http.Response) (result ZoneListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListZonesInSubscription lists the DNS zones within a resource group.
+// ListInResourceGroupNextResults retrieves the next set of results, if any.
+func (client ZonesClient) ListInResourceGroupNextResults(lastResults ZoneListResult) (result ZoneListResult, err error) {
+ req, err := lastResults.ZoneListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListInResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListInResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListInSubscription lists the DNS zones within a resource group.
//
// top is query parameters. If null is passed returns the default number of
-// zones. filter is the filter to apply on the operation.
-func (client ZonesClient) ListZonesInSubscription(top string, filter string) (result ZoneListResult, ae error) {
- req, err := client.ListZonesInSubscriptionPreparer(top, filter)
+// zones.
+func (client ZonesClient) ListInSubscription(top string) (result ZoneListResult, err error) {
+ req, err := client.ListInSubscriptionPreparer(top)
if err != nil {
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInSubscription", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", nil, "Failure preparing request")
}
- resp, err := client.ListZonesInSubscriptionSender(req)
+ resp, err := client.ListInSubscriptionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInSubscription", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", resp, "Failure sending request")
}
- result, err = client.ListZonesInSubscriptionResponder(resp)
+ result, err = client.ListInSubscriptionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "dns/ZonesClient", "ListZonesInSubscription", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", resp, "Failure responding to request")
}
return
}
-// ListZonesInSubscriptionPreparer prepares the ListZonesInSubscription request.
-func (client ZonesClient) ListZonesInSubscriptionPreparer(top string, filter string) (*http.Request, error) {
+// ListInSubscriptionPreparer prepares the ListInSubscription request.
+func (client ZonesClient) ListInSubscriptionPreparer(top string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(top) > 0 {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$top"] = autorest.Encode("query", top)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListZonesInSubscriptionSender sends the ListZonesInSubscription request. The method will close the
+// ListInSubscriptionSender sends the ListInSubscription request. The method will close the
// http.Response Body if it receives an error.
-func (client ZonesClient) ListZonesInSubscriptionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client ZonesClient) ListInSubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListZonesInSubscriptionResponder handles the response to the ListZonesInSubscription request. The method always
+// ListInSubscriptionResponder handles the response to the ListInSubscription request. The method always
// closes the http.Response Body.
-func (client ZonesClient) ListZonesInSubscriptionResponder(resp *http.Response) (result ZoneListResult, err error) {
+func (client ZonesClient) ListInSubscriptionResponder(resp *http.Response) (result ZoneListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+
+// ListInSubscriptionNextResults retrieves the next set of results, if any.
+func (client ZonesClient) ListInSubscriptionNextResults(lastResults ZoneListResult) (result ZoneListResult, err error) {
+ req, err := lastResults.ZoneListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListInSubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListInSubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListInSubscription", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/check.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/check.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/check.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/check.go 2016-10-13 14:32:06.000000000 +0000
@@ -6,11 +6,11 @@
"net/http"
"os"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/azure-sdk-for-go/arm/examples/helpers"
"github.com/Azure/azure-sdk-for-go/arm/storage"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/to"
)
func withInspection() autorest.PrepareDecorator {
@@ -39,7 +39,7 @@
ac := storage.NewAccountsClient(c["subscriptionID"])
- spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.AzureResourceManagerScope)
+ spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.PublicCloud.ResourceManagerEndpoint)
if err != nil {
log.Fatalf("Error: %v", err)
}
@@ -50,7 +50,6 @@
ac.RequestInspector = withInspection()
ac.ResponseInspector = byInspecting()
-
cna, err := ac.CheckNameAvailability(
storage.AccountCheckNameAvailabilityParameters{
Name: to.StringPtr(name),
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/create.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/create.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/create.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/create.go 2016-10-13 14:32:06.000000000 +0000
@@ -3,33 +3,13 @@
import (
"fmt"
"log"
- "net/http"
- "time"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/azure-sdk-for-go/arm/examples/helpers"
"github.com/Azure/azure-sdk-for-go/arm/storage"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/to"
)
-func withWatcher() autorest.SendDecorator {
- return func(s autorest.Sender) autorest.Sender {
- return autorest.SenderFunc(func(r *http.Request) (*http.Response, error) {
- fmt.Printf("Sending %s %s\n", r.Method, r.URL)
- resp, err := s.Do(r)
- fmt.Printf("...received status %s\n", resp.Status)
- if autorest.ResponseRequiresPolling(resp) {
- fmt.Printf("...will poll after %d seconds\n",
- int(autorest.GetPollingDelay(resp, time.Duration(0))/time.Second))
- fmt.Printf("...will poll at %s\n", autorest.GetPollingLocation(resp))
- }
- fmt.Println("")
- return resp, err
- })
- }
-}
-
func createAccount(resourceGroup, name string) {
c, err := helpers.LoadCredentials()
if err != nil {
@@ -38,7 +18,7 @@
ac := storage.NewAccountsClient(c["subscriptionID"])
- spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.AzureResourceManagerScope)
+ spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.PublicCloud.ResourceManagerEndpoint)
if err != nil {
log.Fatalf("Error: %v", err)
}
@@ -58,30 +38,18 @@
}
fmt.Printf("%s is available\n\n", name)
- ac.Sender = autorest.CreateSender(withWatcher())
- ac.PollingMode = autorest.PollUntilAttempts
- ac.PollingAttempts = 5
-
- cp := storage.AccountCreateParameters{}
+ cp := storage.AccountCreateParameters{Sku: &storage.Sku{Name: storage.StandardLRS, Tier: storage.Standard}}
cp.Location = to.StringPtr("westus")
- cp.Properties = &storage.AccountPropertiesCreateParameters{AccountType: storage.StandardLRS}
- sa, err := ac.Create(resourceGroup, name, cp)
+ cancel := make(chan struct{})
+ _, err = ac.Create(resourceGroup, name, cp, cancel)
if err != nil {
- if sa.Response.StatusCode != http.StatusAccepted {
- fmt.Printf("Creation of %s.%s failed with err -- %v\n", resourceGroup, name, err)
- return
- }
- fmt.Printf("Create initiated for %s.%s -- poll %s to check status\n",
- resourceGroup,
- name,
- sa.GetPollingLocation())
+ fmt.Printf("Create failed: %v\n", err)
return
}
fmt.Printf("Successfully created %s.%s\n\n", resourceGroup, name)
- ac.Sender = nil
r, err := ac.Delete(resourceGroup, name)
if err != nil {
fmt.Printf("Delete of %s.%s failed with status %s\n...%v\n", resourceGroup, name, r.Status, err)
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/helpers/helpers.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/helpers/helpers.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/examples/helpers/helpers.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/examples/helpers/helpers.go 2016-10-13 14:32:06.000000000 +0000
@@ -7,7 +7,7 @@
"os"
"os/user"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/azure"
)
const (
@@ -24,7 +24,11 @@
// NewServicePrincipalTokenFromCredentials creates a new ServicePrincipalToken using values of the
// passed credentials map.
func NewServicePrincipalTokenFromCredentials(c map[string]string, scope string) (*azure.ServicePrincipalToken, error) {
- return azure.NewServicePrincipalToken(c["clientID"], c["clientSecret"], c["tenantID"], scope)
+ oauthConfig, err := azure.PublicCloud.OAuthConfigForTenant(c["tenantID"])
+ if err != nil {
+ panic(err)
+ }
+ return azure.NewServicePrincipalToken(*oauthConfig, c["clientID"], c["clientSecret"], scope)
}
// LoadCredentials reads credentials from a ~/.azure/credentials.json file. See the accompanying
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/client.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,352 +0,0 @@
-package features
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-const (
- // APIVersion is the version of the Features
- APIVersion = "2014-08-01-preview"
-
- // DefaultBaseURI is the default URI used for the service Features
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// ManagementClient is the base client for Features.
-type ManagementClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the ManagementClient client.
-func New(subscriptionID string) ManagementClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the ManagementClient client.
-func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
- return ManagementClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
-
-// Get get all features under the subscription.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-// featureName is previewed feature name in the resource provider.
-func (client ManagementClient) Get(resourceProviderNamespace string, featureName string) (result FeatureResult, ae error) {
- req, err := client.GetPreparer(resourceProviderNamespace, featureName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ManagementClient) GetPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "featureName": url.QueryEscape(featureName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) GetResponder(resp *http.Response) (result FeatureResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of previewed features of a resource provider.
-//
-// resourceProviderNamespace is the namespace of the resource provider.
-func (client ManagementClient) List(resourceProviderNamespace string) (result FeatureOperationsListResult, ae error) {
- req, err := client.ListPreparer(resourceProviderNamespace)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ManagementClient) ListPreparer(resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) ListResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 ManagementClient) ListNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, ae error) {
- req, err := lastResults.FeatureOperationsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListAll gets a list of previewed features for all the providers in the
-// current subscription.
-func (client ManagementClient) ListAll() (result FeatureOperationsListResult, ae error) {
- req, err := client.ListAllPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure preparing request")
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure sending request")
- }
-
- result, err = client.ListAllResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure responding to request")
- }
-
- return
-}
-
-// ListAllPreparer prepares the ListAll request.
-func (client ManagementClient) ListAllPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/features"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListAllSender sends the ListAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListAllResponder handles the response to the ListAll request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) ListAllResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAllNextResults retrieves the next set of results, if any.
-func (client ManagementClient) ListAllNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, ae error) {
- req, err := lastResults.FeatureOperationsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure sending next results request request")
- }
-
- result, err = client.ListAllResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "ListAll", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Register registers for a previewed feature of a resource provider.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-// featureName is previewed feature name in the resource provider.
-func (client ManagementClient) Register(resourceProviderNamespace string, featureName string) (result FeatureResult, ae error) {
- req, err := client.RegisterPreparer(resourceProviderNamespace, featureName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "Register", "Failure preparing request")
- }
-
- resp, err := client.RegisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/ManagementClient", "Register", "Failure sending request")
- }
-
- result, err = client.RegisterResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/ManagementClient", "Register", "Failure responding to request")
- }
-
- return
-}
-
-// RegisterPreparer prepares the Register request.
-func (client ManagementClient) RegisterPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "featureName": url.QueryEscape(featureName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RegisterSender sends the Register request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) RegisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// RegisterResponder handles the response to the Register request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) RegisterResponder(resp *http.Response) (result FeatureResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/features.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/features.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/features.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/features.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,338 +0,0 @@
-package features
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// Client is the client for the Features methods of the Features service.
-type Client struct {
- ManagementClient
-}
-
-// NewClient creates an instance of the Client client.
-func NewClient(subscriptionID string) Client {
- return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewClientWithBaseURI creates an instance of the Client client.
-func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
- return Client{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get get all features under the subscription.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-// featureName is previewed feature name in the resource provider.
-func (client Client) Get(resourceProviderNamespace string, featureName string) (result FeatureResult, ae error) {
- req, err := client.GetPreparer(resourceProviderNamespace, featureName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client Client) GetPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "featureName": url.QueryEscape(featureName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client Client) GetResponder(resp *http.Response) (result FeatureResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of previewed features of a resource provider.
-//
-// resourceProviderNamespace is the namespace of the resource provider.
-func (client Client) List(resourceProviderNamespace string) (result FeatureOperationsListResult, ae error) {
- req, err := client.ListPreparer(resourceProviderNamespace)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client Client) ListPreparer(resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client Client) ListResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client Client) ListNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, ae error) {
- req, err := lastResults.FeatureOperationsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListAll gets a list of previewed features for all the providers in the
-// current subscription.
-func (client Client) ListAll() (result FeatureOperationsListResult, ae error) {
- req, err := client.ListAllPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure preparing request")
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure sending request")
- }
-
- result, err = client.ListAllResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure responding to request")
- }
-
- return
-}
-
-// ListAllPreparer prepares the ListAll request.
-func (client Client) ListAllPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/features"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListAllSender sends the ListAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListAllResponder handles the response to the ListAll request. The method always
-// closes the http.Response Body.
-func (client Client) ListAllResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAllNextResults retrieves the next set of results, if any.
-func (client Client) ListAllNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, ae error) {
- req, err := lastResults.FeatureOperationsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure sending next results request request")
- }
-
- result, err = client.ListAllResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "ListAll", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Register registers for a previewed feature of a resource provider.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-// featureName is previewed feature name in the resource provider.
-func (client Client) Register(resourceProviderNamespace string, featureName string) (result FeatureResult, ae error) {
- req, err := client.RegisterPreparer(resourceProviderNamespace, featureName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "features/Client", "Register", "Failure preparing request")
- }
-
- resp, err := client.RegisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "features/Client", "Register", "Failure sending request")
- }
-
- result, err = client.RegisterResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "features/Client", "Register", "Failure responding to request")
- }
-
- return
-}
-
-// RegisterPreparer prepares the Register request.
-func (client Client) RegisterPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "featureName": url.QueryEscape(featureName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RegisterSender sends the Register request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) RegisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// RegisterResponder handles the response to the Register request. The method always
-// closes the http.Response Body.
-func (client Client) RegisterResponder(resp *http.Response) (result FeatureResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/models.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,90 +0,0 @@
-package features
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
- "net/http"
-)
-
-// DeploymentExtendedFilter is deployment filter.
-type DeploymentExtendedFilter struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// FeatureOperationsListResult is list of previewed features.
-type FeatureOperationsListResult struct {
- autorest.Response `json:"-"`
- Value *[]FeatureResult `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// FeatureOperationsListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client FeatureOperationsListResult) FeatureOperationsListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// FeatureProperties is previewed feature information.
-type FeatureProperties struct {
- State *string `json:"state,omitempty"`
-}
-
-// FeatureResult is previewed feature information.
-type FeatureResult struct {
- autorest.Response `json:"-"`
- Name *string `json:"name,omitempty"`
- Properties *FeatureProperties `json:"properties,omitempty"`
- ID *string `json:"id,omitempty"`
- Type *string `json:"type,omitempty"`
-}
-
-// GenericResourceFilter is resource filter.
-type GenericResourceFilter struct {
- ResourceType *string `json:"resourceType,omitempty"`
- Tagname *string `json:"tagname,omitempty"`
- Tagvalue *string `json:"tagvalue,omitempty"`
-}
-
-// Resource is
-type Resource struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
-
-// ResourceGroupFilter is resource group filter.
-type ResourceGroupFilter struct {
- TagName *string `json:"tagName,omitempty"`
- TagValue *string `json:"tagValue,omitempty"`
-}
-
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/features/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/features/version.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,43 +0,0 @@
-package features
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "fmt"
-)
-
-const (
- major = "0"
- minor = "3"
- patch = "0"
- // Always begin a "tag" with a dash (as per http://semver.org)
- tag = "-beta"
- semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
-)
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "features", "2014-08-01-preview")
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/android.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/android.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/android.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/android.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,827 @@
+package intune
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AndroidClient is the microsoft.Intune Resource provider Api features in the
+// swagger-2.0 specification
+type AndroidClient struct {
+ ManagementClient
+}
+
+// NewAndroidClient creates an instance of the AndroidClient client.
+func NewAndroidClient() AndroidClient {
+ return NewAndroidClientWithBaseURI(DefaultBaseURI)
+}
+
+// NewAndroidClientWithBaseURI creates an instance of the AndroidClient client.
+func NewAndroidClientWithBaseURI(baseURI string) AndroidClient {
+ return AndroidClient{NewWithBaseURI(baseURI)}
+}
+
+// AddAppForMAMPolicy add app to an AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy appName is application unique Name parameters is parameters
+// supplied to the Create or update app to an android policy operation.
+func (client AndroidClient) AddAppForMAMPolicy(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
+ req, err := client.AddAppForMAMPolicyPreparer(hostName, policyName, appName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.AddAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddAppForMAMPolicyPreparer prepares the AddAppForMAMPolicy request.
+func (client AndroidClient) AddAppForMAMPolicyPreparer(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/apps/{appName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddAppForMAMPolicySender sends the AddAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) AddAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddAppForMAMPolicyResponder handles the response to the AddAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) AddAppForMAMPolicyResponder(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
+}
+
+// AddGroupForMAMPolicy add group to an AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy groupID is group Id parameters is parameters supplied to the
+// Create or update app to an android policy operation.
+func (client AndroidClient) AddGroupForMAMPolicy(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
+ req, err := client.AddGroupForMAMPolicyPreparer(hostName, policyName, groupID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddGroupForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.AddGroupForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "AddGroupForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddGroupForMAMPolicyPreparer prepares the AddGroupForMAMPolicy request.
+func (client AndroidClient) AddGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "groupId": autorest.Encode("path", groupID),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups/{groupId}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddGroupForMAMPolicySender sends the AddGroupForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) AddGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddGroupForMAMPolicyResponder handles the response to the AddGroupForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) AddGroupForMAMPolicyResponder(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
+}
+
+// CreateOrUpdateMAMPolicy creates or updates AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy parameters is parameters supplied to the Create or update an
+// android policy operation.
+func (client AndroidClient) CreateOrUpdateMAMPolicy(hostName string, policyName string, parameters AndroidMAMPolicy) (result AndroidMAMPolicy, err error) {
+ req, err := client.CreateOrUpdateMAMPolicyPreparer(hostName, policyName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "CreateOrUpdateMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateMAMPolicyPreparer prepares the CreateOrUpdateMAMPolicy request.
+func (client AndroidClient) CreateOrUpdateMAMPolicyPreparer(hostName string, policyName string, parameters AndroidMAMPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateMAMPolicySender sends the CreateOrUpdateMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) CreateOrUpdateMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateMAMPolicyResponder handles the response to the CreateOrUpdateMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) CreateOrUpdateMAMPolicyResponder(resp *http.Response) (result AndroidMAMPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteAppForMAMPolicy delete App for Android Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy appName is application unique Name
+func (client AndroidClient) DeleteAppForMAMPolicy(hostName string, policyName string, appName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAppForMAMPolicyPreparer(hostName, policyName, appName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAppForMAMPolicyPreparer prepares the DeleteAppForMAMPolicy request.
+func (client AndroidClient) DeleteAppForMAMPolicyPreparer(hostName string, policyName string, appName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/apps/{appName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAppForMAMPolicySender sends the DeleteAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) DeleteAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAppForMAMPolicyResponder handles the response to the DeleteAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) DeleteAppForMAMPolicyResponder(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
+}
+
+// DeleteGroupForMAMPolicy delete Group for Android Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy groupID is application unique Name
+func (client AndroidClient) DeleteGroupForMAMPolicy(hostName string, policyName string, groupID string) (result autorest.Response, err error) {
+ req, err := client.DeleteGroupForMAMPolicyPreparer(hostName, policyName, groupID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteGroupForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteGroupForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteGroupForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteGroupForMAMPolicyPreparer prepares the DeleteGroupForMAMPolicy request.
+func (client AndroidClient) DeleteGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "groupId": autorest.Encode("path", groupID),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups/{groupId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteGroupForMAMPolicySender sends the DeleteGroupForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) DeleteGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteGroupForMAMPolicyResponder handles the response to the DeleteGroupForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) DeleteGroupForMAMPolicyResponder(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
+}
+
+// DeleteMAMPolicy delete Android Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy
+func (client AndroidClient) DeleteMAMPolicy(hostName string, policyName string) (result autorest.Response, err error) {
+ req, err := client.DeleteMAMPolicyPreparer(hostName, policyName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "DeleteMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteMAMPolicyPreparer prepares the DeleteMAMPolicy request.
+func (client AndroidClient) DeleteMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteMAMPolicySender sends the DeleteMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) DeleteMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteMAMPolicyResponder handles the response to the DeleteMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) DeleteMAMPolicyResponder(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
+}
+
+// GetAppForMAMPolicy get apps for an AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy filter is the filter to apply on the operation. selectParameter
+// is select specific fields in entity.
+func (client AndroidClient) GetAppForMAMPolicy(hostName string, policyName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
+ req, err := client.GetAppForMAMPolicyPreparer(hostName, policyName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAppForMAMPolicyPreparer prepares the GetAppForMAMPolicy request.
+func (client AndroidClient) GetAppForMAMPolicyPreparer(hostName string, policyName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/AndroidPolicies/{policyName}/apps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAppForMAMPolicySender sends the GetAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) GetAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAppForMAMPolicyResponder handles the response to the GetAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) GetAppForMAMPolicyResponder(resp *http.Response) (result ApplicationCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAppForMAMPolicyNextResults retrieves the next set of results, if any.
+func (client AndroidClient) GetAppForMAMPolicyNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
+ req, err := lastResults.ApplicationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetAppForMAMPolicy", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetGroupsForMAMPolicy returns groups for a given AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is policy name for
+// the tenant
+func (client AndroidClient) GetGroupsForMAMPolicy(hostName string, policyName string) (result GroupsCollection, err error) {
+ req, err := client.GetGroupsForMAMPolicyPreparer(hostName, policyName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetGroupsForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.GetGroupsForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetGroupsForMAMPolicyPreparer prepares the GetGroupsForMAMPolicy request.
+func (client AndroidClient) GetGroupsForMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}/groups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetGroupsForMAMPolicySender sends the GetGroupsForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) GetGroupsForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetGroupsForMAMPolicyResponder handles the response to the GetGroupsForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) GetGroupsForMAMPolicyResponder(resp *http.Response) (result GroupsCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetGroupsForMAMPolicyNextResults retrieves the next set of results, if any.
+func (client AndroidClient) GetGroupsForMAMPolicyNextResults(lastResults GroupsCollection) (result GroupsCollection, err error) {
+ req, err := lastResults.GroupsCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetGroupsForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetGroupsForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetGroupsForMAMPolicy", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMPolicies returns Intune Android policies.
+//
+// hostName is location hostName for the tenant filter is the filter to apply
+// on the operation. selectParameter is select specific fields in entity.
+func (client AndroidClient) GetMAMPolicies(hostName string, filter string, top *int32, selectParameter string) (result AndroidMAMPolicyCollection, err error) {
+ req, err := client.GetMAMPoliciesPreparer(hostName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMPoliciesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMPoliciesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMPoliciesPreparer prepares the GetMAMPolicies request.
+func (client AndroidClient) GetMAMPoliciesPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMPoliciesSender sends the GetMAMPolicies request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) GetMAMPoliciesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMPoliciesResponder handles the response to the GetMAMPolicies request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) GetMAMPoliciesResponder(resp *http.Response) (result AndroidMAMPolicyCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMPoliciesNextResults retrieves the next set of results, if any.
+func (client AndroidClient) GetMAMPoliciesNextResults(lastResults AndroidMAMPolicyCollection) (result AndroidMAMPolicyCollection, err error) {
+ req, err := lastResults.AndroidMAMPolicyCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMPoliciesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMPoliciesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicies", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMPolicyByName returns AndroidMAMPolicy with given name.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy selectParameter is select specific fields in entity.
+func (client AndroidClient) GetMAMPolicyByName(hostName string, policyName string, selectParameter string) (result AndroidMAMPolicy, err error) {
+ req, err := client.GetMAMPolicyByNamePreparer(hostName, policyName, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMPolicyByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMPolicyByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "GetMAMPolicyByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMPolicyByNamePreparer prepares the GetMAMPolicyByName request.
+func (client AndroidClient) GetMAMPolicyByNamePreparer(hostName string, policyName string, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMPolicyByNameSender sends the GetMAMPolicyByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) GetMAMPolicyByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMPolicyByNameResponder handles the response to the GetMAMPolicyByName request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) GetMAMPolicyByNameResponder(resp *http.Response) (result AndroidMAMPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// PatchMAMPolicy patch AndroidMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy parameters is parameters supplied to the Create or update an
+// android policy operation.
+func (client AndroidClient) PatchMAMPolicy(hostName string, policyName string, parameters AndroidMAMPolicy) (result AndroidMAMPolicy, err error) {
+ req, err := client.PatchMAMPolicyPreparer(hostName, policyName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.AndroidClient", "PatchMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchMAMPolicyPreparer prepares the PatchMAMPolicy request.
+func (client AndroidClient) PatchMAMPolicyPreparer(hostName string, policyName string, parameters AndroidMAMPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies/{policyName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchMAMPolicySender sends the PatchMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client AndroidClient) PatchMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchMAMPolicyResponder handles the response to the PatchMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client AndroidClient) PatchMAMPolicyResponder(resp *http.Response) (result AndroidMAMPolicy, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,945 @@
+// Package intune implements the Azure ARM Intune service API version
+// 2015-01-14-preview.
+//
+// Microsoft.Intune Resource provider Api features in the swagger-2.0
+// specification
+package intune
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Intune
+ APIVersion = "2015-01-14-preview"
+
+ // DefaultBaseURI is the default URI used for the service Intune
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Intune.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+}
+
+// New creates an instance of the ManagementClient client.
+func New() ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ }
+}
+
+// GetApps returns Intune Manageable apps.
+//
+// hostName is location hostName for the tenant filter is the filter to apply
+// on the operation. selectParameter is select specific fields in entity.
+func (client ManagementClient) GetApps(hostName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
+ req, err := client.GetAppsPreparer(hostName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAppsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAppsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAppsPreparer prepares the GetApps request.
+func (client ManagementClient) GetAppsPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/apps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAppsSender sends the GetApps request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetAppsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAppsResponder handles the response to the GetApps request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetAppsResponder(resp *http.Response) (result ApplicationCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAppsNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetAppsNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
+ req, err := lastResults.ApplicationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetAppsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetAppsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetApps", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetLocationByHostName returns location for given tenant.
+func (client ManagementClient) GetLocationByHostName() (result Location, err error) {
+ req, err := client.GetLocationByHostNamePreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetLocationByHostNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetLocationByHostNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocationByHostName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetLocationByHostNamePreparer prepares the GetLocationByHostName request.
+func (client ManagementClient) GetLocationByHostNamePreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.Intune/locations/hostName"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetLocationByHostNameSender sends the GetLocationByHostName request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetLocationByHostNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetLocationByHostNameResponder handles the response to the GetLocationByHostName request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetLocationByHostNameResponder(resp *http.Response) (result Location, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetLocations returns location for user tenant.
+func (client ManagementClient) GetLocations() (result LocationCollection, err error) {
+ req, err := client.GetLocationsPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetLocationsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure sending request")
+ }
+
+ result, err = client.GetLocationsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetLocationsPreparer prepares the GetLocations request.
+func (client ManagementClient) GetLocationsPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.Intune/locations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetLocationsSender sends the GetLocations request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetLocationsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetLocationsResponder handles the response to the GetLocations request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetLocationsResponder(resp *http.Response) (result LocationCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetLocationsNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetLocationsNextResults(lastResults LocationCollection) (result LocationCollection, err error) {
+ req, err := lastResults.LocationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetLocationsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetLocationsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetLocations", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMFlaggedUserByName returns Intune flagged user details
+//
+// hostName is location hostName for the tenant userName is flagged userName
+// selectParameter is select specific fields in entity.
+func (client ManagementClient) GetMAMFlaggedUserByName(hostName string, userName string, selectParameter string) (result FlaggedUser, err error) {
+ req, err := client.GetMAMFlaggedUserByNamePreparer(hostName, userName, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMFlaggedUserByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMFlaggedUserByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUserByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMFlaggedUserByNamePreparer prepares the GetMAMFlaggedUserByName request.
+func (client ManagementClient) GetMAMFlaggedUserByNamePreparer(hostName string, userName string, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "userName": autorest.Encode("path", userName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers/{userName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMFlaggedUserByNameSender sends the GetMAMFlaggedUserByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMFlaggedUserByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMFlaggedUserByNameResponder handles the response to the GetMAMFlaggedUserByName request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMFlaggedUserByNameResponder(resp *http.Response) (result FlaggedUser, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMFlaggedUsers returns Intune flagged user collection
+//
+// hostName is location hostName for the tenant filter is the filter to apply
+// on the operation. selectParameter is select specific fields in entity.
+func (client ManagementClient) GetMAMFlaggedUsers(hostName string, filter string, top *int32, selectParameter string) (result FlaggedUserCollection, err error) {
+ req, err := client.GetMAMFlaggedUsersPreparer(hostName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMFlaggedUsersSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMFlaggedUsersResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMFlaggedUsersPreparer prepares the GetMAMFlaggedUsers request.
+func (client ManagementClient) GetMAMFlaggedUsersPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMFlaggedUsersSender sends the GetMAMFlaggedUsers request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMFlaggedUsersSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMFlaggedUsersResponder handles the response to the GetMAMFlaggedUsers request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMFlaggedUsersResponder(resp *http.Response) (result FlaggedUserCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMFlaggedUsersNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetMAMFlaggedUsersNextResults(lastResults FlaggedUserCollection) (result FlaggedUserCollection, err error) {
+ req, err := lastResults.FlaggedUserCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMFlaggedUsersSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMFlaggedUsersResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMFlaggedUsers", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMStatuses returns Intune Tenant level statuses.
+//
+// hostName is location hostName for the tenant
+func (client ManagementClient) GetMAMStatuses(hostName string) (result StatusesDefault, err error) {
+ req, err := client.GetMAMStatusesPreparer(hostName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMStatusesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMStatusesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMStatusesPreparer prepares the GetMAMStatuses request.
+func (client ManagementClient) GetMAMStatusesPreparer(hostName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/statuses/default", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMStatusesSender sends the GetMAMStatuses request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMStatusesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMStatusesResponder handles the response to the GetMAMStatuses request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMStatusesResponder(resp *http.Response) (result StatusesDefault, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMStatusesNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetMAMStatusesNextResults(lastResults StatusesDefault) (result StatusesDefault, err error) {
+ req, err := lastResults.StatusesDefaultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMStatusesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMStatusesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMStatuses", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMUserDeviceByDeviceName get a unique device for a user.
+//
+// hostName is location hostName for the tenant userName is unique user name
+// deviceName is device name selectParameter is select specific fields in
+// entity.
+func (client ManagementClient) GetMAMUserDeviceByDeviceName(hostName string, userName string, deviceName string, selectParameter string) (result Device, err error) {
+ req, err := client.GetMAMUserDeviceByDeviceNamePreparer(hostName, userName, deviceName, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMUserDeviceByDeviceNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMUserDeviceByDeviceNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDeviceByDeviceName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMUserDeviceByDeviceNamePreparer prepares the GetMAMUserDeviceByDeviceName request.
+func (client ManagementClient) GetMAMUserDeviceByDeviceNamePreparer(hostName string, userName string, deviceName string, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deviceName": autorest.Encode("path", deviceName),
+ "hostName": autorest.Encode("path", hostName),
+ "userName": autorest.Encode("path", userName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices/{deviceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMUserDeviceByDeviceNameSender sends the GetMAMUserDeviceByDeviceName request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMUserDeviceByDeviceNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMUserDeviceByDeviceNameResponder handles the response to the GetMAMUserDeviceByDeviceName request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMUserDeviceByDeviceNameResponder(resp *http.Response) (result Device, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMUserDevices get devices for a user.
+//
+// hostName is location hostName for the tenant userName is user unique Name
+// filter is the filter to apply on the operation. selectParameter is select
+// specific fields in entity.
+func (client ManagementClient) GetMAMUserDevices(hostName string, userName string, filter string, top *int32, selectParameter string) (result DeviceCollection, err error) {
+ req, err := client.GetMAMUserDevicesPreparer(hostName, userName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMUserDevicesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMUserDevicesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMUserDevicesPreparer prepares the GetMAMUserDevices request.
+func (client ManagementClient) GetMAMUserDevicesPreparer(hostName string, userName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "userName": autorest.Encode("path", userName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMUserDevicesSender sends the GetMAMUserDevices request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMUserDevicesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMUserDevicesResponder handles the response to the GetMAMUserDevices request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMUserDevicesResponder(resp *http.Response) (result DeviceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMUserDevicesNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetMAMUserDevicesNextResults(lastResults DeviceCollection) (result DeviceCollection, err error) {
+ req, err := lastResults.DeviceCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMUserDevicesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMUserDevicesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserDevices", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMUserFlaggedEnrolledApps returns Intune flagged enrolled app
+// collection for the User
+//
+// hostName is location hostName for the tenant userName is user name for the
+// tenant filter is the filter to apply on the operation. selectParameter is
+// select specific fields in entity.
+func (client ManagementClient) GetMAMUserFlaggedEnrolledApps(hostName string, userName string, filter string, top *int32, selectParameter string) (result FlaggedEnrolledAppCollection, err error) {
+ req, err := client.GetMAMUserFlaggedEnrolledAppsPreparer(hostName, userName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMUserFlaggedEnrolledAppsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMUserFlaggedEnrolledAppsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMUserFlaggedEnrolledAppsPreparer prepares the GetMAMUserFlaggedEnrolledApps request.
+func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsPreparer(hostName string, userName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "userName": autorest.Encode("path", userName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/flaggedUsers/{userName}/flaggedEnrolledApps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMUserFlaggedEnrolledAppsSender sends the GetMAMUserFlaggedEnrolledApps request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMUserFlaggedEnrolledAppsResponder handles the response to the GetMAMUserFlaggedEnrolledApps request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsResponder(resp *http.Response) (result FlaggedEnrolledAppCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMUserFlaggedEnrolledAppsNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetMAMUserFlaggedEnrolledAppsNextResults(lastResults FlaggedEnrolledAppCollection) (result FlaggedEnrolledAppCollection, err error) {
+ req, err := lastResults.FlaggedEnrolledAppCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMUserFlaggedEnrolledAppsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMUserFlaggedEnrolledAppsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetMAMUserFlaggedEnrolledApps", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetOperationResults returns operationResults.
+//
+// hostName is location hostName for the tenant filter is the filter to apply
+// on the operation. selectParameter is select specific fields in entity.
+func (client ManagementClient) GetOperationResults(hostName string, filter string, top *int32, selectParameter string) (result OperationResultCollection, err error) {
+ req, err := client.GetOperationResultsPreparer(hostName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetOperationResultsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure sending request")
+ }
+
+ result, err = client.GetOperationResultsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetOperationResultsPreparer prepares the GetOperationResults request.
+func (client ManagementClient) GetOperationResultsPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/operationResults", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetOperationResultsSender sends the GetOperationResults request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetOperationResultsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetOperationResultsResponder handles the response to the GetOperationResults request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetOperationResultsResponder(resp *http.Response) (result OperationResultCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetOperationResultsNextResults retrieves the next set of results, if any.
+func (client ManagementClient) GetOperationResultsNextResults(lastResults OperationResultCollection) (result OperationResultCollection, err error) {
+ req, err := lastResults.OperationResultCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetOperationResultsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetOperationResultsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "GetOperationResults", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// WipeMAMUserDevice wipe a device for a user.
+//
+// hostName is location hostName for the tenant userName is unique user name
+// deviceName is device name
+func (client ManagementClient) WipeMAMUserDevice(hostName string, userName string, deviceName string) (result WipeDeviceOperationResult, err error) {
+ req, err := client.WipeMAMUserDevicePreparer(hostName, userName, deviceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", nil, "Failure preparing request")
+ }
+
+ resp, err := client.WipeMAMUserDeviceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", resp, "Failure sending request")
+ }
+
+ result, err = client.WipeMAMUserDeviceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.ManagementClient", "WipeMAMUserDevice", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// WipeMAMUserDevicePreparer prepares the WipeMAMUserDevice request.
+func (client ManagementClient) WipeMAMUserDevicePreparer(hostName string, userName string, deviceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deviceName": autorest.Encode("path", deviceName),
+ "hostName": autorest.Encode("path", hostName),
+ "userName": autorest.Encode("path", userName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/users/{userName}/devices/{deviceName}/wipe", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// WipeMAMUserDeviceSender sends the WipeMAMUserDevice request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) WipeMAMUserDeviceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// WipeMAMUserDeviceResponder handles the response to the WipeMAMUserDevice request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) WipeMAMUserDeviceResponder(resp *http.Response) (result WipeDeviceOperationResult, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/ios.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/ios.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/ios.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/ios.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,827 @@
+package intune
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IosClient is the microsoft.Intune Resource provider Api features in the
+// swagger-2.0 specification
+type IosClient struct {
+ ManagementClient
+}
+
+// NewIosClient creates an instance of the IosClient client.
+func NewIosClient() IosClient {
+ return NewIosClientWithBaseURI(DefaultBaseURI)
+}
+
+// NewIosClientWithBaseURI creates an instance of the IosClient client.
+func NewIosClientWithBaseURI(baseURI string) IosClient {
+ return IosClient{NewWithBaseURI(baseURI)}
+}
+
+// AddAppForMAMPolicy add app to an iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy appName is application unique Name parameters is parameters
+// supplied to add an app to an ios policy.
+func (client IosClient) AddAppForMAMPolicy(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
+ req, err := client.AddAppForMAMPolicyPreparer(hostName, policyName, appName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.AddAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "AddAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddAppForMAMPolicyPreparer prepares the AddAppForMAMPolicy request.
+func (client IosClient) AddAppForMAMPolicyPreparer(hostName string, policyName string, appName string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps/{appName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddAppForMAMPolicySender sends the AddAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) AddAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddAppForMAMPolicyResponder handles the response to the AddAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) AddAppForMAMPolicyResponder(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
+}
+
+// AddGroupForMAMPolicy add group to an iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy groupID is group Id parameters is parameters supplied to the
+// Create or update app to an android policy operation.
+func (client IosClient) AddGroupForMAMPolicy(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (result autorest.Response, err error) {
+ req, err := client.AddGroupForMAMPolicyPreparer(hostName, policyName, groupID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.AddGroupForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.AddGroupForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "AddGroupForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// AddGroupForMAMPolicyPreparer prepares the AddGroupForMAMPolicy request.
+func (client IosClient) AddGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string, parameters MAMPolicyAppIDOrGroupIDPayload) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "groupId": autorest.Encode("path", groupID),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups/{groupId}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// AddGroupForMAMPolicySender sends the AddGroupForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) AddGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// AddGroupForMAMPolicyResponder handles the response to the AddGroupForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) AddGroupForMAMPolicyResponder(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
+}
+
+// CreateOrUpdateMAMPolicy creates or updates iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy parameters is parameters supplied to the Create or update an
+// android policy operation.
+func (client IosClient) CreateOrUpdateMAMPolicy(hostName string, policyName string, parameters IOSMAMPolicy) (result IOSMAMPolicy, err error) {
+ req, err := client.CreateOrUpdateMAMPolicyPreparer(hostName, policyName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "CreateOrUpdateMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateMAMPolicyPreparer prepares the CreateOrUpdateMAMPolicy request.
+func (client IosClient) CreateOrUpdateMAMPolicyPreparer(hostName string, policyName string, parameters IOSMAMPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateMAMPolicySender sends the CreateOrUpdateMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) CreateOrUpdateMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateMAMPolicyResponder handles the response to the CreateOrUpdateMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) CreateOrUpdateMAMPolicyResponder(resp *http.Response) (result IOSMAMPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteAppForMAMPolicy delete App for Ios Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy appName is application unique Name
+func (client IosClient) DeleteAppForMAMPolicy(hostName string, policyName string, appName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAppForMAMPolicyPreparer(hostName, policyName, appName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAppForMAMPolicyPreparer prepares the DeleteAppForMAMPolicy request.
+func (client IosClient) DeleteAppForMAMPolicyPreparer(hostName string, policyName string, appName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appName": autorest.Encode("path", appName),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps/{appName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAppForMAMPolicySender sends the DeleteAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) DeleteAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAppForMAMPolicyResponder handles the response to the DeleteAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) DeleteAppForMAMPolicyResponder(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
+}
+
+// DeleteGroupForMAMPolicy delete Group for iOS Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy groupID is application unique Name
+func (client IosClient) DeleteGroupForMAMPolicy(hostName string, policyName string, groupID string) (result autorest.Response, err error) {
+ req, err := client.DeleteGroupForMAMPolicyPreparer(hostName, policyName, groupID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteGroupForMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteGroupForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteGroupForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteGroupForMAMPolicyPreparer prepares the DeleteGroupForMAMPolicy request.
+func (client IosClient) DeleteGroupForMAMPolicyPreparer(hostName string, policyName string, groupID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "groupId": autorest.Encode("path", groupID),
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups/{groupId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteGroupForMAMPolicySender sends the DeleteGroupForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) DeleteGroupForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteGroupForMAMPolicyResponder handles the response to the DeleteGroupForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) DeleteGroupForMAMPolicyResponder(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
+}
+
+// DeleteMAMPolicy delete Ios Policy
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy
+func (client IosClient) DeleteMAMPolicy(hostName string, policyName string) (result autorest.Response, err error) {
+ req, err := client.DeleteMAMPolicyPreparer(hostName, policyName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteMAMPolicySender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "DeleteMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteMAMPolicyPreparer prepares the DeleteMAMPolicy request.
+func (client IosClient) DeleteMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteMAMPolicySender sends the DeleteMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) DeleteMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteMAMPolicyResponder handles the response to the DeleteMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) DeleteMAMPolicyResponder(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
+}
+
+// GetAppForMAMPolicy get apps for an iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy filter is the filter to apply on the operation. selectParameter
+// is select specific fields in entity.
+func (client IosClient) GetAppForMAMPolicy(hostName string, policyName string, filter string, top *int32, selectParameter string) (result ApplicationCollection, err error) {
+ req, err := client.GetAppForMAMPolicyPreparer(hostName, policyName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAppForMAMPolicyPreparer prepares the GetAppForMAMPolicy request.
+func (client IosClient) GetAppForMAMPolicyPreparer(hostName string, policyName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/apps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAppForMAMPolicySender sends the GetAppForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) GetAppForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAppForMAMPolicyResponder handles the response to the GetAppForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) GetAppForMAMPolicyResponder(resp *http.Response) (result ApplicationCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAppForMAMPolicyNextResults retrieves the next set of results, if any.
+func (client IosClient) GetAppForMAMPolicyNextResults(lastResults ApplicationCollection) (result ApplicationCollection, err error) {
+ req, err := lastResults.ApplicationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetAppForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetAppForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetAppForMAMPolicy", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetGroupsForMAMPolicy returns groups for a given iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is policy name for
+// the tenant
+func (client IosClient) GetGroupsForMAMPolicy(hostName string, policyName string) (result GroupsCollection, err error) {
+ req, err := client.GetGroupsForMAMPolicyPreparer(hostName, policyName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetGroupsForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.GetGroupsForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetGroupsForMAMPolicyPreparer prepares the GetGroupsForMAMPolicy request.
+func (client IosClient) GetGroupsForMAMPolicyPreparer(hostName string, policyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}/groups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetGroupsForMAMPolicySender sends the GetGroupsForMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) GetGroupsForMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetGroupsForMAMPolicyResponder handles the response to the GetGroupsForMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) GetGroupsForMAMPolicyResponder(resp *http.Response) (result GroupsCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetGroupsForMAMPolicyNextResults retrieves the next set of results, if any.
+func (client IosClient) GetGroupsForMAMPolicyNextResults(lastResults GroupsCollection) (result GroupsCollection, err error) {
+ req, err := lastResults.GroupsCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetGroupsForMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetGroupsForMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetGroupsForMAMPolicy", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMPolicies returns Intune iOSPolicies.
+//
+// hostName is location hostName for the tenant filter is the filter to apply
+// on the operation. selectParameter is select specific fields in entity.
+func (client IosClient) GetMAMPolicies(hostName string, filter string, top *int32, selectParameter string) (result IOSMAMPolicyCollection, err error) {
+ req, err := client.GetMAMPoliciesPreparer(hostName, filter, top, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMPoliciesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMPoliciesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMPoliciesPreparer prepares the GetMAMPolicies request.
+func (client IosClient) GetMAMPoliciesPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMPoliciesSender sends the GetMAMPolicies request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) GetMAMPoliciesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMPoliciesResponder handles the response to the GetMAMPolicies request. The method always
+// closes the http.Response Body.
+func (client IosClient) GetMAMPoliciesResponder(resp *http.Response) (result IOSMAMPolicyCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMAMPoliciesNextResults retrieves the next set of results, if any.
+func (client IosClient) GetMAMPoliciesNextResults(lastResults IOSMAMPolicyCollection) (result IOSMAMPolicyCollection, err error) {
+ req, err := lastResults.IOSMAMPolicyCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.GetMAMPoliciesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.GetMAMPoliciesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicies", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// GetMAMPolicyByName returns Intune iOS policies.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy selectParameter is select specific fields in entity.
+func (client IosClient) GetMAMPolicyByName(hostName string, policyName string, selectParameter string) (result IOSMAMPolicy, err error) {
+ req, err := client.GetMAMPolicyByNamePreparer(hostName, policyName, selectParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetMAMPolicyByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetMAMPolicyByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "GetMAMPolicyByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetMAMPolicyByNamePreparer prepares the GetMAMPolicyByName request.
+func (client IosClient) GetMAMPolicyByNamePreparer(hostName string, policyName string, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetMAMPolicyByNameSender sends the GetMAMPolicyByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) GetMAMPolicyByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetMAMPolicyByNameResponder handles the response to the GetMAMPolicyByName request. The method always
+// closes the http.Response Body.
+func (client IosClient) GetMAMPolicyByNameResponder(resp *http.Response) (result IOSMAMPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// PatchMAMPolicy patch an iOSMAMPolicy.
+//
+// hostName is location hostName for the tenant policyName is unique name for
+// the policy parameters is parameters supplied to the Create or update an
+// android policy operation.
+func (client IosClient) PatchMAMPolicy(hostName string, policyName string, parameters IOSMAMPolicy) (result IOSMAMPolicy, err error) {
+ req, err := client.PatchMAMPolicyPreparer(hostName, policyName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchMAMPolicySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchMAMPolicyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "intune.IosClient", "PatchMAMPolicy", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchMAMPolicyPreparer prepares the PatchMAMPolicy request.
+func (client IosClient) PatchMAMPolicyPreparer(hostName string, policyName string, parameters IOSMAMPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "policyName": autorest.Encode("path", policyName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/iosPolicies/{policyName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchMAMPolicySender sends the PatchMAMPolicy request. The method will close the
+// http.Response Body if it receives an error.
+func (client IosClient) PatchMAMPolicySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchMAMPolicyResponder handles the response to the PatchMAMPolicy request. The method always
+// closes the http.Response Body.
+func (client IosClient) PatchMAMPolicyResponder(resp *http.Response) (result IOSMAMPolicy, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,690 @@
+package intune
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// AppSharingFromLevel enumerates the values for app sharing from level.
+type AppSharingFromLevel string
+
+const (
+ // AllApps specifies the all apps state for app sharing from level.
+ AllApps AppSharingFromLevel = "allApps"
+ // None specifies the none state for app sharing from level.
+ None AppSharingFromLevel = "none"
+ // PolicyManagedApps specifies the policy managed apps state for app
+ // sharing from level.
+ PolicyManagedApps AppSharingFromLevel = "policyManagedApps"
+)
+
+// AppSharingToLevel enumerates the values for app sharing to level.
+type AppSharingToLevel string
+
+const (
+ // AppSharingToLevelAllApps specifies the app sharing to level all apps
+ // state for app sharing to level.
+ AppSharingToLevelAllApps AppSharingToLevel = "allApps"
+ // AppSharingToLevelNone specifies the app sharing to level none state for
+ // app sharing to level.
+ AppSharingToLevelNone AppSharingToLevel = "none"
+ // AppSharingToLevelPolicyManagedApps specifies the app sharing to level
+ // policy managed apps state for app sharing to level.
+ AppSharingToLevelPolicyManagedApps AppSharingToLevel = "policyManagedApps"
+)
+
+// Authentication enumerates the values for authentication.
+type Authentication string
+
+const (
+ // NotRequired specifies the not required state for authentication.
+ NotRequired Authentication = "notRequired"
+ // Required specifies the required state for authentication.
+ Required Authentication = "required"
+)
+
+// ClipboardSharingLevel enumerates the values for clipboard sharing level.
+type ClipboardSharingLevel string
+
+const (
+ // ClipboardSharingLevelAllApps specifies the clipboard sharing level all
+ // apps state for clipboard sharing level.
+ ClipboardSharingLevelAllApps ClipboardSharingLevel = "allApps"
+ // ClipboardSharingLevelBlocked specifies the clipboard sharing level
+ // blocked state for clipboard sharing level.
+ ClipboardSharingLevelBlocked ClipboardSharingLevel = "blocked"
+ // ClipboardSharingLevelPolicyManagedApps specifies the clipboard sharing
+ // level policy managed apps state for clipboard sharing level.
+ ClipboardSharingLevelPolicyManagedApps ClipboardSharingLevel = "policyManagedApps"
+ // ClipboardSharingLevelPolicyManagedAppsWithPasteIn specifies the
+ // clipboard sharing level policy managed apps with paste in state for
+ // clipboard sharing level.
+ ClipboardSharingLevelPolicyManagedAppsWithPasteIn ClipboardSharingLevel = "policyManagedAppsWithPasteIn"
+)
+
+// DataBackup enumerates the values for data backup.
+type DataBackup string
+
+const (
+ // Allow specifies the allow state for data backup.
+ Allow DataBackup = "allow"
+ // Block specifies the block state for data backup.
+ Block DataBackup = "block"
+)
+
+// DeviceCompliance enumerates the values for device compliance.
+type DeviceCompliance string
+
+const (
+ // Disable specifies the disable state for device compliance.
+ Disable DeviceCompliance = "disable"
+ // Enable specifies the enable state for device compliance.
+ Enable DeviceCompliance = "enable"
+)
+
+// FileEncryption enumerates the values for file encryption.
+type FileEncryption string
+
+const (
+ // FileEncryptionNotRequired specifies the file encryption not required
+ // state for file encryption.
+ FileEncryptionNotRequired FileEncryption = "notRequired"
+ // FileEncryptionRequired specifies the file encryption required state for
+ // file encryption.
+ FileEncryptionRequired FileEncryption = "required"
+)
+
+// FileEncryptionLevel enumerates the values for file encryption level.
+type FileEncryptionLevel string
+
+const (
+ // AfterDeviceRestart specifies the after device restart state for file
+ // encryption level.
+ AfterDeviceRestart FileEncryptionLevel = "afterDeviceRestart"
+ // DeviceLocked specifies the device locked state for file encryption
+ // level.
+ DeviceLocked FileEncryptionLevel = "deviceLocked"
+ // DeviceLockedExceptFilesOpen specifies the device locked except files
+ // open state for file encryption level.
+ DeviceLockedExceptFilesOpen FileEncryptionLevel = "deviceLockedExceptFilesOpen"
+ // UseDeviceSettings specifies the use device settings state for file
+ // encryption level.
+ UseDeviceSettings FileEncryptionLevel = "useDeviceSettings"
+)
+
+// FileSharingSaveAs enumerates the values for file sharing save as.
+type FileSharingSaveAs string
+
+const (
+ // FileSharingSaveAsAllow specifies the file sharing save as allow state
+ // for file sharing save as.
+ FileSharingSaveAsAllow FileSharingSaveAs = "allow"
+ // FileSharingSaveAsBlock specifies the file sharing save as block state
+ // for file sharing save as.
+ FileSharingSaveAsBlock FileSharingSaveAs = "block"
+)
+
+// GroupStatus enumerates the values for group status.
+type GroupStatus string
+
+const (
+ // NotTargeted specifies the not targeted state for group status.
+ NotTargeted GroupStatus = "notTargeted"
+ // Targeted specifies the targeted state for group status.
+ Targeted GroupStatus = "targeted"
+)
+
+// ManagedBrowser enumerates the values for managed browser.
+type ManagedBrowser string
+
+const (
+ // ManagedBrowserNotRequired specifies the managed browser not required
+ // state for managed browser.
+ ManagedBrowserNotRequired ManagedBrowser = "notRequired"
+ // ManagedBrowserRequired specifies the managed browser required state for
+ // managed browser.
+ ManagedBrowserRequired ManagedBrowser = "required"
+)
+
+// Pin enumerates the values for pin.
+type Pin string
+
+const (
+ // PinNotRequired specifies the pin not required state for pin.
+ PinNotRequired Pin = "notRequired"
+ // PinRequired specifies the pin required state for pin.
+ PinRequired Pin = "required"
+)
+
+// Platform enumerates the values for platform.
+type Platform string
+
+const (
+ // Android specifies the android state for platform.
+ Android Platform = "android"
+ // Ios specifies the ios state for platform.
+ Ios Platform = "ios"
+ // Windows specifies the windows state for platform.
+ Windows Platform = "windows"
+)
+
+// ScreenCapture enumerates the values for screen capture.
+type ScreenCapture string
+
+const (
+ // ScreenCaptureAllow specifies the screen capture allow state for screen
+ // capture.
+ ScreenCaptureAllow ScreenCapture = "allow"
+ // ScreenCaptureBlock specifies the screen capture block state for screen
+ // capture.
+ ScreenCaptureBlock ScreenCapture = "block"
+)
+
+// TouchID enumerates the values for touch id.
+type TouchID string
+
+const (
+ // TouchIDDisable specifies the touch id disable state for touch id.
+ TouchIDDisable TouchID = "disable"
+ // TouchIDEnable specifies the touch id enable state for touch id.
+ TouchIDEnable TouchID = "enable"
+)
+
+// AndroidMAMPolicy is android Policy entity for Intune MAM.
+type AndroidMAMPolicy struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *AndroidMAMPolicyProperties `json:"properties,omitempty"`
+}
+
+// AndroidMAMPolicyCollection is
+type AndroidMAMPolicyCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]AndroidMAMPolicy `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// AndroidMAMPolicyCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client AndroidMAMPolicyCollection) AndroidMAMPolicyCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// AndroidMAMPolicyProperties is intune MAM iOS Policy Properties.
+type AndroidMAMPolicyProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
+ AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
+ Authentication Authentication `json:"authentication,omitempty"`
+ ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
+ DataBackup DataBackup `json:"dataBackup,omitempty"`
+ FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
+ Pin Pin `json:"pin,omitempty"`
+ PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
+ DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
+ ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
+ AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
+ AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
+ OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
+ NumOfApps *int32 `json:"numOfApps,omitempty"`
+ GroupStatus GroupStatus `json:"groupStatus,omitempty"`
+ LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
+ ScreenCapture ScreenCapture `json:"screenCapture,omitempty"`
+ FileEncryption FileEncryption `json:"fileEncryption,omitempty"`
+}
+
+// Application is application entity for Intune MAM.
+type Application struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *ApplicationProperties `json:"properties,omitempty"`
+}
+
+// ApplicationCollection is
+type ApplicationCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]Application `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// ApplicationCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ApplicationCollection) ApplicationCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// ApplicationProperties is
+type ApplicationProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Platform Platform `json:"platform,omitempty"`
+ AppID *string `json:"appId,omitempty"`
+}
+
+// Device is device entity for Intune.
+type Device struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *DeviceProperties `json:"properties,omitempty"`
+}
+
+// DeviceCollection is
+type DeviceCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]Device `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// DeviceCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client DeviceCollection) DeviceCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// DeviceProperties is
+type DeviceProperties struct {
+ UserID *string `json:"userId,omitempty"`
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Platform *string `json:"platform,omitempty"`
+ PlatformVersion *string `json:"platformVersion,omitempty"`
+ DeviceType *string `json:"deviceType,omitempty"`
+}
+
+// Error is
+type Error struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// FlaggedEnrolledApp is flagged Enrolled App for the given tenant.
+type FlaggedEnrolledApp struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *FlaggedEnrolledAppProperties `json:"properties,omitempty"`
+}
+
+// FlaggedEnrolledAppCollection is flagged Enrolled App collection for the
+// given tenant.
+type FlaggedEnrolledAppCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]FlaggedEnrolledApp `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// FlaggedEnrolledAppCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client FlaggedEnrolledAppCollection) FlaggedEnrolledAppCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// FlaggedEnrolledAppError is
+type FlaggedEnrolledAppError struct {
+ ErrorCode *string `json:"errorCode,omitempty"`
+ Severity *string `json:"severity,omitempty"`
+}
+
+// FlaggedEnrolledAppProperties is
+type FlaggedEnrolledAppProperties struct {
+ DeviceType *string `json:"deviceType,omitempty"`
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
+ Platform *string `json:"platform,omitempty"`
+ Errors *[]FlaggedEnrolledAppError `json:"errors,omitempty"`
+}
+
+// FlaggedUser is flagged user for the given tenant.
+type FlaggedUser struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *FlaggedUserProperties `json:"properties,omitempty"`
+}
+
+// FlaggedUserCollection is flagged user collection for the given tenant.
+type FlaggedUserCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]FlaggedUser `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// FlaggedUserCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client FlaggedUserCollection) FlaggedUserCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// FlaggedUserProperties is
+type FlaggedUserProperties struct {
+ ErrorCount *int32 `json:"errorCount,omitempty"`
+ FriendlyName *string `json:"friendlyName,omitempty"`
+}
+
+// GroupItem is group entity for Intune MAM.
+type GroupItem struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *GroupProperties `json:"properties,omitempty"`
+}
+
+// GroupProperties is
+type GroupProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+}
+
+// GroupsCollection is
+type GroupsCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]GroupItem `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// GroupsCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client GroupsCollection) GroupsCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// IOSMAMPolicy is iOS Policy entity for Intune MAM.
+type IOSMAMPolicy struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *IOSMAMPolicyProperties `json:"properties,omitempty"`
+}
+
+// IOSMAMPolicyCollection is
+type IOSMAMPolicyCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]IOSMAMPolicy `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// IOSMAMPolicyCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client IOSMAMPolicyCollection) IOSMAMPolicyCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// IOSMAMPolicyProperties is intune MAM iOS Policy Properties.
+type IOSMAMPolicyProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
+ AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
+ Authentication Authentication `json:"authentication,omitempty"`
+ ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
+ DataBackup DataBackup `json:"dataBackup,omitempty"`
+ FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
+ Pin Pin `json:"pin,omitempty"`
+ PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
+ DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
+ ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
+ AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
+ AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
+ OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
+ NumOfApps *int32 `json:"numOfApps,omitempty"`
+ GroupStatus GroupStatus `json:"groupStatus,omitempty"`
+ LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
+ FileEncryptionLevel FileEncryptionLevel `json:"fileEncryptionLevel,omitempty"`
+ TouchID TouchID `json:"touchId,omitempty"`
+}
+
+// Location is location entity for given tenant.
+type Location struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *LocationProperties `json:"properties,omitempty"`
+}
+
+// LocationCollection is
+type LocationCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]Location `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// LocationCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client LocationCollection) LocationCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// LocationProperties is
+type LocationProperties struct {
+ HostName *string `json:"hostName,omitempty"`
+}
+
+// MAMPolicyAppIDOrGroupIDPayload is mAM Policy request body for properties
+// Intune MAM.
+type MAMPolicyAppIDOrGroupIDPayload struct {
+ Properties *MAMPolicyAppOrGroupIDProperties `json:"properties,omitempty"`
+}
+
+// MAMPolicyAppOrGroupIDProperties is android Policy request body for Intune
+// MAM.
+type MAMPolicyAppOrGroupIDProperties struct {
+ URL *string `json:"url,omitempty"`
+}
+
+// MAMPolicyProperties is
+type MAMPolicyProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ AppSharingFromLevel AppSharingFromLevel `json:"appSharingFromLevel,omitempty"`
+ AppSharingToLevel AppSharingToLevel `json:"appSharingToLevel,omitempty"`
+ Authentication Authentication `json:"authentication,omitempty"`
+ ClipboardSharingLevel ClipboardSharingLevel `json:"clipboardSharingLevel,omitempty"`
+ DataBackup DataBackup `json:"dataBackup,omitempty"`
+ FileSharingSaveAs FileSharingSaveAs `json:"fileSharingSaveAs,omitempty"`
+ Pin Pin `json:"pin,omitempty"`
+ PinNumRetry *int32 `json:"pinNumRetry,omitempty"`
+ DeviceCompliance DeviceCompliance `json:"deviceCompliance,omitempty"`
+ ManagedBrowser ManagedBrowser `json:"managedBrowser,omitempty"`
+ AccessRecheckOfflineTimeout *string `json:"accessRecheckOfflineTimeout,omitempty"`
+ AccessRecheckOnlineTimeout *string `json:"accessRecheckOnlineTimeout,omitempty"`
+ OfflineWipeTimeout *string `json:"offlineWipeTimeout,omitempty"`
+ NumOfApps *int32 `json:"numOfApps,omitempty"`
+ GroupStatus GroupStatus `json:"groupStatus,omitempty"`
+ LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
+}
+
+// OperationMetadataProperties is
+type OperationMetadataProperties struct {
+ Name *string `json:"name,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// OperationResult is operationResult entity for Intune.
+type OperationResult struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *OperationResultProperties `json:"properties,omitempty"`
+}
+
+// OperationResultCollection is
+type OperationResultCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]OperationResult `json:"value,omitempty"`
+ Nextlink *string `json:"nextlink,omitempty"`
+}
+
+// OperationResultCollectionPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client OperationResultCollection) OperationResultCollectionPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// OperationResultProperties is
+type OperationResultProperties struct {
+ FriendlyName *string `json:"friendlyName,omitempty"`
+ Category *string `json:"category,omitempty"`
+ LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
+ State *string `json:"state,omitempty"`
+ OperationMetadata *[]OperationMetadataProperties `json:"operationMetadata,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+}
+
+// StatusesDefault is default Statuses entity for the given tenant.
+type StatusesDefault struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *StatusesProperties `json:"properties,omitempty"`
+ Nextlink *string `json:",omitempty"`
+}
+
+// StatusesDefaultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client StatusesDefault) StatusesDefaultPreparer() (*http.Request, error) {
+ if client.Nextlink == nil || len(to.String(client.Nextlink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.Nextlink)))
+}
+
+// StatusesProperties is
+type StatusesProperties struct {
+ DeployedPolicies *int32 `json:"deployedPolicies,omitempty"`
+ EnrolledUsers *int32 `json:"enrolledUsers,omitempty"`
+ FlaggedUsers *int32 `json:"flaggedUsers,omitempty"`
+ LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
+ PolicyAppliedUsers *int32 `json:"policyAppliedUsers,omitempty"`
+ Status *string `json:"status,omitempty"`
+ WipeFailedApps *int32 `json:"wipeFailedApps,omitempty"`
+ WipePendingApps *int32 `json:"wipePendingApps,omitempty"`
+ WipeSucceededApps *int32 `json:"wipeSucceededApps,omitempty"`
+}
+
+// WipeDeviceOperationResult is device entity for Intune.
+type WipeDeviceOperationResult struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *WipeDeviceOperationResultProperties `json:"properties,omitempty"`
+}
+
+// WipeDeviceOperationResultProperties is
+type WipeDeviceOperationResultProperties struct {
+ Value *string `json:"value,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/intune/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/intune/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package intune
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "intune", "2015-01-14-preview")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,6 @@
+// Package logic implements the Azure ARM Logic service API version
+// 2015-08-01-preview.
+//
package logic
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,17 +17,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Logic
- APIVersion = "2015-02-01-preview"
+ APIVersion = "2015-08-01-preview"
// DefaultBaseURI is the default URI used for the service Logic
DefaultBaseURI = "https://management.azure.com"
@@ -34,6 +37,7 @@
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +51,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountagreements.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountagreements.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountagreements.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountagreements.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,333 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountAgreementsClient is the client for the
+// IntegrationAccountAgreements methods of the Logic service.
+type IntegrationAccountAgreementsClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountAgreementsClient creates an instance of the
+// IntegrationAccountAgreementsClient client.
+func NewIntegrationAccountAgreementsClient(subscriptionID string) IntegrationAccountAgreementsClient {
+ return NewIntegrationAccountAgreementsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountAgreementsClientWithBaseURI creates an instance of the
+// IntegrationAccountAgreementsClient client.
+func NewIntegrationAccountAgreementsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountAgreementsClient {
+ return IntegrationAccountAgreementsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account agreement.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. agreementName is the integration account
+// agreement name. agreement is the integration account agreement.
+func (client IntegrationAccountAgreementsClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, agreementName string, agreement IntegrationAccountAgreement) (result IntegrationAccountAgreement, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, agreementName, agreement)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountAgreementsClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, agreementName string, agreement IntegrationAccountAgreement) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "agreementName": autorest.Encode("path", agreementName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", pathParameters),
+ autorest.WithJSON(agreement),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountAgreementsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountAgreementsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountAgreement, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account agreement.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. agreementName is the integration account
+// agreement name.
+func (client IntegrationAccountAgreementsClient) Delete(resourceGroupName string, integrationAccountName string, agreementName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName, agreementName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountAgreementsClient) DeletePreparer(resourceGroupName string, integrationAccountName string, agreementName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "agreementName": autorest.Encode("path", agreementName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountAgreementsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountAgreementsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account agreement.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. agreementName is the integration account
+// agreement name.
+func (client IntegrationAccountAgreementsClient) Get(resourceGroupName string, integrationAccountName string, agreementName string) (result IntegrationAccountAgreement, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName, agreementName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountAgreementsClient) GetPreparer(resourceGroupName string, integrationAccountName string, agreementName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "agreementName": autorest.Encode("path", agreementName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountAgreementsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountAgreementsClient) GetResponder(resp *http.Response) (result IntegrationAccountAgreement, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of integration account agreements.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. top is the number of items to be included in the
+// result. filter is the filter to apply on the operation.
+func (client IntegrationAccountAgreementsClient) List(resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountAgreementListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, integrationAccountName, top, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client IntegrationAccountAgreementsClient) ListPreparer(resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountAgreementsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountAgreementsClient) ListResponder(resp *http.Response) (result IntegrationAccountAgreementListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountAgreementsClient) ListNextResults(lastResults IntegrationAccountAgreementListResult) (result IntegrationAccountAgreementListResult, err error) {
+ req, err := lastResults.IntegrationAccountAgreementListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountAgreementsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountcertificates.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountcertificates.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountcertificates.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountcertificates.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,330 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountCertificatesClient is the client for the
+// IntegrationAccountCertificates methods of the Logic service.
+type IntegrationAccountCertificatesClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountCertificatesClient creates an instance of the
+// IntegrationAccountCertificatesClient client.
+func NewIntegrationAccountCertificatesClient(subscriptionID string) IntegrationAccountCertificatesClient {
+ return NewIntegrationAccountCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountCertificatesClientWithBaseURI creates an instance of
+// the IntegrationAccountCertificatesClient client.
+func NewIntegrationAccountCertificatesClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountCertificatesClient {
+ return IntegrationAccountCertificatesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account certificate.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. certificateName is the integration account
+// certificate name. certificate is the integration account certificate.
+func (client IntegrationAccountCertificatesClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, certificateName string, certificate IntegrationAccountCertificate) (result IntegrationAccountCertificate, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, certificateName, certificate)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountCertificatesClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, certificateName string, certificate IntegrationAccountCertificate) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "certificateName": autorest.Encode("path", certificateName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", pathParameters),
+ autorest.WithJSON(certificate),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountCertificatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountCertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountCertificate, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account certificate.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. certificateName is the integration account
+// certificate name.
+func (client IntegrationAccountCertificatesClient) Delete(resourceGroupName string, integrationAccountName string, certificateName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName, certificateName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountCertificatesClient) DeletePreparer(resourceGroupName string, integrationAccountName string, certificateName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "certificateName": autorest.Encode("path", certificateName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountCertificatesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountCertificatesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account certificate.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. certificateName is the integration account
+// certificate name.
+func (client IntegrationAccountCertificatesClient) Get(resourceGroupName string, integrationAccountName string, certificateName string) (result IntegrationAccountCertificate, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName, certificateName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountCertificatesClient) GetPreparer(resourceGroupName string, integrationAccountName string, certificateName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "certificateName": autorest.Encode("path", certificateName),
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountCertificatesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountCertificatesClient) GetResponder(resp *http.Response) (result IntegrationAccountCertificate, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of integration account certificates.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. top is the number of items to be included in the
+// result.
+func (client IntegrationAccountCertificatesClient) List(resourceGroupName string, integrationAccountName string, top *int32) (result IntegrationAccountCertificateListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, integrationAccountName, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client IntegrationAccountCertificatesClient) ListPreparer(resourceGroupName string, integrationAccountName string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountCertificatesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountCertificatesClient) ListResponder(resp *http.Response) (result IntegrationAccountCertificateListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountCertificatesClient) ListNextResults(lastResults IntegrationAccountCertificateListResult) (result IntegrationAccountCertificateListResult, err error) {
+ req, err := lastResults.IntegrationAccountCertificateListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountCertificatesClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountmaps.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountmaps.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountmaps.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountmaps.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,331 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountMapsClient is the client for the IntegrationAccountMaps
+// methods of the Logic service.
+type IntegrationAccountMapsClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountMapsClient creates an instance of the
+// IntegrationAccountMapsClient client.
+func NewIntegrationAccountMapsClient(subscriptionID string) IntegrationAccountMapsClient {
+ return NewIntegrationAccountMapsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountMapsClientWithBaseURI creates an instance of the
+// IntegrationAccountMapsClient client.
+func NewIntegrationAccountMapsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountMapsClient {
+ return IntegrationAccountMapsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account map.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. mapName is the integration account map name.
+// mapParameter is the integration account map.
+func (client IntegrationAccountMapsClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, mapName string, mapParameter IntegrationAccountMap) (result IntegrationAccountMap, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, mapName, mapParameter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountMapsClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, mapName string, mapParameter IntegrationAccountMap) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "mapName": autorest.Encode("path", mapName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", pathParameters),
+ autorest.WithJSON(mapParameter),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountMapsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountMapsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountMap, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account map.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. mapName is the integration account map name.
+func (client IntegrationAccountMapsClient) Delete(resourceGroupName string, integrationAccountName string, mapName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName, mapName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountMapsClient) DeletePreparer(resourceGroupName string, integrationAccountName string, mapName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "mapName": autorest.Encode("path", mapName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountMapsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountMapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account map.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. mapName is the integration account map name.
+func (client IntegrationAccountMapsClient) Get(resourceGroupName string, integrationAccountName string, mapName string) (result IntegrationAccountMap, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName, mapName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountMapsClient) GetPreparer(resourceGroupName string, integrationAccountName string, mapName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "mapName": autorest.Encode("path", mapName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountMapsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountMapsClient) GetResponder(resp *http.Response) (result IntegrationAccountMap, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of integration account maps.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. top is the number of items to be included in the
+// result. filter is the filter to apply on the operation.
+func (client IntegrationAccountMapsClient) List(resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountMapListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, integrationAccountName, top, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client IntegrationAccountMapsClient) ListPreparer(resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountMapsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountMapsClient) ListResponder(resp *http.Response) (result IntegrationAccountMapListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountMapsClient) ListNextResults(lastResults IntegrationAccountMapListResult) (result IntegrationAccountMapListResult, err error) {
+ req, err := lastResults.IntegrationAccountMapListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountMapsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountpartners.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountpartners.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountpartners.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountpartners.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,333 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountPartnersClient is the client for the
+// IntegrationAccountPartners methods of the Logic service.
+type IntegrationAccountPartnersClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountPartnersClient creates an instance of the
+// IntegrationAccountPartnersClient client.
+func NewIntegrationAccountPartnersClient(subscriptionID string) IntegrationAccountPartnersClient {
+ return NewIntegrationAccountPartnersClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountPartnersClientWithBaseURI creates an instance of the
+// IntegrationAccountPartnersClient client.
+func NewIntegrationAccountPartnersClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountPartnersClient {
+ return IntegrationAccountPartnersClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account partner.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. partnerName is the integration account partner
+// name. partner is the integration account partner.
+func (client IntegrationAccountPartnersClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, partnerName string, partner IntegrationAccountPartner) (result IntegrationAccountPartner, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, partnerName, partner)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountPartnersClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, partnerName string, partner IntegrationAccountPartner) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "partnerName": autorest.Encode("path", partnerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", pathParameters),
+ autorest.WithJSON(partner),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountPartnersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountPartnersClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountPartner, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account partner.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. partnerName is the integration account partner
+// name.
+func (client IntegrationAccountPartnersClient) Delete(resourceGroupName string, integrationAccountName string, partnerName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName, partnerName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountPartnersClient) DeletePreparer(resourceGroupName string, integrationAccountName string, partnerName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "partnerName": autorest.Encode("path", partnerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountPartnersClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountPartnersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account partner.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. partnerName is the integration account partner
+// name.
+func (client IntegrationAccountPartnersClient) Get(resourceGroupName string, integrationAccountName string, partnerName string) (result IntegrationAccountPartner, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName, partnerName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountPartnersClient) GetPreparer(resourceGroupName string, integrationAccountName string, partnerName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "partnerName": autorest.Encode("path", partnerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountPartnersClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountPartnersClient) GetResponder(resp *http.Response) (result IntegrationAccountPartner, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of integration account partners.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. top is the number of items to be included in the
+// result. filter is the filter to apply on the operation.
+func (client IntegrationAccountPartnersClient) List(resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountPartnerListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, integrationAccountName, top, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client IntegrationAccountPartnersClient) ListPreparer(resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountPartnersClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountPartnersClient) ListResponder(resp *http.Response) (result IntegrationAccountPartnerListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountPartnersClient) ListNextResults(lastResults IntegrationAccountPartnerListResult) (result IntegrationAccountPartnerListResult, err error) {
+ req, err := lastResults.IntegrationAccountPartnerListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountPartnersClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountschemas.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountschemas.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountschemas.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccountschemas.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,333 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountSchemasClient is the client for the
+// IntegrationAccountSchemas methods of the Logic service.
+type IntegrationAccountSchemasClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountSchemasClient creates an instance of the
+// IntegrationAccountSchemasClient client.
+func NewIntegrationAccountSchemasClient(subscriptionID string) IntegrationAccountSchemasClient {
+ return NewIntegrationAccountSchemasClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountSchemasClientWithBaseURI creates an instance of the
+// IntegrationAccountSchemasClient client.
+func NewIntegrationAccountSchemasClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountSchemasClient {
+ return IntegrationAccountSchemasClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account schema.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. schemaName is the integration account schema
+// name. schema is the integration account schema.
+func (client IntegrationAccountSchemasClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, schemaName string, schema IntegrationAccountSchema) (result IntegrationAccountSchema, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, schemaName, schema)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountSchemasClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, schemaName string, schema IntegrationAccountSchema) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "schemaName": autorest.Encode("path", schemaName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", pathParameters),
+ autorest.WithJSON(schema),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountSchemasClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountSchemasClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccountSchema, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account schema.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. schemaName is the integration account schema
+// name.
+func (client IntegrationAccountSchemasClient) Delete(resourceGroupName string, integrationAccountName string, schemaName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName, schemaName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountSchemasClient) DeletePreparer(resourceGroupName string, integrationAccountName string, schemaName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "schemaName": autorest.Encode("path", schemaName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountSchemasClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountSchemasClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account schema.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. schemaName is the integration account schema
+// name.
+func (client IntegrationAccountSchemasClient) Get(resourceGroupName string, integrationAccountName string, schemaName string) (result IntegrationAccountSchema, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName, schemaName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountSchemasClient) GetPreparer(resourceGroupName string, integrationAccountName string, schemaName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "schemaName": autorest.Encode("path", schemaName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountSchemasClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountSchemasClient) GetResponder(resp *http.Response) (result IntegrationAccountSchema, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of integration account schemas.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. top is the number of items to be included in the
+// result. filter is the filter to apply on the operation.
+func (client IntegrationAccountSchemasClient) List(resourceGroupName string, integrationAccountName string, top *int32, filter string) (result IntegrationAccountSchemaListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, integrationAccountName, top, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client IntegrationAccountSchemasClient) ListPreparer(resourceGroupName string, integrationAccountName string, top *int32, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountSchemasClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountSchemasClient) ListResponder(resp *http.Response) (result IntegrationAccountSchemaListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountSchemasClient) ListNextResults(lastResults IntegrationAccountSchemaListResult) (result IntegrationAccountSchemaListResult, err error) {
+ req, err := lastResults.IntegrationAccountSchemaListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountSchemasClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccounts.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccounts.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccounts.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/integrationaccounts.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,539 @@
+package logic
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// IntegrationAccountsClient is the client for the IntegrationAccounts methods
+// of the Logic service.
+type IntegrationAccountsClient struct {
+ ManagementClient
+}
+
+// NewIntegrationAccountsClient creates an instance of the
+// IntegrationAccountsClient client.
+func NewIntegrationAccountsClient(subscriptionID string) IntegrationAccountsClient {
+ return NewIntegrationAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewIntegrationAccountsClientWithBaseURI creates an instance of the
+// IntegrationAccountsClient client.
+func NewIntegrationAccountsClientWithBaseURI(baseURI string, subscriptionID string) IntegrationAccountsClient {
+ return IntegrationAccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an integration account.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. integrationAccount is the integration account.
+func (client IntegrationAccountsClient) CreateOrUpdate(resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (result IntegrationAccount, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, integrationAccountName, integrationAccount)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client IntegrationAccountsClient) CreateOrUpdatePreparer(resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", pathParameters),
+ autorest.WithJSON(integrationAccount),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationAccount, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an integration account.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name.
+func (client IntegrationAccountsClient) Delete(resourceGroupName string, integrationAccountName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, integrationAccountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client IntegrationAccountsClient) DeletePreparer(resourceGroupName string, integrationAccountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an integration account.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name.
+func (client IntegrationAccountsClient) Get(resourceGroupName string, integrationAccountName string) (result IntegrationAccount, err error) {
+ req, err := client.GetPreparer(resourceGroupName, integrationAccountName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client IntegrationAccountsClient) GetPreparer(resourceGroupName string, integrationAccountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) GetResponder(resp *http.Response) (result IntegrationAccount, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup gets a list of integration accounts by resource group.
+//
+// resourceGroupName is the resource group name. top is the number of items to
+// be included in the result.
+func (client IntegrationAccountsClient) ListByResourceGroup(resourceGroupName string, top *int32) (result IntegrationAccountListResult, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client IntegrationAccountsClient) ListByResourceGroupPreparer(resourceGroupName string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result IntegrationAccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroupNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountsClient) ListByResourceGroupNextResults(lastResults IntegrationAccountListResult) (result IntegrationAccountListResult, err error) {
+ req, err := lastResults.IntegrationAccountListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListBySubscription gets a list of integration accounts by subscription.
+//
+// top is the number of items to be included in the result.
+func (client IntegrationAccountsClient) ListBySubscription(top *int32) (result IntegrationAccountListResult, err error) {
+ req, err := client.ListBySubscriptionPreparer(top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure sending request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client IntegrationAccountsClient) ListBySubscriptionPreparer(top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result IntegrationAccountListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListBySubscriptionNextResults retrieves the next set of results, if any.
+func (client IntegrationAccountsClient) ListBySubscriptionNextResults(lastResults IntegrationAccountListResult) (result IntegrationAccountListResult, err error) {
+ req, err := lastResults.IntegrationAccountListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListBySubscription", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListCallbackURL lists the integration account callback URL.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. parameters is the callback URL parameters.
+func (client IntegrationAccountsClient) ListCallbackURL(resourceGroupName string, integrationAccountName string, parameters ListCallbackURLParameters) (result CallbackURL, err error) {
+ req, err := client.ListCallbackURLPreparer(resourceGroupName, integrationAccountName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListCallbackURLSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", resp, "Failure sending request")
+ }
+
+ result, err = client.ListCallbackURLResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "ListCallbackURL", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListCallbackURLPreparer prepares the ListCallbackURL request.
+func (client IntegrationAccountsClient) ListCallbackURLPreparer(resourceGroupName string, integrationAccountName string, parameters ListCallbackURLParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListCallbackURLSender sends the ListCallbackURL request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) ListCallbackURLSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListCallbackURLResponder handles the response to the ListCallbackURL request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) ListCallbackURLResponder(resp *http.Response) (result CallbackURL, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update updates an integration account.
+//
+// resourceGroupName is the resource group name. integrationAccountName is the
+// integration account name. integrationAccount is the integration account.
+func (client IntegrationAccountsClient) Update(resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (result IntegrationAccount, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, integrationAccountName, integrationAccount)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "logic.IntegrationAccountsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client IntegrationAccountsClient) UpdatePreparer(resourceGroupName string, integrationAccountName string, integrationAccount IntegrationAccount) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "integrationAccountName": autorest.Encode("path", integrationAccountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", pathParameters),
+ autorest.WithJSON(integrationAccount),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client IntegrationAccountsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client IntegrationAccountsClient) UpdateResponder(resp *http.Response) (result IntegrationAccount, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,80 +14,212 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
-// KeyType enumerates the values for key type.
-type KeyType string
+// AgreementType enumerates the values for agreement type.
+type AgreementType string
const (
- // NotSpecified specifies the not specified state for key type.
- NotSpecified KeyType = "NotSpecified"
- // Primary specifies the primary state for key type.
- Primary KeyType = "Primary"
- // Secondary specifies the secondary state for key type.
- Secondary KeyType = "Secondary"
+ // AS2 specifies the as2 state for agreement type.
+ AS2 AgreementType = "AS2"
+ // Edifact specifies the edifact state for agreement type.
+ Edifact AgreementType = "Edifact"
+ // NotSpecified specifies the not specified state for agreement type.
+ NotSpecified AgreementType = "NotSpecified"
+ // X12 specifies the x12 state for agreement type.
+ X12 AgreementType = "X12"
)
-// ParameterType enumerates the values for parameter type.
-type ParameterType string
+// EdifactCharacterSet enumerates the values for edifact character set.
+type EdifactCharacterSet string
const (
- // ParameterTypeArray specifies the parameter type array state for
- // parameter type.
- ParameterTypeArray ParameterType = "Array"
- // ParameterTypeBool specifies the parameter type bool state for parameter
- // type.
- ParameterTypeBool ParameterType = "Bool"
- // ParameterTypeFloat specifies the parameter type float state for
- // parameter type.
- ParameterTypeFloat ParameterType = "Float"
- // ParameterTypeInt specifies the parameter type int state for parameter
+ // EdifactCharacterSetKECA specifies the edifact character set keca state
+ // for edifact character set.
+ EdifactCharacterSetKECA EdifactCharacterSet = "KECA"
+ // EdifactCharacterSetNotSpecified specifies the edifact character set not
+ // specified state for edifact character set.
+ EdifactCharacterSetNotSpecified EdifactCharacterSet = "NotSpecified"
+ // EdifactCharacterSetUNOA specifies the edifact character set unoa state
+ // for edifact character set.
+ EdifactCharacterSetUNOA EdifactCharacterSet = "UNOA"
+ // EdifactCharacterSetUNOB specifies the edifact character set unob state
+ // for edifact character set.
+ EdifactCharacterSetUNOB EdifactCharacterSet = "UNOB"
+ // EdifactCharacterSetUNOC specifies the edifact character set unoc state
+ // for edifact character set.
+ EdifactCharacterSetUNOC EdifactCharacterSet = "UNOC"
+ // EdifactCharacterSetUNOD specifies the edifact character set unod state
+ // for edifact character set.
+ EdifactCharacterSetUNOD EdifactCharacterSet = "UNOD"
+ // EdifactCharacterSetUNOE specifies the edifact character set unoe state
+ // for edifact character set.
+ EdifactCharacterSetUNOE EdifactCharacterSet = "UNOE"
+ // EdifactCharacterSetUNOF specifies the edifact character set unof state
+ // for edifact character set.
+ EdifactCharacterSetUNOF EdifactCharacterSet = "UNOF"
+ // EdifactCharacterSetUNOG specifies the edifact character set unog state
+ // for edifact character set.
+ EdifactCharacterSetUNOG EdifactCharacterSet = "UNOG"
+ // EdifactCharacterSetUNOH specifies the edifact character set unoh state
+ // for edifact character set.
+ EdifactCharacterSetUNOH EdifactCharacterSet = "UNOH"
+ // EdifactCharacterSetUNOI specifies the edifact character set unoi state
+ // for edifact character set.
+ EdifactCharacterSetUNOI EdifactCharacterSet = "UNOI"
+ // EdifactCharacterSetUNOJ specifies the edifact character set unoj state
+ // for edifact character set.
+ EdifactCharacterSetUNOJ EdifactCharacterSet = "UNOJ"
+ // EdifactCharacterSetUNOK specifies the edifact character set unok state
+ // for edifact character set.
+ EdifactCharacterSetUNOK EdifactCharacterSet = "UNOK"
+ // EdifactCharacterSetUNOX specifies the edifact character set unox state
+ // for edifact character set.
+ EdifactCharacterSetUNOX EdifactCharacterSet = "UNOX"
+ // EdifactCharacterSetUNOY specifies the edifact character set unoy state
+ // for edifact character set.
+ EdifactCharacterSetUNOY EdifactCharacterSet = "UNOY"
+)
+
+// EdifactDecimalIndicator enumerates the values for edifact decimal indicator.
+type EdifactDecimalIndicator string
+
+const (
+ // EdifactDecimalIndicatorComma specifies the edifact decimal indicator
+ // comma state for edifact decimal indicator.
+ EdifactDecimalIndicatorComma EdifactDecimalIndicator = "Comma"
+ // EdifactDecimalIndicatorDecimal specifies the edifact decimal indicator
+ // decimal state for edifact decimal indicator.
+ EdifactDecimalIndicatorDecimal EdifactDecimalIndicator = "Decimal"
+ // EdifactDecimalIndicatorNotSpecified specifies the edifact decimal
+ // indicator not specified state for edifact decimal indicator.
+ EdifactDecimalIndicatorNotSpecified EdifactDecimalIndicator = "NotSpecified"
+)
+
+// EncryptionAlgorithm enumerates the values for encryption algorithm.
+type EncryptionAlgorithm string
+
+const (
+ // EncryptionAlgorithmAES128 specifies the encryption algorithm aes128
+ // state for encryption algorithm.
+ EncryptionAlgorithmAES128 EncryptionAlgorithm = "AES128"
+ // EncryptionAlgorithmAES192 specifies the encryption algorithm aes192
+ // state for encryption algorithm.
+ EncryptionAlgorithmAES192 EncryptionAlgorithm = "AES192"
+ // EncryptionAlgorithmAES256 specifies the encryption algorithm aes256
+ // state for encryption algorithm.
+ EncryptionAlgorithmAES256 EncryptionAlgorithm = "AES256"
+ // EncryptionAlgorithmDES3 specifies the encryption algorithm des3 state
+ // for encryption algorithm.
+ EncryptionAlgorithmDES3 EncryptionAlgorithm = "DES3"
+ // EncryptionAlgorithmNone specifies the encryption algorithm none state
+ // for encryption algorithm.
+ EncryptionAlgorithmNone EncryptionAlgorithm = "None"
+ // EncryptionAlgorithmNotSpecified specifies the encryption algorithm not
+ // specified state for encryption algorithm.
+ EncryptionAlgorithmNotSpecified EncryptionAlgorithm = "NotSpecified"
+ // EncryptionAlgorithmRC2 specifies the encryption algorithm rc2 state for
+ // encryption algorithm.
+ EncryptionAlgorithmRC2 EncryptionAlgorithm = "RC2"
+)
+
+// HashingAlgorithm enumerates the values for hashing algorithm.
+type HashingAlgorithm string
+
+const (
+ // HashingAlgorithmNone specifies the hashing algorithm none state for
+ // hashing algorithm.
+ HashingAlgorithmNone HashingAlgorithm = "None"
+ // HashingAlgorithmNotSpecified specifies the hashing algorithm not
+ // specified state for hashing algorithm.
+ HashingAlgorithmNotSpecified HashingAlgorithm = "NotSpecified"
+ // HashingAlgorithmSHA2256 specifies the hashing algorithm sha2256 state
+ // for hashing algorithm.
+ HashingAlgorithmSHA2256 HashingAlgorithm = "SHA2256"
+ // HashingAlgorithmSHA2384 specifies the hashing algorithm sha2384 state
+ // for hashing algorithm.
+ HashingAlgorithmSHA2384 HashingAlgorithm = "SHA2384"
+ // HashingAlgorithmSHA2512 specifies the hashing algorithm sha2512 state
+ // for hashing algorithm.
+ HashingAlgorithmSHA2512 HashingAlgorithm = "SHA2512"
+)
+
+// MapType enumerates the values for map type.
+type MapType string
+
+const (
+ // MapTypeNotSpecified specifies the map type not specified state for map
// type.
- ParameterTypeInt ParameterType = "Int"
- // ParameterTypeNotSpecified specifies the parameter type not specified
- // state for parameter type.
- ParameterTypeNotSpecified ParameterType = "NotSpecified"
- // ParameterTypeObject specifies the parameter type object state for
- // parameter type.
- ParameterTypeObject ParameterType = "Object"
- // ParameterTypeSecureObject specifies the parameter type secure object
- // state for parameter type.
- ParameterTypeSecureObject ParameterType = "SecureObject"
- // ParameterTypeSecureString specifies the parameter type secure string
- // state for parameter type.
- ParameterTypeSecureString ParameterType = "SecureString"
- // ParameterTypeString specifies the parameter type string state for
- // parameter type.
- ParameterTypeString ParameterType = "String"
-)
-
-// RecurrenceFrequency enumerates the values for recurrence frequency.
-type RecurrenceFrequency string
-
-const (
- // Day specifies the day state for recurrence frequency.
- Day RecurrenceFrequency = "Day"
- // Hour specifies the hour state for recurrence frequency.
- Hour RecurrenceFrequency = "Hour"
- // Minute specifies the minute state for recurrence frequency.
- Minute RecurrenceFrequency = "Minute"
- // Month specifies the month state for recurrence frequency.
- Month RecurrenceFrequency = "Month"
- // Second specifies the second state for recurrence frequency.
- Second RecurrenceFrequency = "Second"
- // Week specifies the week state for recurrence frequency.
- Week RecurrenceFrequency = "Week"
- // Year specifies the year state for recurrence frequency.
- Year RecurrenceFrequency = "Year"
+ MapTypeNotSpecified MapType = "NotSpecified"
+ // MapTypeXslt specifies the map type xslt state for map type.
+ MapTypeXslt MapType = "Xslt"
+)
+
+// MessageFilterType enumerates the values for message filter type.
+type MessageFilterType string
+
+const (
+ // MessageFilterTypeExclude specifies the message filter type exclude
+ // state for message filter type.
+ MessageFilterTypeExclude MessageFilterType = "Exclude"
+ // MessageFilterTypeInclude specifies the message filter type include
+ // state for message filter type.
+ MessageFilterTypeInclude MessageFilterType = "Include"
+ // MessageFilterTypeNotSpecified specifies the message filter type not
+ // specified state for message filter type.
+ MessageFilterTypeNotSpecified MessageFilterType = "NotSpecified"
+)
+
+// PartnerType enumerates the values for partner type.
+type PartnerType string
+
+const (
+ // PartnerTypeB2B specifies the partner type b2b state for partner type.
+ PartnerTypeB2B PartnerType = "B2B"
+ // PartnerTypeNotSpecified specifies the partner type not specified state
+ // for partner type.
+ PartnerTypeNotSpecified PartnerType = "NotSpecified"
+)
+
+// SchemaType enumerates the values for schema type.
+type SchemaType string
+
+const (
+ // SchemaTypeNotSpecified specifies the schema type not specified state
+ // for schema type.
+ SchemaTypeNotSpecified SchemaType = "NotSpecified"
+ // SchemaTypeXML specifies the schema type xml state for schema type.
+ SchemaTypeXML SchemaType = "Xml"
+)
+
+// SegmentTerminatorSuffix enumerates the values for segment terminator suffix.
+type SegmentTerminatorSuffix string
+
+const (
+ // SegmentTerminatorSuffixCR specifies the segment terminator suffix cr
+ // state for segment terminator suffix.
+ SegmentTerminatorSuffixCR SegmentTerminatorSuffix = "CR"
+ // SegmentTerminatorSuffixCRLF specifies the segment terminator suffix
+ // crlf state for segment terminator suffix.
+ SegmentTerminatorSuffixCRLF SegmentTerminatorSuffix = "CRLF"
+ // SegmentTerminatorSuffixLF specifies the segment terminator suffix lf
+ // state for segment terminator suffix.
+ SegmentTerminatorSuffixLF SegmentTerminatorSuffix = "LF"
+ // SegmentTerminatorSuffixNone specifies the segment terminator suffix
+ // none state for segment terminator suffix.
+ SegmentTerminatorSuffixNone SegmentTerminatorSuffix = "None"
+ // SegmentTerminatorSuffixNotSpecified specifies the segment terminator
+ // suffix not specified state for segment terminator suffix.
+ SegmentTerminatorSuffixNotSpecified SegmentTerminatorSuffix = "NotSpecified"
)
// SkuName enumerates the values for sku name.
@@ -109,182 +241,445 @@
SkuNameStandard SkuName = "Standard"
)
-// WorkflowProvisioningState enumerates the values for workflow provisioning
-// state.
-type WorkflowProvisioningState string
-
-const (
- // WorkflowProvisioningStateMoving specifies the workflow provisioning
- // state moving state for workflow provisioning state.
- WorkflowProvisioningStateMoving WorkflowProvisioningState = "Moving"
- // WorkflowProvisioningStateNotSpecified specifies the workflow
- // provisioning state not specified state for workflow provisioning state.
- WorkflowProvisioningStateNotSpecified WorkflowProvisioningState = "NotSpecified"
- // WorkflowProvisioningStateSucceeded specifies the workflow provisioning
- // state succeeded state for workflow provisioning state.
- WorkflowProvisioningStateSucceeded WorkflowProvisioningState = "Succeeded"
-)
-
-// WorkflowState enumerates the values for workflow state.
-type WorkflowState string
-
-const (
- // WorkflowStateDeleted specifies the workflow state deleted state for
- // workflow state.
- WorkflowStateDeleted WorkflowState = "Deleted"
- // WorkflowStateDisabled specifies the workflow state disabled state for
- // workflow state.
- WorkflowStateDisabled WorkflowState = "Disabled"
- // WorkflowStateEnabled specifies the workflow state enabled state for
- // workflow state.
- WorkflowStateEnabled WorkflowState = "Enabled"
- // WorkflowStateNotSpecified specifies the workflow state not specified
- // state for workflow state.
- WorkflowStateNotSpecified WorkflowState = "NotSpecified"
- // WorkflowStateSuspended specifies the workflow state suspended state for
- // workflow state.
- WorkflowStateSuspended WorkflowState = "Suspended"
-)
-
-// WorkflowStatus enumerates the values for workflow status.
-type WorkflowStatus string
-
-const (
- // WorkflowStatusCancelled specifies the workflow status cancelled state
- // for workflow status.
- WorkflowStatusCancelled WorkflowStatus = "Cancelled"
- // WorkflowStatusFailed specifies the workflow status failed state for
- // workflow status.
- WorkflowStatusFailed WorkflowStatus = "Failed"
- // WorkflowStatusNotSpecified specifies the workflow status not specified
- // state for workflow status.
- WorkflowStatusNotSpecified WorkflowStatus = "NotSpecified"
- // WorkflowStatusPaused specifies the workflow status paused state for
- // workflow status.
- WorkflowStatusPaused WorkflowStatus = "Paused"
- // WorkflowStatusRunning specifies the workflow status running state for
- // workflow status.
- WorkflowStatusRunning WorkflowStatus = "Running"
- // WorkflowStatusSkipped specifies the workflow status skipped state for
- // workflow status.
- WorkflowStatusSkipped WorkflowStatus = "Skipped"
- // WorkflowStatusSucceeded specifies the workflow status succeeded state
- // for workflow status.
- WorkflowStatusSucceeded WorkflowStatus = "Succeeded"
- // WorkflowStatusSuspended specifies the workflow status suspended state
- // for workflow status.
- WorkflowStatusSuspended WorkflowStatus = "Suspended"
- // WorkflowStatusWaiting specifies the workflow status waiting state for
- // workflow status.
- WorkflowStatusWaiting WorkflowStatus = "Waiting"
-)
-
-// WorkflowTriggerProvisioningState enumerates the values for workflow trigger
-// provisioning state.
-type WorkflowTriggerProvisioningState string
-
-const (
- // WorkflowTriggerProvisioningStateCreating specifies the workflow trigger
- // provisioning state creating state for workflow trigger provisioning
- // state.
- WorkflowTriggerProvisioningStateCreating WorkflowTriggerProvisioningState = "Creating"
- // WorkflowTriggerProvisioningStateNotSpecified specifies the workflow
- // trigger provisioning state not specified state for workflow trigger
- // provisioning state.
- WorkflowTriggerProvisioningStateNotSpecified WorkflowTriggerProvisioningState = "NotSpecified"
- // WorkflowTriggerProvisioningStateSucceeded specifies the workflow
- // trigger provisioning state succeeded state for workflow trigger
- // provisioning state.
- WorkflowTriggerProvisioningStateSucceeded WorkflowTriggerProvisioningState = "Succeeded"
- // WorkflowTriggerProvisioningStateUpdating specifies the workflow trigger
- // provisioning state updating state for workflow trigger provisioning
- // state.
- WorkflowTriggerProvisioningStateUpdating WorkflowTriggerProvisioningState = "Updating"
+// TrailingSeparatorPolicy enumerates the values for trailing separator policy.
+type TrailingSeparatorPolicy string
+
+const (
+ // TrailingSeparatorPolicyMandatory specifies the trailing separator
+ // policy mandatory state for trailing separator policy.
+ TrailingSeparatorPolicyMandatory TrailingSeparatorPolicy = "Mandatory"
+ // TrailingSeparatorPolicyNotAllowed specifies the trailing separator
+ // policy not allowed state for trailing separator policy.
+ TrailingSeparatorPolicyNotAllowed TrailingSeparatorPolicy = "NotAllowed"
+ // TrailingSeparatorPolicyNotSpecified specifies the trailing separator
+ // policy not specified state for trailing separator policy.
+ TrailingSeparatorPolicyNotSpecified TrailingSeparatorPolicy = "NotSpecified"
+ // TrailingSeparatorPolicyOptional specifies the trailing separator policy
+ // optional state for trailing separator policy.
+ TrailingSeparatorPolicyOptional TrailingSeparatorPolicy = "Optional"
)
-// ContentHash is
-type ContentHash struct {
- Algorithm *string `json:"algorithm,omitempty"`
- Value *string `json:"value,omitempty"`
-}
+// UsageIndicator enumerates the values for usage indicator.
+type UsageIndicator string
-// ContentLink is
-type ContentLink struct {
- URI *string `json:"uri,omitempty"`
- ContentVersion *string `json:"contentVersion,omitempty"`
- ContentSize *int32 `json:"contentSize,omitempty"`
- ContentHash *ContentHash `json:"contentHash,omitempty"`
- Metadata *map[string]interface{} `json:"metadata,omitempty"`
-}
-
-// RegenerateSecretKeyParameters is
-type RegenerateSecretKeyParameters struct {
- KeyType KeyType `json:"keyType,omitempty"`
-}
+const (
+ // UsageIndicatorInformation specifies the usage indicator information
+ // state for usage indicator.
+ UsageIndicatorInformation UsageIndicator = "Information"
+ // UsageIndicatorNotSpecified specifies the usage indicator not specified
+ // state for usage indicator.
+ UsageIndicatorNotSpecified UsageIndicator = "NotSpecified"
+ // UsageIndicatorProduction specifies the usage indicator production state
+ // for usage indicator.
+ UsageIndicatorProduction UsageIndicator = "Production"
+ // UsageIndicatorTest specifies the usage indicator test state for usage
+ // indicator.
+ UsageIndicatorTest UsageIndicator = "Test"
+)
-// Resource is
-type Resource struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
+// X12CharacterSet enumerates the values for x12 character set.
+type X12CharacterSet string
-// ResourceReference is
-type ResourceReference struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
-}
+const (
+ // X12CharacterSetBasic specifies the x12 character set basic state for
+ // x12 character set.
+ X12CharacterSetBasic X12CharacterSet = "Basic"
+ // X12CharacterSetExtended specifies the x12 character set extended state
+ // for x12 character set.
+ X12CharacterSetExtended X12CharacterSet = "Extended"
+ // X12CharacterSetNotSpecified specifies the x12 character set not
+ // specified state for x12 character set.
+ X12CharacterSetNotSpecified X12CharacterSet = "NotSpecified"
+ // X12CharacterSetUTF8 specifies the x12 character set utf8 state for x12
+ // character set.
+ X12CharacterSetUTF8 X12CharacterSet = "UTF8"
+)
+
+// X12DateFormat enumerates the values for x12 date format.
+type X12DateFormat string
+
+const (
+ // X12DateFormatCCYYMMDD specifies the x12 date format ccyymmdd state for
+ // x12 date format.
+ X12DateFormatCCYYMMDD X12DateFormat = "CCYYMMDD"
+ // X12DateFormatNotSpecified specifies the x12 date format not specified
+ // state for x12 date format.
+ X12DateFormatNotSpecified X12DateFormat = "NotSpecified"
+ // X12DateFormatYYMMDD specifies the x12 date format yymmdd state for x12
+ // date format.
+ X12DateFormatYYMMDD X12DateFormat = "YYMMDD"
+)
+
+// X12TimeFormat enumerates the values for x12 time format.
+type X12TimeFormat string
-// RunWorkflowParameters is
-type RunWorkflowParameters struct {
- Name *string `json:"name,omitempty"`
- Outputs *map[string]interface{} `json:"outputs,omitempty"`
+const (
+ // X12TimeFormatHHMM specifies the x12 time format hhmm state for x12 time
+ // format.
+ X12TimeFormatHHMM X12TimeFormat = "HHMM"
+ // X12TimeFormatHHMMSS specifies the x12 time format hhmmss state for x12
+ // time format.
+ X12TimeFormatHHMMSS X12TimeFormat = "HHMMSS"
+ // X12TimeFormatHHMMSSd specifies the x12 time format hhmms sd state for
+ // x12 time format.
+ X12TimeFormatHHMMSSd X12TimeFormat = "HHMMSSd"
+ // X12TimeFormatHHMMSSdd specifies the x12 time format hhmms sdd state for
+ // x12 time format.
+ X12TimeFormatHHMMSSdd X12TimeFormat = "HHMMSSdd"
+ // X12TimeFormatNotSpecified specifies the x12 time format not specified
+ // state for x12 time format.
+ X12TimeFormatNotSpecified X12TimeFormat = "NotSpecified"
+)
+
+// AgreementContent is
+type AgreementContent struct {
+ AS2 *AS2AgreementContent `json:"AS2,omitempty"`
+ X12 *X12AgreementContent `json:"X12,omitempty"`
+ Edifact *EdifactAgreementContent `json:"Edifact,omitempty"`
+}
+
+// AS2AcknowledgementConnectionSettings is
+type AS2AcknowledgementConnectionSettings struct {
+ IgnoreCertificateNameMismatch *bool `json:"ignoreCertificateNameMismatch,omitempty"`
+ SupportHTTPStatusCodeContinue *bool `json:"supportHttpStatusCodeContinue,omitempty"`
+ KeepHTTPConnectionAlive *bool `json:"keepHttpConnectionAlive,omitempty"`
+ UnfoldHTTPHeaders *bool `json:"unfoldHttpHeaders,omitempty"`
+}
+
+// AS2AgreementContent is
+type AS2AgreementContent struct {
+ ReceiveAgreement *AS2OneWayAgreement `json:"receiveAgreement,omitempty"`
+ SendAgreement *AS2OneWayAgreement `json:"sendAgreement,omitempty"`
+}
+
+// AS2EnvelopeSettings is
+type AS2EnvelopeSettings struct {
+ MessageContentType *string `json:"messageContentType,omitempty"`
+ TransmitFileNameInMimeHeader *bool `json:"transmitFileNameInMimeHeader,omitempty"`
+ FileNameTemplate *string `json:"fileNameTemplate,omitempty"`
+ SuspendMessageOnFileNameGenerationError *bool `json:"SuspendMessageOnFileNameGenerationError,omitempty"`
+ AutogenerateFileName *bool `json:"AutogenerateFileName,omitempty"`
+}
+
+// AS2ErrorSettings is
+type AS2ErrorSettings struct {
+ SuspendDuplicateMessage *bool `json:"SuspendDuplicateMessage,omitempty"`
+ ResendIfMdnNotReceived *bool `json:"ResendIfMdnNotReceived,omitempty"`
+}
+
+// AS2MdnSettings is
+type AS2MdnSettings struct {
+ NeedMdn *bool `json:"needMdn,omitempty"`
+ SignMdn *bool `json:"signMdn,omitempty"`
+ SendMdnAsynchronously *bool `json:"sendMdnAsynchronously,omitempty"`
+ ReceiptDeliveryURL *string `json:"receiptDeliveryUrl,omitempty"`
+ DispositionNotificationTo *string `json:"dispositionNotificationTo,omitempty"`
+ SignOutboundMdnIfOptional *bool `json:"signOutboundMdnIfOptional,omitempty"`
+ MdnText *string `json:"mdnText,omitempty"`
+ SendInboundMdnToMessageBox *bool `json:"sendInboundMdnToMessageBox,omitempty"`
+ MicHashingAlgorithm HashingAlgorithm `json:"micHashingAlgorithm,omitempty"`
+}
+
+// AS2MessageConnectionSettings is
+type AS2MessageConnectionSettings struct {
+ IgnoreCertificateNameMismatch *bool `json:"ignoreCertificateNameMismatch,omitempty"`
+ SupportHTTPStatusCodeContinue *bool `json:"supportHttpStatusCodeContinue,omitempty"`
+ KeepHTTPConnectionAlive *bool `json:"keepHttpConnectionAlive,omitempty"`
+ UnfoldHTTPHeaders *bool `json:"unfoldHttpHeaders,omitempty"`
+}
+
+// AS2OneWayAgreement is
+type AS2OneWayAgreement struct {
+ SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"`
+ ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"`
+ ProtocolSettings *AS2ProtocolSettings `json:"protocolSettings,omitempty"`
+}
+
+// AS2ProtocolSettings is
+type AS2ProtocolSettings struct {
+ MessageConnectionSettings *AS2MessageConnectionSettings `json:"messageConnectionSettings,omitempty"`
+ AcknowledgementConnectionSettings *AS2AcknowledgementConnectionSettings `json:"acknowledgementConnectionSettings,omitempty"`
+ MdnSettings *AS2MdnSettings `json:"mdnSettings,omitempty"`
+ SecuritySettings *AS2SecuritySettings `json:"securitySettings,omitempty"`
+ ValidationSettings *AS2ValidationSettings `json:"validationSettings,omitempty"`
+ EnvelopeSettings *AS2EnvelopeSettings `json:"envelopeSettings,omitempty"`
+ ErrorSettings *AS2ErrorSettings `json:"errorSettings,omitempty"`
+}
+
+// AS2SecuritySettings is
+type AS2SecuritySettings struct {
+ OverrideGroupSigningCertificate *bool `json:"overrideGroupSigningCertificate,omitempty"`
+ SigningCertificateName *string `json:"signingCertificateName,omitempty"`
+ EncryptionCertificateName *string `json:"encryptionCertificateName,omitempty"`
+ EnableNrrForInboundEncodedMessages *bool `json:"enableNrrForInboundEncodedMessages,omitempty"`
+ EnableNrrForInboundDecodedMessages *bool `json:"enableNrrForInboundDecodedMessages,omitempty"`
+ EnableNrrForOutboundMdn *bool `json:"enableNrrForOutboundMdn,omitempty"`
+ EnableNrrForOutboundEncodedMessages *bool `json:"enableNrrForOutboundEncodedMessages,omitempty"`
+ EnableNrrForOutboundDecodedMessages *bool `json:"enableNrrForOutboundDecodedMessages,omitempty"`
+ EnableNrrForInboundMdn *bool `json:"enableNrrForInboundMdn,omitempty"`
+}
+
+// AS2ValidationSettings is
+type AS2ValidationSettings struct {
+ OverrideMessageProperties *bool `json:"overrideMessageProperties,omitempty"`
+ EncryptMessage *bool `json:"encryptMessage,omitempty"`
+ SignMessage *bool `json:"signMessage,omitempty"`
+ CompressMessage *bool `json:"compressMessage,omitempty"`
+ CheckDuplicateMessage *bool `json:"checkDuplicateMessage,omitempty"`
+ InterchangeDuplicatesValidityDays *int32 `json:"interchangeDuplicatesValidityDays,omitempty"`
+ CheckCertificateRevocationListOnSend *bool `json:"checkCertificateRevocationListOnSend,omitempty"`
+ CheckCertificateRevocationListOnReceive *bool `json:"checkCertificateRevocationListOnReceive,omitempty"`
+ EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
+}
+
+// B2BPartnerContent is
+type B2BPartnerContent struct {
+ BusinessIdentities *[]BusinessIdentity `json:"businessIdentities,omitempty"`
+}
+
+// BusinessIdentity is
+type BusinessIdentity struct {
+ Qualifier *string `json:"Qualifier,omitempty"`
+ Value *string `json:"Value,omitempty"`
}
-// Sku is
-type Sku struct {
- Name SkuName `json:"name,omitempty"`
- Plan *ResourceReference `json:"plan,omitempty"`
+// CallbackURL is
+type CallbackURL struct {
+ autorest.Response `json:"-"`
+ Value *string `json:"value,omitempty"`
}
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
+// EdifactAcknowledgementSettings is
+type EdifactAcknowledgementSettings struct {
+ NeedTechnicalAcknowledgement *bool `json:"needTechnicalAcknowledgement,omitempty"`
+ BatchTechnicalAcknowledgements *bool `json:"batchTechnicalAcknowledgements,omitempty"`
+ NeedFunctionalAcknowledgement *bool `json:"needFunctionalAcknowledgement,omitempty"`
+ BatchFunctionalAcknowledgements *bool `json:"batchFunctionalAcknowledgements,omitempty"`
+ NeedLoopForValidMessages *bool `json:"needLoopForValidMessages,omitempty"`
+ SendSynchronousAcknowledgement *bool `json:"sendSynchronousAcknowledgement,omitempty"`
+ AcknowledgementControlNumberPrefix *string `json:"acknowledgementControlNumberPrefix,omitempty"`
+ AcknowledgementControlNumberSuffix *string `json:"acknowledgementControlNumberSuffix,omitempty"`
+ AcknowledgementControlNumberLowerBound *int32 `json:"acknowledgementControlNumberLowerBound,omitempty"`
+ AcknowledgementControlNumberUpperBound *int32 `json:"acknowledgementControlNumberUpperBound,omitempty"`
+ RolloverAcknowledgementControlNumber *bool `json:"rolloverAcknowledgementControlNumber,omitempty"`
+}
+
+// EdifactAgreementContent is
+type EdifactAgreementContent struct {
+ ReceiveAgreement *EdifactOneWayAgreement `json:"receiveAgreement,omitempty"`
+ SendAgreement *EdifactOneWayAgreement `json:"sendAgreement,omitempty"`
+}
+
+// EdifactDelimiterOverride is
+type EdifactDelimiterOverride struct {
+ MessageID *string `json:"messageId,omitempty"`
+ MessageVersion *string `json:"messageVersion,omitempty"`
+ MessageRelease *string `json:"messageRelease,omitempty"`
+ DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"`
+ ComponentSeparator *int32 `json:"componentSeparator,omitempty"`
+ SegmentTerminator *int32 `json:"segmentTerminator,omitempty"`
+ RepetitionSeparator *int32 `json:"repetitionSeparator,omitempty"`
+ SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"`
+ DecimalPointIndicator EdifactDecimalIndicator `json:"decimalPointIndicator,omitempty"`
+ ReleaseIndicator *int32 `json:"releaseIndicator,omitempty"`
+ MessageAssociationAssignedCode *string `json:"messageAssociationAssignedCode,omitempty"`
+ TargetNamespace *string `json:"targetNamespace,omitempty"`
+}
+
+// EdifactEnvelopeOverride is
+type EdifactEnvelopeOverride struct {
+ MessageID *string `json:"messageId,omitempty"`
+ MessageVersion *string `json:"messageVersion,omitempty"`
+ MessageRelease *string `json:"messageRelease,omitempty"`
+ MessageAssociationAssignedCode *string `json:"messageAssociationAssignedCode,omitempty"`
+ TargetNamespace *string `json:"targetNamespace,omitempty"`
+ FunctionalGroupID *string `json:"functionalGroupId,omitempty"`
+ SenderApplicationQualifier *string `json:"senderApplicationQualifier,omitempty"`
+ SenderApplicationID *string `json:"senderApplicationId,omitempty"`
+ ReceiverApplicationQualifier *string `json:"receiverApplicationQualifier,omitempty"`
+ ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"`
+ ControllingAgencyCode *string `json:"controllingAgencyCode,omitempty"`
+ GroupHeaderMessageVersion *string `json:"groupHeaderMessageVersion,omitempty"`
+ GroupHeaderMessageRelease *string `json:"groupHeaderMessageRelease,omitempty"`
+ AssociationAssignedCode *string `json:"associationAssignedCode,omitempty"`
+ ApplicationPassword *string `json:"applicationPassword,omitempty"`
+}
+
+// EdifactEnvelopeSettings is
+type EdifactEnvelopeSettings struct {
+ GroupAssociationAssignedCode *string `json:"groupAssociationAssignedCode,omitempty"`
+ CommunicationAgreementID *string `json:"communicationAgreementId,omitempty"`
+ ApplyDelimiterStringAdvice *bool `json:"applyDelimiterStringAdvice,omitempty"`
+ CreateGroupingSegments *bool `json:"createGroupingSegments,omitempty"`
+ EnableDefaultGroupHeaders *bool `json:"enableDefaultGroupHeaders,omitempty"`
+ RecipientReferencePasswordValue *string `json:"recipientReferencePasswordValue,omitempty"`
+ RecipientReferencePasswordQualifier *string `json:"recipientReferencePasswordQualifier,omitempty"`
+ ApplicationReferenceID *string `json:"applicationReferenceId,omitempty"`
+ ProcessingPriorityCode *string `json:"processingPriorityCode,omitempty"`
+ InterchangeControlNumberLowerBound *int64 `json:"interchangeControlNumberLowerBound,omitempty"`
+ InterchangeControlNumberUpperBound *int64 `json:"interchangeControlNumberUpperBound,omitempty"`
+ RolloverInterchangeControlNumber *bool `json:"rolloverInterchangeControlNumber,omitempty"`
+ InterchangeControlNumberPrefix *string `json:"interchangeControlNumberPrefix,omitempty"`
+ InterchangeControlNumberSuffix *string `json:"interchangeControlNumberSuffix,omitempty"`
+ SenderReverseRoutingAddress *string `json:"senderReverseRoutingAddress,omitempty"`
+ ReceiverReverseRoutingAddress *string `json:"receiverReverseRoutingAddress,omitempty"`
+ FunctionalGroupID *string `json:"functionalGroupId,omitempty"`
+ GroupControllingAgencyCode *string `json:"groupControllingAgencyCode,omitempty"`
+ GroupMessageVersion *string `json:"groupMessageVersion,omitempty"`
+ GroupMessageRelease *string `json:"groupMessageRelease,omitempty"`
+ GroupControlNumberLowerBound *int64 `json:"groupControlNumberLowerBound,omitempty"`
+ GroupControlNumberUpperBound *int64 `json:"groupControlNumberUpperBound,omitempty"`
+ RolloverGroupControlNumber *bool `json:"rolloverGroupControlNumber,omitempty"`
+ GroupControlNumberPrefix *string `json:"groupControlNumberPrefix,omitempty"`
+ GroupControlNumberSuffix *string `json:"groupControlNumberSuffix,omitempty"`
+ GroupApplicationReceiverQualifier *string `json:"groupApplicationReceiverQualifier,omitempty"`
+ GroupApplicationReceiverID *string `json:"groupApplicationReceiverId,omitempty"`
+ GroupApplicationSenderQualifier *string `json:"groupApplicationSenderQualifier,omitempty"`
+ GroupApplicationSenderID *string `json:"groupApplicationSenderId,omitempty"`
+ GroupApplicationPassword *string `json:"groupApplicationPassword,omitempty"`
+ OverwriteExistingTransactionSetControlNumber *bool `json:"overwriteExistingTransactionSetControlNumber,omitempty"`
+ TransactionSetControlNumberPrefix *string `json:"transactionSetControlNumberPrefix,omitempty"`
+ TransactionSetControlNumberSuffix *string `json:"transactionSetControlNumberSuffix,omitempty"`
+ TransactionSetControlNumberLowerBound *int64 `json:"transactionSetControlNumberLowerBound,omitempty"`
+ TransactionSetControlNumberUpperBound *int64 `json:"transactionSetControlNumberUpperBound,omitempty"`
+ RolloverTransactionSetControlNumber *bool `json:"rolloverTransactionSetControlNumber,omitempty"`
+ IsTestInterchange *bool `json:"isTestInterchange,omitempty"`
+ SenderInternalIdentification *string `json:"senderInternalIdentification,omitempty"`
+ SenderInternalSubIdentification *string `json:"senderInternalSubIdentification,omitempty"`
+ ReceiverInternalIdentification *string `json:"receiverInternalIdentification,omitempty"`
+ ReceiverInternalSubIdentification *string `json:"receiverInternalSubIdentification,omitempty"`
+}
+
+// EdifactFramingSettings is
+type EdifactFramingSettings struct {
+ ServiceCodeListDirectoryVersion *string `json:"serviceCodeListDirectoryVersion,omitempty"`
+ CharacterEncoding *string `json:"characterEncoding,omitempty"`
+ ProtocolVersion *int32 `json:"protocolVersion,omitempty"`
+ DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"`
+ ComponentSeparator *int32 `json:"componentSeparator,omitempty"`
+ SegmentTerminator *int32 `json:"segmentTerminator,omitempty"`
+ ReleaseIndicator *int32 `json:"releaseIndicator,omitempty"`
+ RepetitionSeparator *int32 `json:"repetitionSeparator,omitempty"`
+ CharacterSet EdifactCharacterSet `json:"characterSet,omitempty"`
+ DecimalPointIndicator EdifactDecimalIndicator `json:"decimalPointIndicator,omitempty"`
+ SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"`
+}
+
+// EdifactMessageFilter is
+type EdifactMessageFilter struct {
+ MessageFilterType MessageFilterType `json:"messageFilterType,omitempty"`
+}
+
+// EdifactMessageIdentifier is
+type EdifactMessageIdentifier struct {
+ MessageID *string `json:"messageId,omitempty"`
+}
+
+// EdifactOneWayAgreement is
+type EdifactOneWayAgreement struct {
+ SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"`
+ ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"`
+ ProtocolSettings *EdifactProtocolSettings `json:"protocolSettings,omitempty"`
+}
+
+// EdifactProcessingSettings is
+type EdifactProcessingSettings struct {
+ MaskSecurityInfo *bool `json:"maskSecurityInfo,omitempty"`
+ PreserveInterchange *bool `json:"preserveInterchange,omitempty"`
+ SuspendInterchangeOnError *bool `json:"suspendInterchangeOnError,omitempty"`
+ CreateEmptyXMLTagsForTrailingSeparators *bool `json:"createEmptyXmlTagsForTrailingSeparators,omitempty"`
+ UseDotAsDecimalSeparator *bool `json:"useDotAsDecimalSeparator,omitempty"`
+}
+
+// EdifactProtocolSettings is
+type EdifactProtocolSettings struct {
+ ValidationSettings *EdifactValidationSettings `json:"validationSettings,omitempty"`
+ FramingSettings *EdifactFramingSettings `json:"framingSettings,omitempty"`
+ EnvelopeSettings *EdifactEnvelopeSettings `json:"envelopeSettings,omitempty"`
+ AcknowledgementSettings *EdifactAcknowledgementSettings `json:"acknowledgementSettings,omitempty"`
+ MessageFilter *EdifactMessageFilter `json:"messageFilter,omitempty"`
+ ProcessingSettings *EdifactProcessingSettings `json:"processingSettings,omitempty"`
+ EnvelopeOverrides *[]EdifactEnvelopeOverride `json:"envelopeOverrides,omitempty"`
+ MessageFilterList *[]EdifactMessageIdentifier `json:"messageFilterList,omitempty"`
+ SchemaReferences *[]EdifactSchemaReference `json:"schemaReferences,omitempty"`
+ ValidationOverrides *[]EdifactValidationOverride `json:"validationOverrides,omitempty"`
+ EdifactDelimiterOverrides *[]EdifactDelimiterOverride `json:"edifactDelimiterOverrides,omitempty"`
+}
+
+// EdifactSchemaReference is
+type EdifactSchemaReference struct {
+ MessageID *string `json:"messageId,omitempty"`
+ MessageVersion *string `json:"messageVersion,omitempty"`
+ MessageRelease *string `json:"messageRelease,omitempty"`
+ SenderApplicationID *string `json:"senderApplicationId,omitempty"`
+ SenderApplicationQualifier *string `json:"senderApplicationQualifier,omitempty"`
+ AssociationAssignedCode *string `json:"associationAssignedCode,omitempty"`
+ SchemaName *string `json:"schemaName,omitempty"`
+}
+
+// EdifactValidationOverride is
+type EdifactValidationOverride struct {
+ MessageID *string `json:"messageId,omitempty"`
+ EnforceCharacterSet *bool `json:"enforceCharacterSet,omitempty"`
+ ValidateEDITypes *bool `json:"validateEDITypes,omitempty"`
+ ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"`
+ AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"`
+ TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"`
+}
+
+// EdifactValidationSettings is
+type EdifactValidationSettings struct {
+ ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"`
+ CheckDuplicateInterchangeControlNumber *bool `json:"checkDuplicateInterchangeControlNumber,omitempty"`
+ InterchangeControlNumberValidityDays *int32 `json:"interchangeControlNumberValidityDays,omitempty"`
+ CheckDuplicateGroupControlNumber *bool `json:"checkDuplicateGroupControlNumber,omitempty"`
+ CheckDuplicateTransactionSetControlNumber *bool `json:"checkDuplicateTransactionSetControlNumber,omitempty"`
+ ValidateEDITypes *bool `json:"validateEDITypes,omitempty"`
+ ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"`
+ AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"`
}
-// Workflow is
-type Workflow struct {
+// IntegrationAccount is
+type IntegrationAccount struct {
autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
- Properties *WorkflowProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
+ Sku *IntegrationAccountSku `json:"sku,omitempty"`
}
-// WorkflowAccessKey is
-type WorkflowAccessKey struct {
+// IntegrationAccountAgreement is
+type IntegrationAccountAgreement struct {
autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Properties *WorkflowAccessKeyProperties `json:"properties,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *IntegrationAccountAgreementProperties `json:"properties,omitempty"`
}
-// WorkflowAccessKeyListResult is
-type WorkflowAccessKeyListResult struct {
+// IntegrationAccountAgreementFilter is
+type IntegrationAccountAgreementFilter struct {
+ AgreementType AgreementType `json:"agreementType,omitempty"`
+}
+
+// IntegrationAccountAgreementListResult is
+type IntegrationAccountAgreementListResult struct {
autorest.Response `json:"-"`
- Value *[]WorkflowAccessKey `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ Value *[]IntegrationAccountAgreement `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowAccessKeyListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountAgreementListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowAccessKeyListResult) WorkflowAccessKeyListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountAgreementListResult) IntegrationAccountAgreementListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -294,27 +689,40 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowAccessKeyProperties is
-type WorkflowAccessKeyProperties struct {
- NotBefore *date.Time `json:"notBefore,omitempty"`
- NotAfter *date.Time `json:"notAfter,omitempty"`
+// IntegrationAccountAgreementProperties is
+type IntegrationAccountAgreementProperties struct {
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ChangedTime *date.Time `json:"changedTime,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
+ AgreementType AgreementType `json:"agreementType,omitempty"`
+ HostPartner *string `json:"hostPartner,omitempty"`
+ GuestPartner *string `json:"guestPartner,omitempty"`
+ HostIdentity *BusinessIdentity `json:"hostIdentity,omitempty"`
+ GuestIdentity *BusinessIdentity `json:"guestIdentity,omitempty"`
+ Content *AgreementContent `json:"content,omitempty"`
}
-// WorkflowFilter is
-type WorkflowFilter struct {
- State WorkflowState `json:"state,omitempty"`
+// IntegrationAccountCertificate is
+type IntegrationAccountCertificate struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *IntegrationAccountCertificateProperties `json:"properties,omitempty"`
}
-// WorkflowListResult is
-type WorkflowListResult struct {
+// IntegrationAccountCertificateListResult is
+type IntegrationAccountCertificateListResult struct {
autorest.Response `json:"-"`
- Value *[]Workflow `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ Value *[]IntegrationAccountCertificate `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountCertificateListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowListResult) WorkflowListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountCertificateListResult) IntegrationAccountCertificateListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -324,69 +732,40 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowOutputParameter is
-type WorkflowOutputParameter struct {
- Type ParameterType `json:"type,omitempty"`
- Value *map[string]interface{} `json:"value,omitempty"`
- Metadata *map[string]interface{} `json:"metadata,omitempty"`
- Error *map[string]interface{} `json:"error,omitempty"`
+// IntegrationAccountCertificateProperties is
+type IntegrationAccountCertificateProperties struct {
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ChangedTime *date.Time `json:"changedTime,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
+ Key *KeyVaultKeyReference `json:"key,omitempty"`
+ PublicCertificate *string `json:"publicCertificate,omitempty"`
}
-// WorkflowParameter is
-type WorkflowParameter struct {
- Type ParameterType `json:"type,omitempty"`
- Value *map[string]interface{} `json:"value,omitempty"`
- Metadata *map[string]interface{} `json:"metadata,omitempty"`
-}
-
-// WorkflowProperties is
-type WorkflowProperties struct {
- ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"`
- CreatedTime *date.Time `json:"createdTime,omitempty"`
- ChangedTime *date.Time `json:"changedTime,omitempty"`
- State WorkflowState `json:"state,omitempty"`
- Version *string `json:"version,omitempty"`
- AccessEndpoint *string `json:"accessEndpoint,omitempty"`
- Sku *Sku `json:"sku,omitempty"`
- DefinitionLink *ContentLink `json:"definitionLink,omitempty"`
- Definition *map[string]interface{} `json:"definition,omitempty"`
- ParametersLink *ContentLink `json:"parametersLink,omitempty"`
- Parameters *map[string]*WorkflowParameter `json:"parameters,omitempty"`
-}
-
-// WorkflowRun is
-type WorkflowRun struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Properties *WorkflowRunProperties `json:"properties,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
-}
-
-// WorkflowRunAction is
-type WorkflowRunAction struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Properties *WorkflowRunActionProperties `json:"properties,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
+// IntegrationAccountContentHash is
+type IntegrationAccountContentHash struct {
+ Algorithm *string `json:"algorithm,omitempty"`
+ Value *string `json:"value,omitempty"`
}
-// WorkflowRunActionFilter is
-type WorkflowRunActionFilter struct {
- Status WorkflowStatus `json:"status,omitempty"`
+// IntegrationAccountContentLink is
+type IntegrationAccountContentLink struct {
+ URI *string `json:"uri,omitempty"`
+ ContentVersion *string `json:"contentVersion,omitempty"`
+ ContentSize *int64 `json:"contentSize,omitempty"`
+ ContentHash *IntegrationAccountContentHash `json:"contentHash,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
}
-// WorkflowRunActionListResult is
-type WorkflowRunActionListResult struct {
+// IntegrationAccountListResult is
+type IntegrationAccountListResult struct {
autorest.Response `json:"-"`
- Value *[]WorkflowRunAction `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ Value *[]IntegrationAccount `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowRunActionListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowRunActionListResult) WorkflowRunActionListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountListResult) IntegrationAccountListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -396,33 +775,32 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowRunActionProperties is
-type WorkflowRunActionProperties struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- Status WorkflowStatus `json:"status,omitempty"`
- Code *string `json:"code,omitempty"`
- Error *map[string]interface{} `json:"error,omitempty"`
- TrackingID *string `json:"trackingId,omitempty"`
- InputsLink *ContentLink `json:"inputsLink,omitempty"`
- OutputsLink *ContentLink `json:"outputsLink,omitempty"`
+// IntegrationAccountMap is
+type IntegrationAccountMap struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *IntegrationAccountMapProperties `json:"properties,omitempty"`
}
-// WorkflowRunFilter is
-type WorkflowRunFilter struct {
- Status WorkflowStatus `json:"status,omitempty"`
+// IntegrationAccountMapFilter is
+type IntegrationAccountMapFilter struct {
+ SchemaType MapType `json:"schemaType,omitempty"`
}
-// WorkflowRunListResult is
-type WorkflowRunListResult struct {
+// IntegrationAccountMapListResult is
+type IntegrationAccountMapListResult struct {
autorest.Response `json:"-"`
- Value *[]WorkflowRun `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ Value *[]IntegrationAccountMap `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowRunListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountMapListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowRunListResult) WorkflowRunListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountMapListResult) IntegrationAccountMapListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -432,74 +810,43 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowRunProperties is
-type WorkflowRunProperties struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- Status WorkflowStatus `json:"status,omitempty"`
- Code *string `json:"code,omitempty"`
- Error *map[string]interface{} `json:"error,omitempty"`
- CorrelationID *string `json:"correlationId,omitempty"`
- Workflow *ResourceReference `json:"workflow,omitempty"`
- Trigger *WorkflowRunTrigger `json:"trigger,omitempty"`
- Outputs *map[string]*WorkflowOutputParameter `json:"outputs,omitempty"`
-}
-
-// WorkflowRunTrigger is
-type WorkflowRunTrigger struct {
- Name *string `json:"name,omitempty"`
- Inputs *map[string]interface{} `json:"inputs,omitempty"`
- InputsLink *ContentLink `json:"inputsLink,omitempty"`
- Outputs *map[string]interface{} `json:"outputs,omitempty"`
- OutputsLink *ContentLink `json:"outputsLink,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- TrackingID *string `json:"trackingId,omitempty"`
- Code *string `json:"code,omitempty"`
- Status WorkflowStatus `json:"status,omitempty"`
- Error *map[string]interface{} `json:"error,omitempty"`
+// IntegrationAccountMapProperties is
+type IntegrationAccountMapProperties struct {
+ MapType MapType `json:"mapType,omitempty"`
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ChangedTime *date.Time `json:"changedTime,omitempty"`
+ Content *map[string]interface{} `json:"content,omitempty"`
+ ContentType *string `json:"contentType,omitempty"`
+ ContentLink *IntegrationAccountContentLink `json:"contentLink,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
}
-// WorkflowSecretKeys is
-type WorkflowSecretKeys struct {
- autorest.Response `json:"-"`
- PrimarySecretKey *string `json:"primarySecretKey,omitempty"`
- SecondarySecretKey *string `json:"secondarySecretKey,omitempty"`
-}
-
-// WorkflowTrigger is
-type WorkflowTrigger struct {
+// IntegrationAccountPartner is
+type IntegrationAccountPartner struct {
autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Properties *WorkflowTriggerProperties `json:"properties,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *IntegrationAccountPartnerProperties `json:"properties,omitempty"`
}
-// WorkflowTriggerFilter is
-type WorkflowTriggerFilter struct {
- State WorkflowState `json:"state,omitempty"`
+// IntegrationAccountPartnerFilter is
+type IntegrationAccountPartnerFilter struct {
+ PartnerType PartnerType `json:"partnerType,omitempty"`
}
-// WorkflowTriggerHistory is
-type WorkflowTriggerHistory struct {
+// IntegrationAccountPartnerListResult is
+type IntegrationAccountPartnerListResult struct {
autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Properties *WorkflowTriggerHistoryProperties `json:"properties,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
+ Value *[]IntegrationAccountPartner `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowTriggerHistoryListResult is
-type WorkflowTriggerHistoryListResult struct {
- autorest.Response `json:"-"`
- Value *[]WorkflowTriggerHistory `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// WorkflowTriggerHistoryListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountPartnerListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowTriggerHistoryListResult) WorkflowTriggerHistoryListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountPartnerListResult) IntegrationAccountPartnerListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -509,30 +856,50 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowTriggerHistoryProperties is
-type WorkflowTriggerHistoryProperties struct {
- StartTime *date.Time `json:"startTime,omitempty"`
- EndTime *date.Time `json:"endTime,omitempty"`
- Status WorkflowStatus `json:"status,omitempty"`
- Code *string `json:"code,omitempty"`
- Error *map[string]interface{} `json:"error,omitempty"`
- TrackingID *string `json:"trackingId,omitempty"`
- InputsLink *ContentLink `json:"inputsLink,omitempty"`
- OutputsLink *ContentLink `json:"outputsLink,omitempty"`
- Fired *bool `json:"fired,omitempty"`
- Run *ResourceReference `json:"run,omitempty"`
+// IntegrationAccountPartnerProperties is
+type IntegrationAccountPartnerProperties struct {
+ PartnerType PartnerType `json:"partnerType,omitempty"`
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ChangedTime *date.Time `json:"changedTime,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
+ Content *PartnerContent `json:"content,omitempty"`
+}
+
+// IntegrationAccountResource is
+type IntegrationAccountResource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// IntegrationAccountSchema is
+type IntegrationAccountSchema struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *IntegrationAccountSchemaProperties `json:"properties,omitempty"`
+}
+
+// IntegrationAccountSchemaFilter is
+type IntegrationAccountSchemaFilter struct {
+ SchemaType SchemaType `json:"schemaType,omitempty"`
}
-// WorkflowTriggerListResult is
-type WorkflowTriggerListResult struct {
+// IntegrationAccountSchemaListResult is
+type IntegrationAccountSchemaListResult struct {
autorest.Response `json:"-"`
- Value *[]WorkflowTrigger `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ Value *[]IntegrationAccountSchema `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
-// WorkflowTriggerListResultPreparer prepares a request to retrieve the next set of results. It returns
+// IntegrationAccountSchemaListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
-func (client WorkflowTriggerListResult) WorkflowTriggerListResultPreparer() (*http.Request, error) {
+func (client IntegrationAccountSchemaListResult) IntegrationAccountSchemaListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
@@ -542,48 +909,218 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// WorkflowTriggerProperties is
-type WorkflowTriggerProperties struct {
- ProvisioningState WorkflowTriggerProvisioningState `json:"provisioningState,omitempty"`
- CreatedTime *date.Time `json:"createdTime,omitempty"`
- ChangedTime *date.Time `json:"changedTime,omitempty"`
- State WorkflowState `json:"state,omitempty"`
- Status WorkflowStatus `json:"status,omitempty"`
- LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"`
- NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"`
- Recurrence *WorkflowTriggerRecurrence `json:"recurrence,omitempty"`
- Workflow *ResourceReference `json:"workflow,omitempty"`
-}
-
-// WorkflowTriggerRecurrence is
-type WorkflowTriggerRecurrence struct {
- Frequency RecurrenceFrequency `json:"frequency,omitempty"`
- Interval *int `json:"interval,omitempty"`
- StartTime *date.Time `json:"startTime,omitempty"`
- TimeZone *string `json:"timeZone,omitempty"`
-}
-
-// WorkflowVersion is
-type WorkflowVersion struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
- Properties *WorkflowVersionProperties `json:"properties,omitempty"`
-}
-
-// WorkflowVersionProperties is
-type WorkflowVersionProperties struct {
- CreatedTime *date.Time `json:"createdTime,omitempty"`
- ChangedTime *date.Time `json:"changedTime,omitempty"`
- State WorkflowState `json:"state,omitempty"`
- Version *string `json:"version,omitempty"`
- AccessEndpoint *string `json:"accessEndpoint,omitempty"`
- Sku *Sku `json:"sku,omitempty"`
- DefinitionLink *ContentLink `json:"definitionLink,omitempty"`
- Definition *map[string]interface{} `json:"definition,omitempty"`
- ParametersLink *ContentLink `json:"parametersLink,omitempty"`
- Parameters *map[string]*WorkflowParameter `json:"parameters,omitempty"`
+// IntegrationAccountSchemaProperties is
+type IntegrationAccountSchemaProperties struct {
+ SchemaType SchemaType `json:"schemaType,omitempty"`
+ TargetNamespace *string `json:"targetNamespace,omitempty"`
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ChangedTime *date.Time `json:"changedTime,omitempty"`
+ Content *map[string]interface{} `json:"content,omitempty"`
+ ContentType *string `json:"contentType,omitempty"`
+ ContentLink *IntegrationAccountContentLink `json:"contentLink,omitempty"`
+ Metadata *map[string]interface{} `json:"metadata,omitempty"`
+}
+
+// IntegrationAccountSku is
+type IntegrationAccountSku struct {
+ Name SkuName `json:"name,omitempty"`
+}
+
+// KeyVaultKeyReference is
+type KeyVaultKeyReference struct {
+ KeyVault *ResourceReference `json:"keyVault,omitempty"`
+ KeyName *string `json:"keyName,omitempty"`
+ KeyVersion *string `json:"keyVersion,omitempty"`
+}
+
+// ListCallbackURLParameters is
+type ListCallbackURLParameters struct {
+ NotAfter *date.Time `json:"NotAfter,omitempty"`
+}
+
+// PartnerContent is
+type PartnerContent struct {
+ B2b *B2BPartnerContent `json:"b2b,omitempty"`
+}
+
+// ResourceReference is
+type ResourceReference struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// X12AcknowledgementSettings is
+type X12AcknowledgementSettings struct {
+ NeedTechnicalAcknowledgement *bool `json:"needTechnicalAcknowledgement,omitempty"`
+ BatchTechnicalAcknowledgements *bool `json:"batchTechnicalAcknowledgements,omitempty"`
+ NeedFunctionalAcknowledgement *bool `json:"needFunctionalAcknowledgement,omitempty"`
+ FunctionalAcknowledgementVersion *string `json:"functionalAcknowledgementVersion,omitempty"`
+ BatchFunctionalAcknowledgements *bool `json:"batchFunctionalAcknowledgements,omitempty"`
+ NeedImplementationAcknowledgement *bool `json:"needImplementationAcknowledgement,omitempty"`
+ ImplementationAcknowledgementVersion *string `json:"implementationAcknowledgementVersion,omitempty"`
+ BatchImplementationAcknowledgements *bool `json:"batchImplementationAcknowledgements,omitempty"`
+ NeedLoopForValidMessages *bool `json:"needLoopForValidMessages,omitempty"`
+ SendSynchronousAcknowledgement *bool `json:"sendSynchronousAcknowledgement,omitempty"`
+ AcknowledgementControlNumberPrefix *string `json:"acknowledgementControlNumberPrefix,omitempty"`
+ AcknowledgementControlNumberSuffix *string `json:"acknowledgementControlNumberSuffix,omitempty"`
+ AcknowledgementControlNumberLowerBound *int32 `json:"acknowledgementControlNumberLowerBound,omitempty"`
+ AcknowledgementControlNumberUpperBound *int32 `json:"acknowledgementControlNumberUpperBound,omitempty"`
+ RolloverAcknowledgementControlNumber *bool `json:"rolloverAcknowledgementControlNumber,omitempty"`
+}
+
+// X12AgreementContent is
+type X12AgreementContent struct {
+ ReceiveAgreement *X12OneWayAgreement `json:"receiveAgreement,omitempty"`
+ SendAgreement *X12OneWayAgreement `json:"sendAgreement,omitempty"`
+}
+
+// X12DelimiterOverrides is
+type X12DelimiterOverrides struct {
+ ProtocolVersion *string `json:"protocolVersion,omitempty"`
+ MessageID *string `json:"messageId,omitempty"`
+ DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"`
+ ComponentSeparator *int32 `json:"componentSeparator,omitempty"`
+ SegmentTerminator *int32 `json:"segmentTerminator,omitempty"`
+ SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"`
+ ReplaceCharacter *int32 `json:"replaceCharacter,omitempty"`
+ ReplaceSeparatorsInPayload *bool `json:"replaceSeparatorsInPayload,omitempty"`
+ TargetNamespace *string `json:"targetNamespace,omitempty"`
+}
+
+// X12EnvelopeOverride is
+type X12EnvelopeOverride struct {
+ TargetNamespace *string `json:"targetNamespace,omitempty"`
+ ProtocolVersion *string `json:"protocolVersion,omitempty"`
+ MessageID *string `json:"messageId,omitempty"`
+ ResponsibleAgencyCode *int32 `json:"responsibleAgencyCode,omitempty"`
+ HeaderVersion *string `json:"headerVersion,omitempty"`
+ SenderApplicationID *string `json:"senderApplicationId,omitempty"`
+ ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"`
+ FunctionalIdentifierCode *string `json:"functionalIdentifierCode,omitempty"`
+ DateFormat X12DateFormat `json:"dateFormat,omitempty"`
+ TimeFormat X12TimeFormat `json:"timeFormat,omitempty"`
+}
+
+// X12EnvelopeSettings is
+type X12EnvelopeSettings struct {
+ ControlStandardsID *int32 `json:"controlStandardsId,omitempty"`
+ UseControlStandardsIDAsRepetitionCharacter *bool `json:"useControlStandardsIdAsRepetitionCharacter,omitempty"`
+ SenderApplicationID *string `json:"senderApplicationId,omitempty"`
+ ReceiverApplicationID *string `json:"receiverApplicationId,omitempty"`
+ ControlVersionNumber *string `json:"controlVersionNumber,omitempty"`
+ InterchangeControlNumberLowerBound *int32 `json:"interchangeControlNumberLowerBound,omitempty"`
+ InterchangeControlNumberUpperBound *int32 `json:"interchangeControlNumberUpperBound,omitempty"`
+ RolloverInterchangeControlNumber *bool `json:"rolloverInterchangeControlNumber,omitempty"`
+ EnableDefaultGroupHeaders *bool `json:"enableDefaultGroupHeaders,omitempty"`
+ FunctionalGroupID *string `json:"functionalGroupId,omitempty"`
+ GroupControlNumberLowerBound *int32 `json:"groupControlNumberLowerBound,omitempty"`
+ GroupControlNumberUpperBound *int32 `json:"groupControlNumberUpperBound,omitempty"`
+ RolloverGroupControlNumber *bool `json:"rolloverGroupControlNumber,omitempty"`
+ GroupHeaderAgencyCode *string `json:"groupHeaderAgencyCode,omitempty"`
+ GroupHeaderVersion *string `json:"groupHeaderVersion,omitempty"`
+ TransactionSetControlNumberLowerBound *int32 `json:"transactionSetControlNumberLowerBound,omitempty"`
+ TransactionSetControlNumberUpperBound *int32 `json:"transactionSetControlNumberUpperBound,omitempty"`
+ RolloverTransactionSetControlNumber *bool `json:"rolloverTransactionSetControlNumber,omitempty"`
+ TransactionSetControlNumberPrefix *string `json:"transactionSetControlNumberPrefix,omitempty"`
+ TransactionSetControlNumberSuffix *string `json:"transactionSetControlNumberSuffix,omitempty"`
+ OverwriteExistingTransactionSetControlNumber *bool `json:"overwriteExistingTransactionSetControlNumber,omitempty"`
+ GroupHeaderDateFormat X12DateFormat `json:"groupHeaderDateFormat,omitempty"`
+ GroupHeaderTimeFormat X12TimeFormat `json:"groupHeaderTimeFormat,omitempty"`
+ UsageIndicator UsageIndicator `json:"usageIndicator,omitempty"`
+}
+
+// X12FramingSettings is
+type X12FramingSettings struct {
+ DataElementSeparator *int32 `json:"dataElementSeparator,omitempty"`
+ ComponentSeparator *int32 `json:"componentSeparator,omitempty"`
+ ReplaceSeparatorsInPayload *bool `json:"replaceSeparatorsInPayload,omitempty"`
+ ReplaceCharacter *int32 `json:"replaceCharacter,omitempty"`
+ SegmentTerminator *int32 `json:"segmentTerminator,omitempty"`
+ CharacterSet X12CharacterSet `json:"characterSet,omitempty"`
+ SegmentTerminatorSuffix SegmentTerminatorSuffix `json:"segmentTerminatorSuffix,omitempty"`
+}
+
+// X12MessageFilter is
+type X12MessageFilter struct {
+ MessageFilterType MessageFilterType `json:"messageFilterType,omitempty"`
+}
+
+// X12MessageIdentifier is
+type X12MessageIdentifier struct {
+ MessageID *string `json:"messageId,omitempty"`
+}
+
+// X12OneWayAgreement is
+type X12OneWayAgreement struct {
+ SenderBusinessIdentity *BusinessIdentity `json:"senderBusinessIdentity,omitempty"`
+ ReceiverBusinessIdentity *BusinessIdentity `json:"receiverBusinessIdentity,omitempty"`
+ ProtocolSettings *X12ProtocolSettings `json:"protocolSettings,omitempty"`
+}
+
+// X12ProcessingSettings is
+type X12ProcessingSettings struct {
+ MaskSecurityInfo *bool `json:"maskSecurityInfo,omitempty"`
+ ConvertImpliedDecimal *bool `json:"convertImpliedDecimal,omitempty"`
+ PreserveInterchange *bool `json:"preserveInterchange,omitempty"`
+ SuspendInterchangeOnError *bool `json:"suspendInterchangeOnError,omitempty"`
+ CreateEmptyXMLTagsForTrailingSeparators *bool `json:"createEmptyXmlTagsForTrailingSeparators,omitempty"`
+ UseDotAsDecimalSeparator *bool `json:"useDotAsDecimalSeparator,omitempty"`
+}
+
+// X12ProtocolSettings is
+type X12ProtocolSettings struct {
+ ValidationSettings *X12ValidationSettings `json:"validationSettings,omitempty"`
+ FramingSettings *X12FramingSettings `json:"framingSettings,omitempty"`
+ EnvelopeSettings *X12EnvelopeSettings `json:"envelopeSettings,omitempty"`
+ AcknowledgementSettings *X12AcknowledgementSettings `json:"acknowledgementSettings,omitempty"`
+ MessageFilter *X12MessageFilter `json:"messageFilter,omitempty"`
+ SecuritySettings *X12SecuritySettings `json:"securitySettings,omitempty"`
+ ProcessingSettings *X12ProcessingSettings `json:"processingSettings,omitempty"`
+ EnvelopeOverrides *[]X12EnvelopeOverride `json:"envelopeOverrides,omitempty"`
+ ValidationOverrides *[]X12ValidationOverride `json:"validationOverrides,omitempty"`
+ MessageFilterList *[]X12MessageIdentifier `json:"messageFilterList,omitempty"`
+ SchemaReferences *[]X12SchemaReference `json:"schemaReferences,omitempty"`
+ X12DelimiterOverrides *[]X12DelimiterOverrides `json:"x12DelimiterOverrides,omitempty"`
+}
+
+// X12SchemaReference is
+type X12SchemaReference struct {
+ MessageID *string `json:"messageId,omitempty"`
+ SenderApplicationID *string `json:"senderApplicationId,omitempty"`
+ SchemaVersion *string `json:"schemaVersion,omitempty"`
+ SchemaName *string `json:"schemaName,omitempty"`
+}
+
+// X12SecuritySettings is
+type X12SecuritySettings struct {
+ AuthorizationQualifier *string `json:"authorizationQualifier,omitempty"`
+ AuthorizationValue *string `json:"authorizationValue,omitempty"`
+ SecurityQualifier *string `json:"securityQualifier,omitempty"`
+ PasswordValue *string `json:"passwordValue,omitempty"`
+}
+
+// X12ValidationOverride is
+type X12ValidationOverride struct {
+ MessageID *string `json:"messageId,omitempty"`
+ ValidateEDITypes *bool `json:"validateEDITypes,omitempty"`
+ ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"`
+ AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"`
+ TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"`
+}
+
+// X12ValidationSettings is
+type X12ValidationSettings struct {
+ ValidateCharacterSet *bool `json:"validateCharacterSet,omitempty"`
+ CheckDuplicateInterchangeControlNumber *bool `json:"checkDuplicateInterchangeControlNumber,omitempty"`
+ InterchangeControlNumberValidityDays *int32 `json:"interchangeControlNumberValidityDays,omitempty"`
+ CheckDuplicateGroupControlNumber *bool `json:"checkDuplicateGroupControlNumber,omitempty"`
+ CheckDuplicateTransactionSetControlNumber *bool `json:"checkDuplicateTransactionSetControlNumber,omitempty"`
+ ValidateEDITypes *bool `json:"validateEDITypes,omitempty"`
+ ValidateXSDTypes *bool `json:"validateXSDTypes,omitempty"`
+ AllowLeadingAndTrailingSpacesAndZeroes *bool `json:"allowLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrimLeadingAndTrailingSpacesAndZeroes *bool `json:"trimLeadingAndTrailingSpacesAndZeroes,omitempty"`
+ TrailingSeparatorPolicy TrailingSeparatorPolicy `json:"trailingSeparatorPolicy,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "logic", "2015-02-01-preview")
+ return fmt.Sprintf(userAgentFormat, Version(), "logic", "2015-08-01-preview")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowaccesskeys.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowaccesskeys.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowaccesskeys.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowaccesskeys.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,462 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowAccessKeysClient is the client for the WorkflowAccessKeys methods
-// of the Logic service.
-type WorkflowAccessKeysClient struct {
- ManagementClient
-}
-
-// NewWorkflowAccessKeysClient creates an instance of the
-// WorkflowAccessKeysClient client.
-func NewWorkflowAccessKeysClient(subscriptionID string) WorkflowAccessKeysClient {
- return NewWorkflowAccessKeysClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowAccessKeysClientWithBaseURI creates an instance of the
-// WorkflowAccessKeysClient client.
-func NewWorkflowAccessKeysClientWithBaseURI(baseURI string, subscriptionID string) WorkflowAccessKeysClient {
- return WorkflowAccessKeysClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate creates or updates a workflow access key.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. accessKeyName is the workflow access key name. workflowAccesskey is
-// the workflow access key.
-func (client WorkflowAccessKeysClient) CreateOrUpdate(resourceGroupName string, workflowName string, accessKeyName string, workflowAccesskey WorkflowAccessKey) (result WorkflowAccessKey, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, workflowName, accessKeyName, workflowAccesskey)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client WorkflowAccessKeysClient) CreateOrUpdatePreparer(resourceGroupName string, workflowName string, accessKeyName string, workflowAccesskey WorkflowAccessKey) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accessKeyName": url.QueryEscape(accessKeyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}"),
- autorest.WithJSON(workflowAccesskey),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) CreateOrUpdateResponder(resp *http.Response) (result WorkflowAccessKey, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a workflow access key.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. accessKeyName is the workflow access key name.
-func (client WorkflowAccessKeysClient) Delete(resourceGroupName string, workflowName string, accessKeyName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, workflowName, accessKeyName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client WorkflowAccessKeysClient) DeletePreparer(resourceGroupName string, workflowName string, accessKeyName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accessKeyName": url.QueryEscape(accessKeyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets a workflow access key.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. accessKeyName is the workflow access key name.
-func (client WorkflowAccessKeysClient) Get(resourceGroupName string, workflowName string, accessKeyName string) (result WorkflowAccessKey, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, accessKeyName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowAccessKeysClient) GetPreparer(resourceGroupName string, workflowName string, accessKeyName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accessKeyName": url.QueryEscape(accessKeyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) GetResponder(resp *http.Response) (result WorkflowAccessKey, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of workflow access keys.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. top is the number of items to be included in the result.
-func (client WorkflowAccessKeysClient) List(resourceGroupName string, workflowName string, top *int) (result WorkflowAccessKeyListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, workflowName, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client WorkflowAccessKeysClient) ListPreparer(resourceGroupName string, workflowName string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) ListResponder(resp *http.Response) (result WorkflowAccessKeyListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 WorkflowAccessKeysClient) ListNextResults(lastResults WorkflowAccessKeyListResult) (result WorkflowAccessKeyListResult, ae error) {
- req, err := lastResults.WorkflowAccessKeyListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListSecretKeys lists secret keys.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. accessKeyName is the workflow access key name.
-func (client WorkflowAccessKeysClient) ListSecretKeys(resourceGroupName string, workflowName string, accessKeyName string) (result WorkflowSecretKeys, ae error) {
- req, err := client.ListSecretKeysPreparer(resourceGroupName, workflowName, accessKeyName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "ListSecretKeys", "Failure preparing request")
- }
-
- resp, err := client.ListSecretKeysSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "ListSecretKeys", "Failure sending request")
- }
-
- result, err = client.ListSecretKeysResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "ListSecretKeys", "Failure responding to request")
- }
-
- return
-}
-
-// ListSecretKeysPreparer prepares the ListSecretKeys request.
-func (client WorkflowAccessKeysClient) ListSecretKeysPreparer(resourceGroupName string, workflowName string, accessKeyName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accessKeyName": url.QueryEscape(accessKeyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}/list"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSecretKeysSender sends the ListSecretKeys request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) ListSecretKeysSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListSecretKeysResponder handles the response to the ListSecretKeys request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) ListSecretKeysResponder(resp *http.Response) (result WorkflowSecretKeys, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RegenerateSecretKey regenerates secret key.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. accessKeyName is the workflow access key name. parameters is the
-// parameters.
-func (client WorkflowAccessKeysClient) RegenerateSecretKey(resourceGroupName string, workflowName string, accessKeyName string, parameters RegenerateSecretKeyParameters) (result WorkflowSecretKeys, ae error) {
- req, err := client.RegenerateSecretKeyPreparer(resourceGroupName, workflowName, accessKeyName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "RegenerateSecretKey", "Failure preparing request")
- }
-
- resp, err := client.RegenerateSecretKeySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "RegenerateSecretKey", "Failure sending request")
- }
-
- result, err = client.RegenerateSecretKeyResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowAccessKeysClient", "RegenerateSecretKey", "Failure responding to request")
- }
-
- return
-}
-
-// RegenerateSecretKeyPreparer prepares the RegenerateSecretKey request.
-func (client WorkflowAccessKeysClient) RegenerateSecretKeyPreparer(resourceGroupName string, workflowName string, accessKeyName string, parameters RegenerateSecretKeyParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accessKeyName": url.QueryEscape(accessKeyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}/regenerate"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RegenerateSecretKeySender sends the RegenerateSecretKey request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowAccessKeysClient) RegenerateSecretKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// RegenerateSecretKeyResponder handles the response to the RegenerateSecretKey request. The method always
-// closes the http.Response Body.
-func (client WorkflowAccessKeysClient) RegenerateSecretKeyResponder(resp *http.Response) (result WorkflowSecretKeys, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowrunactions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowrunactions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowrunactions.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowrunactions.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,206 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowRunActionsClient is the client for the WorkflowRunActions methods
-// of the Logic service.
-type WorkflowRunActionsClient struct {
- ManagementClient
-}
-
-// NewWorkflowRunActionsClient creates an instance of the
-// WorkflowRunActionsClient client.
-func NewWorkflowRunActionsClient(subscriptionID string) WorkflowRunActionsClient {
- return NewWorkflowRunActionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowRunActionsClientWithBaseURI creates an instance of the
-// WorkflowRunActionsClient client.
-func NewWorkflowRunActionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionsClient {
- return WorkflowRunActionsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a workflow run action.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. runName is the workflow run name. actionName is the workflow action
-// name.
-func (client WorkflowRunActionsClient) Get(resourceGroupName string, workflowName string, runName string, actionName string) (result WorkflowRunAction, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, runName, actionName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowRunActionsClient) GetPreparer(resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "actionName": url.QueryEscape(actionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "runName": url.QueryEscape(runName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowRunActionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowRunActionsClient) GetResponder(resp *http.Response) (result WorkflowRunAction, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of workflow run actions.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. runName is the workflow run name. top is the number of items to be
-// included in the result. filter is the filter to apply on the operation.
-func (client WorkflowRunActionsClient) List(resourceGroupName string, workflowName string, runName string, top *int, filter string) (result WorkflowRunActionListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, workflowName, runName, top, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client WorkflowRunActionsClient) ListPreparer(resourceGroupName string, workflowName string, runName string, top *int, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "runName": url.QueryEscape(runName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowRunActionsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client WorkflowRunActionsClient) ListResponder(resp *http.Response) (result WorkflowRunActionListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client WorkflowRunActionsClient) ListNextResults(lastResults WorkflowRunActionListResult) (result WorkflowRunActionListResult, ae error) {
- req, err := lastResults.WorkflowRunActionListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunActionsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowruns.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowruns.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowruns.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowruns.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,266 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowRunsClient is the client for the WorkflowRuns methods of the Logic
-// service.
-type WorkflowRunsClient struct {
- ManagementClient
-}
-
-// NewWorkflowRunsClient creates an instance of the WorkflowRunsClient client.
-func NewWorkflowRunsClient(subscriptionID string) WorkflowRunsClient {
- return NewWorkflowRunsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowRunsClientWithBaseURI creates an instance of the
-// WorkflowRunsClient client.
-func NewWorkflowRunsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunsClient {
- return WorkflowRunsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Cancel cancels a workflow run.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. runName is the workflow run name.
-func (client WorkflowRunsClient) Cancel(resourceGroupName string, workflowName string, runName string) (result autorest.Response, ae error) {
- req, err := client.CancelPreparer(resourceGroupName, workflowName, runName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Cancel", "Failure preparing request")
- }
-
- resp, err := client.CancelSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Cancel", "Failure sending request")
- }
-
- result, err = client.CancelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Cancel", "Failure responding to request")
- }
-
- return
-}
-
-// CancelPreparer prepares the Cancel request.
-func (client WorkflowRunsClient) CancelPreparer(resourceGroupName string, workflowName string, runName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "runName": url.QueryEscape(runName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CancelSender sends the Cancel request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowRunsClient) CancelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// CancelResponder handles the response to the Cancel request. The method always
-// closes the http.Response Body.
-func (client WorkflowRunsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets a workflow run.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. runName is the workflow run name.
-func (client WorkflowRunsClient) Get(resourceGroupName string, workflowName string, runName string) (result WorkflowRun, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, runName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowRunsClient) GetPreparer(resourceGroupName string, workflowName string, runName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "runName": url.QueryEscape(runName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowRunsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowRunsClient) GetResponder(resp *http.Response) (result WorkflowRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of workflow runs.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. top is the number of items to be included in the result. filter is
-// the filter to apply on the operation.
-func (client WorkflowRunsClient) List(resourceGroupName string, workflowName string, top *int, filter string) (result WorkflowRunListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, workflowName, top, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client WorkflowRunsClient) ListPreparer(resourceGroupName string, workflowName string, top *int, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowRunsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client WorkflowRunsClient) ListResponder(resp *http.Response) (result WorkflowRunListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client WorkflowRunsClient) ListNextResults(lastResults WorkflowRunListResult) (result WorkflowRunListResult, ae error) {
- req, err := lastResults.WorkflowRunListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowRunsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflows.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflows.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflows.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflows.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,739 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowsClient is the client for the Workflows methods of the Logic
-// service.
-type WorkflowsClient struct {
- ManagementClient
-}
-
-// NewWorkflowsClient creates an instance of the WorkflowsClient client.
-func NewWorkflowsClient(subscriptionID string) WorkflowsClient {
- return NewWorkflowsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowsClientWithBaseURI creates an instance of the WorkflowsClient
-// client.
-func NewWorkflowsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowsClient {
- return WorkflowsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate creates or updates a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. workflow is the workflow.
-func (client WorkflowsClient) CreateOrUpdate(resourceGroupName string, workflowName string, workflow Workflow) (result Workflow, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, workflowName, workflow)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client WorkflowsClient) CreateOrUpdatePreparer(resourceGroupName string, workflowName string, workflow Workflow) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"),
- autorest.WithJSON(workflow),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) CreateOrUpdateResponder(resp *http.Response) (result Workflow, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name.
-func (client WorkflowsClient) Delete(resourceGroupName string, workflowName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, workflowName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client WorkflowsClient) DeletePreparer(resourceGroupName string, workflowName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Disable disables a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name.
-func (client WorkflowsClient) Disable(resourceGroupName string, workflowName string) (result autorest.Response, ae error) {
- req, err := client.DisablePreparer(resourceGroupName, workflowName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Disable", "Failure preparing request")
- }
-
- resp, err := client.DisableSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Disable", "Failure sending request")
- }
-
- result, err = client.DisableResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Disable", "Failure responding to request")
- }
-
- return
-}
-
-// DisablePreparer prepares the Disable request.
-func (client WorkflowsClient) DisablePreparer(resourceGroupName string, workflowName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DisableSender sends the Disable request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) DisableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// DisableResponder handles the response to the Disable request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Enable enables a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name.
-func (client WorkflowsClient) Enable(resourceGroupName string, workflowName string) (result autorest.Response, ae error) {
- req, err := client.EnablePreparer(resourceGroupName, workflowName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Enable", "Failure preparing request")
- }
-
- resp, err := client.EnableSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Enable", "Failure sending request")
- }
-
- result, err = client.EnableResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Enable", "Failure responding to request")
- }
-
- return
-}
-
-// EnablePreparer prepares the Enable request.
-func (client WorkflowsClient) EnablePreparer(resourceGroupName string, workflowName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// EnableSender sends the Enable request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) EnableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// EnableResponder handles the response to the Enable request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name.
-func (client WorkflowsClient) Get(resourceGroupName string, workflowName string) (result Workflow, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowsClient) GetPreparer(resourceGroupName string, workflowName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) GetResponder(resp *http.Response) (result Workflow, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListByResourceGroup gets a list of workflows by resource group.
-//
-// resourceGroupName is the resource group name. top is the number of items to
-// be included in the result. filter is the filter to apply on the operation.
-func (client WorkflowsClient) ListByResourceGroup(resourceGroupName string, top *int, filter string) (result WorkflowListResult, ae error) {
- req, err := client.ListByResourceGroupPreparer(resourceGroupName, top, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure preparing request")
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure sending request")
- }
-
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure responding to request")
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client WorkflowsClient) ListByResourceGroupPreparer(resourceGroupName string, top *int, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) ListByResourceGroupResponder(resp *http.Response) (result WorkflowListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListByResourceGroupNextResults retrieves the next set of results, if any.
-func (client WorkflowsClient) ListByResourceGroupNextResults(lastResults WorkflowListResult) (result WorkflowListResult, ae error) {
- req, err := lastResults.WorkflowListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure sending next results request request")
- }
-
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListByResourceGroup", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListBySubscription gets a list of workflows by subscription.
-//
-// top is the number of items to be included in the result. filter is the
-// filter to apply on the operation.
-func (client WorkflowsClient) ListBySubscription(top *int, filter string) (result WorkflowListResult, ae error) {
- req, err := client.ListBySubscriptionPreparer(top, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure preparing request")
- }
-
- resp, err := client.ListBySubscriptionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure sending request")
- }
-
- result, err = client.ListBySubscriptionResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure responding to request")
- }
-
- return
-}
-
-// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client WorkflowsClient) ListBySubscriptionPreparer(top *int, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) ListBySubscriptionResponder(resp *http.Response) (result WorkflowListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListBySubscriptionNextResults retrieves the next set of results, if any.
-func (client WorkflowsClient) ListBySubscriptionNextResults(lastResults WorkflowListResult) (result WorkflowListResult, ae error) {
- req, err := lastResults.WorkflowListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListBySubscriptionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure sending next results request request")
- }
-
- result, err = client.ListBySubscriptionResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "ListBySubscription", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Run runs a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. parameters is the parameters.
-func (client WorkflowsClient) Run(resourceGroupName string, workflowName string, parameters RunWorkflowParameters) (result WorkflowRun, ae error) {
- req, err := client.RunPreparer(resourceGroupName, workflowName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Run", "Failure preparing request")
- }
-
- resp, err := client.RunSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Run", "Failure sending request")
- }
-
- result, err = client.RunResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Run", "Failure responding to request")
- }
-
- return
-}
-
-// RunPreparer prepares the Run request.
-func (client WorkflowsClient) RunPreparer(resourceGroupName string, workflowName string, parameters RunWorkflowParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/run"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RunSender sends the Run request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) RunSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
-}
-
-// RunResponder handles the response to the Run request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) RunResponder(resp *http.Response) (result WorkflowRun, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. workflow is the workflow.
-func (client WorkflowsClient) Update(resourceGroupName string, workflowName string, workflow Workflow) (result Workflow, ae error) {
- req, err := client.UpdatePreparer(resourceGroupName, workflowName, workflow)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Update", "Failure preparing request")
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Update", "Failure sending request")
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Update", "Failure responding to request")
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client WorkflowsClient) UpdatePreparer(resourceGroupName string, workflowName string, workflow Workflow) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"),
- autorest.WithJSON(workflow),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) UpdateResponder(resp *http.Response) (result Workflow, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Validate validates a workflow.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. workflow is the workflow.
-func (client WorkflowsClient) Validate(resourceGroupName string, workflowName string, workflow Workflow) (result autorest.Response, ae error) {
- req, err := client.ValidatePreparer(resourceGroupName, workflowName, workflow)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Validate", "Failure preparing request")
- }
-
- resp, err := client.ValidateSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Validate", "Failure sending request")
- }
-
- result, err = client.ValidateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowsClient", "Validate", "Failure responding to request")
- }
-
- return
-}
-
-// ValidatePreparer prepares the Validate request.
-func (client WorkflowsClient) ValidatePreparer(resourceGroupName string, workflowName string, workflow Workflow) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate"),
- autorest.WithJSON(workflow),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ValidateSender sends the Validate request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowsClient) ValidateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ValidateResponder handles the response to the Validate request. The method always
-// closes the http.Response Body.
-func (client WorkflowsClient) ValidateResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggerhistories.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggerhistories.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggerhistories.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggerhistories.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,203 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowTriggerHistoriesClient is the client for the
-// WorkflowTriggerHistories methods of the Logic service.
-type WorkflowTriggerHistoriesClient struct {
- ManagementClient
-}
-
-// NewWorkflowTriggerHistoriesClient creates an instance of the
-// WorkflowTriggerHistoriesClient client.
-func NewWorkflowTriggerHistoriesClient(subscriptionID string) WorkflowTriggerHistoriesClient {
- return NewWorkflowTriggerHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowTriggerHistoriesClientWithBaseURI creates an instance of the
-// WorkflowTriggerHistoriesClient client.
-func NewWorkflowTriggerHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowTriggerHistoriesClient {
- return WorkflowTriggerHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a workflow trigger history.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. triggerName is the workflow trigger name. historyName is the
-// workflow trigger history name.
-func (client WorkflowTriggerHistoriesClient) Get(resourceGroupName string, workflowName string, triggerName string, historyName string) (result WorkflowTriggerHistory, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, triggerName, historyName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowTriggerHistoriesClient) GetPreparer(resourceGroupName string, workflowName string, triggerName string, historyName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "historyName": url.QueryEscape(historyName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "triggerName": url.QueryEscape(triggerName),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowTriggerHistoriesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowTriggerHistoriesClient) GetResponder(resp *http.Response) (result WorkflowTriggerHistory, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of workflow trigger histories.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. triggerName is the workflow trigger name. top is the number of items
-// to be included in the result.
-func (client WorkflowTriggerHistoriesClient) List(resourceGroupName string, workflowName string, triggerName string, top *int) (result WorkflowTriggerHistoryListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, workflowName, triggerName, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client WorkflowTriggerHistoriesClient) ListPreparer(resourceGroupName string, workflowName string, triggerName string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "triggerName": url.QueryEscape(triggerName),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowTriggerHistoriesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client WorkflowTriggerHistoriesClient) ListResponder(resp *http.Response) (result WorkflowTriggerHistoryListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client WorkflowTriggerHistoriesClient) ListNextResults(lastResults WorkflowTriggerHistoryListResult) (result WorkflowTriggerHistoryListResult, ae error) {
- req, err := lastResults.WorkflowTriggerHistoryListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggerHistoriesClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggers.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggers.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggers.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowtriggers.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,267 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowTriggersClient is the client for the WorkflowTriggers methods of
-// the Logic service.
-type WorkflowTriggersClient struct {
- ManagementClient
-}
-
-// NewWorkflowTriggersClient creates an instance of the WorkflowTriggersClient
-// client.
-func NewWorkflowTriggersClient(subscriptionID string) WorkflowTriggersClient {
- return NewWorkflowTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowTriggersClientWithBaseURI creates an instance of the
-// WorkflowTriggersClient client.
-func NewWorkflowTriggersClientWithBaseURI(baseURI string, subscriptionID string) WorkflowTriggersClient {
- return WorkflowTriggersClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a workflow trigger.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. triggerName is the workflow trigger name.
-func (client WorkflowTriggersClient) Get(resourceGroupName string, workflowName string, triggerName string) (result WorkflowTrigger, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, triggerName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowTriggersClient) GetPreparer(resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "triggerName": url.QueryEscape(triggerName),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowTriggersClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowTriggersClient) GetResponder(resp *http.Response) (result WorkflowTrigger, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of workflow triggers.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. top is the number of items to be included in the result. filter is
-// the filter to apply on the operation.
-func (client WorkflowTriggersClient) List(resourceGroupName string, workflowName string, top *int, filter string) (result WorkflowTriggerListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, workflowName, top, filter)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client WorkflowTriggersClient) ListPreparer(resourceGroupName string, workflowName string, top *int, filter string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowTriggersClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client WorkflowTriggersClient) ListResponder(resp *http.Response) (result WorkflowTriggerListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client WorkflowTriggersClient) ListNextResults(lastResults WorkflowTriggerListResult) (result WorkflowTriggerListResult, ae error) {
- req, err := lastResults.WorkflowTriggerListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Run runs a workflow trigger.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. triggerName is the workflow trigger name.
-func (client WorkflowTriggersClient) Run(resourceGroupName string, workflowName string, triggerName string) (result autorest.Response, ae error) {
- req, err := client.RunPreparer(resourceGroupName, workflowName, triggerName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Run", "Failure preparing request")
- }
-
- resp, err := client.RunSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Run", "Failure sending request")
- }
-
- result, err = client.RunResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowTriggersClient", "Run", "Failure responding to request")
- }
-
- return
-}
-
-// RunPreparer prepares the Run request.
-func (client WorkflowTriggersClient) RunPreparer(resourceGroupName string, workflowName string, triggerName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "triggerName": url.QueryEscape(triggerName),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RunSender sends the Run request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowTriggersClient) RunSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// RunResponder handles the response to the Run request. The method always
-// closes the http.Response Body.
-func (client WorkflowTriggersClient) RunResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowversions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowversions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowversions.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/logic/workflowversions.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,108 +0,0 @@
-package logic
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// WorkflowVersionsClient is the client for the WorkflowVersions methods of
-// the Logic service.
-type WorkflowVersionsClient struct {
- ManagementClient
-}
-
-// NewWorkflowVersionsClient creates an instance of the WorkflowVersionsClient
-// client.
-func NewWorkflowVersionsClient(subscriptionID string) WorkflowVersionsClient {
- return NewWorkflowVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWorkflowVersionsClientWithBaseURI creates an instance of the
-// WorkflowVersionsClient client.
-func NewWorkflowVersionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowVersionsClient {
- return WorkflowVersionsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a workflow version.
-//
-// resourceGroupName is the resource group name. workflowName is the workflow
-// name. versionID is the workflow versionId.
-func (client WorkflowVersionsClient) Get(resourceGroupName string, workflowName string, versionID string) (result WorkflowVersion, ae error) {
- req, err := client.GetPreparer(resourceGroupName, workflowName, versionID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "logic/WorkflowVersionsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "logic/WorkflowVersionsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "logic/WorkflowVersionsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client WorkflowVersionsClient) GetPreparer(resourceGroupName string, workflowName string, versionID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "versionId": url.QueryEscape(versionID),
- "workflowName": url.QueryEscape(workflowName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client WorkflowVersionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client WorkflowVersionsClient) GetResponder(resp *http.Response) (result WorkflowVersion, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,63 @@
+// Package machinelearning implements the Azure ARM Machinelearning service
+// API version 2016-05-01-preview.
+//
+// These APIs allow end users to operate on Azure Machine Learning Web
+// Services resources. They support the following operations:
Create
+// or update a web service
Get a web service
Patch a web
+// service
Delete a web service
Get All Web Services in a
+// Resource Group
Get All Web Services in a Subscription
Get
+// Web Services Keys
+package machinelearning
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Machinelearning
+ APIVersion = "2016-05-01-preview"
+
+ // DefaultBaseURI is the default URI used for the service Machinelearning
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Machinelearning.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,403 @@
+package machinelearning
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+)
+
+// AssetType enumerates the values for asset type.
+type AssetType string
+
+const (
+ // AssetTypeModule specifies the asset type module state for asset type.
+ AssetTypeModule AssetType = "Module"
+ // AssetTypeResource specifies the asset type resource state for asset
+ // type.
+ AssetTypeResource AssetType = "Resource"
+)
+
+// ColumnFormat enumerates the values for column format.
+type ColumnFormat string
+
+const (
+ // Byte specifies the byte state for column format.
+ Byte ColumnFormat = "Byte"
+ // Char specifies the char state for column format.
+ Char ColumnFormat = "Char"
+ // Datetime specifies the datetime state for column format.
+ Datetime ColumnFormat = "Datetime"
+ // Double specifies the double state for column format.
+ Double ColumnFormat = "Double"
+ // Duration specifies the duration state for column format.
+ Duration ColumnFormat = "Duration"
+ // Float specifies the float state for column format.
+ Float ColumnFormat = "Float"
+ // Int16 specifies the int 16 state for column format.
+ Int16 ColumnFormat = "Int16"
+ // Int32 specifies the int 32 state for column format.
+ Int32 ColumnFormat = "Int32"
+ // Int64 specifies the int 64 state for column format.
+ Int64 ColumnFormat = "Int64"
+ // Int8 specifies the int 8 state for column format.
+ Int8 ColumnFormat = "Int8"
+ // Uint16 specifies the uint 16 state for column format.
+ Uint16 ColumnFormat = "Uint16"
+ // Uint32 specifies the uint 32 state for column format.
+ Uint32 ColumnFormat = "Uint32"
+ // Uint64 specifies the uint 64 state for column format.
+ Uint64 ColumnFormat = "Uint64"
+ // Uint8 specifies the uint 8 state for column format.
+ Uint8 ColumnFormat = "Uint8"
+)
+
+// ColumnType enumerates the values for column type.
+type ColumnType string
+
+const (
+ // Boolean specifies the boolean state for column type.
+ Boolean ColumnType = "Boolean"
+ // Integer specifies the integer state for column type.
+ Integer ColumnType = "Integer"
+ // Number specifies the number state for column type.
+ Number ColumnType = "Number"
+ // String specifies the string state for column type.
+ String ColumnType = "String"
+)
+
+// DiagnosticsLevel enumerates the values for diagnostics level.
+type DiagnosticsLevel string
+
+const (
+ // All specifies the all state for diagnostics level.
+ All DiagnosticsLevel = "All"
+ // Error specifies the error state for diagnostics level.
+ Error DiagnosticsLevel = "Error"
+ // None specifies the none state for diagnostics level.
+ None DiagnosticsLevel = "None"
+)
+
+// InputPortType enumerates the values for input port type.
+type InputPortType string
+
+const (
+ // Dataset specifies the dataset state for input port type.
+ Dataset InputPortType = "Dataset"
+)
+
+// OutputPortType enumerates the values for output port type.
+type OutputPortType string
+
+const (
+ // OutputPortTypeDataset specifies the output port type dataset state for
+ // output port type.
+ OutputPortTypeDataset OutputPortType = "Dataset"
+)
+
+// ParameterType enumerates the values for parameter type.
+type ParameterType string
+
+const (
+ // ParameterTypeBoolean specifies the parameter type boolean state for
+ // parameter type.
+ ParameterTypeBoolean ParameterType = "Boolean"
+ // ParameterTypeColumnPicker specifies the parameter type column picker
+ // state for parameter type.
+ ParameterTypeColumnPicker ParameterType = "ColumnPicker"
+ // ParameterTypeCredential specifies the parameter type credential state
+ // for parameter type.
+ ParameterTypeCredential ParameterType = "Credential"
+ // ParameterTypeDataGatewayName specifies the parameter type data gateway
+ // name state for parameter type.
+ ParameterTypeDataGatewayName ParameterType = "DataGatewayName"
+ // ParameterTypeDouble specifies the parameter type double state for
+ // parameter type.
+ ParameterTypeDouble ParameterType = "Double"
+ // ParameterTypeEnumerated specifies the parameter type enumerated state
+ // for parameter type.
+ ParameterTypeEnumerated ParameterType = "Enumerated"
+ // ParameterTypeFloat specifies the parameter type float state for
+ // parameter type.
+ ParameterTypeFloat ParameterType = "Float"
+ // ParameterTypeInt specifies the parameter type int state for parameter
+ // type.
+ ParameterTypeInt ParameterType = "Int"
+ // ParameterTypeMode specifies the parameter type mode state for parameter
+ // type.
+ ParameterTypeMode ParameterType = "Mode"
+ // ParameterTypeParameterRange specifies the parameter type parameter
+ // range state for parameter type.
+ ParameterTypeParameterRange ParameterType = "ParameterRange"
+ // ParameterTypeScript specifies the parameter type script state for
+ // parameter type.
+ ParameterTypeScript ParameterType = "Script"
+ // ParameterTypeString specifies the parameter type string state for
+ // parameter type.
+ ParameterTypeString ParameterType = "String"
+)
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // Canceled specifies the canceled state for provisioning state.
+ Canceled ProvisioningState = "Canceled"
+ // Failed specifies the failed state for provisioning state.
+ Failed ProvisioningState = "Failed"
+ // Provisioning specifies the provisioning state for provisioning state.
+ Provisioning ProvisioningState = "Provisioning"
+ // Succeeded specifies the succeeded state for provisioning state.
+ Succeeded ProvisioningState = "Succeeded"
+ // Unknown specifies the unknown state for provisioning state.
+ Unknown ProvisioningState = "Unknown"
+)
+
+// AssetItem is information about an asset associated with the web service.
+type AssetItem struct {
+ Name *string `json:"name,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Type AssetType `json:"type,omitempty"`
+ LocationInfo *AssetLocation `json:"locationInfo,omitempty"`
+ InputPorts *map[string]*InputPort `json:"inputPorts,omitempty"`
+ OutputPorts *map[string]*OutputPort `json:"outputPorts,omitempty"`
+ Metadata *map[string]*string `json:"metadata,omitempty"`
+ Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
+}
+
+// AssetLocation is describes the access location for a web service asset.
+type AssetLocation struct {
+ URI *string `json:"uri,omitempty"`
+ Credentials *string `json:"credentials,omitempty"`
+}
+
+// ColumnSpecification is swagger 2.0 schema for a column within the data
+// table representing a web service input or output. See Swagger
+// specification: http://swagger.io/specification/
+type ColumnSpecification struct {
+ Type ColumnType `json:"type,omitempty"`
+ Format ColumnFormat `json:"format,omitempty"`
+ Enum *[]map[string]interface{} `json:"enum,omitempty"`
+ XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"`
+ XMsIsordered *bool `json:"x-ms-isordered,omitempty"`
+}
+
+// CommitmentPlan is information about the machine learning commitment plan
+// associated with the web service.
+type CommitmentPlan struct {
+ ID *string `json:"id,omitempty"`
+}
+
+// DiagnosticsConfiguration is diagnostics settings for an Azure ML web
+// service.
+type DiagnosticsConfiguration struct {
+ Level DiagnosticsLevel `json:"level,omitempty"`
+ Expiry *date.Time `json:"expiry,omitempty"`
+}
+
+// ExampleRequest is sample input data for the service's input(s).
+type ExampleRequest struct {
+ Inputs *map[string][][]map[string]interface{} `json:"inputs,omitempty"`
+ GlobalParameters *map[string]map[string]interface{} `json:"globalParameters,omitempty"`
+}
+
+// GraphEdge is defines an edge within the web service's graph.
+type GraphEdge struct {
+ SourceNodeID *string `json:"sourceNodeId,omitempty"`
+ SourcePortID *string `json:"sourcePortId,omitempty"`
+ TargetNodeID *string `json:"targetNodeId,omitempty"`
+ TargetPortID *string `json:"targetPortId,omitempty"`
+}
+
+// GraphNode is specifies a node in the web service graph. The node can either
+// be an input, output or asset node, so only one of the corresponding id
+// properties is populated at any given time.
+type GraphNode struct {
+ AssetID *string `json:"assetId,omitempty"`
+ InputID *string `json:"inputId,omitempty"`
+ OutputID *string `json:"outputId,omitempty"`
+ Parameters *map[string]*string `json:"parameters,omitempty"`
+}
+
+// GraphPackage is defines the graph of modules making up the machine learning
+// solution.
+type GraphPackage struct {
+ Nodes *map[string]*GraphNode `json:"nodes,omitempty"`
+ Edges *[]GraphEdge `json:"edges,omitempty"`
+ GraphParameters *map[string]*GraphParameter `json:"graphParameters,omitempty"`
+}
+
+// GraphParameter is defines a global parameter in the graph.
+type GraphParameter struct {
+ Description *string `json:"description,omitempty"`
+ Type ParameterType `json:"type,omitempty"`
+ Links *[]GraphParameterLink `json:"links,omitempty"`
+}
+
+// GraphParameterLink is association link for a graph global parameter to a
+// node in the graph.
+type GraphParameterLink struct {
+ NodeID *string `json:"nodeId,omitempty"`
+ ParameterKey *string `json:"parameterKey,omitempty"`
+}
+
+// InputPort is asset input port
+type InputPort struct {
+ Type InputPortType `json:"type,omitempty"`
+}
+
+// ModeValueInfo is nested parameter definition.
+type ModeValueInfo struct {
+ InterfaceString *string `json:"interfaceString,omitempty"`
+ Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
+}
+
+// ModuleAssetParameter is parameter definition for a module asset.
+type ModuleAssetParameter struct {
+ Name *string `json:"name,omitempty"`
+ ParameterType *string `json:"parameterType,omitempty"`
+ ModeValuesInfo *map[string]*ModeValueInfo `json:"modeValuesInfo,omitempty"`
+}
+
+// OutputPort is asset output port
+type OutputPort struct {
+ Type OutputPortType `json:"type,omitempty"`
+}
+
+// PaginatedWebServicesList is paginated list of web services.
+type PaginatedWebServicesList struct {
+ autorest.Response `json:"-"`
+ Value *[]WebService `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// RealtimeConfiguration is holds the available configuration options for an
+// Azure ML web service endpoint.
+type RealtimeConfiguration struct {
+ MaxConcurrentCalls *int32 `json:"maxConcurrentCalls,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ServiceInputOutputSpecification is the swagger 2.0 schema describing the
+// service's inputs or outputs. See Swagger specification:
+// http://swagger.io/specification/
+type ServiceInputOutputSpecification struct {
+ Title *string `json:"title,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *map[string]*TableSpecification `json:"properties,omitempty"`
+}
+
+// StorageAccount is access information for a storage account.
+type StorageAccount struct {
+ Name *string `json:"name,omitempty"`
+ Key *string `json:"key,omitempty"`
+}
+
+// TableSpecification is the swagger 2.0 schema describing a single service
+// input or output. See Swagger specification:
+// http://swagger.io/specification/
+type TableSpecification struct {
+ Title *string `json:"title,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Format *string `json:"format,omitempty"`
+ Properties *map[string]*ColumnSpecification `json:"properties,omitempty"`
+}
+
+// WebService is instance of an Azure ML web service resource.
+type WebService struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *WebServiceProperties `json:"properties,omitempty"`
+}
+
+// WebServiceKeys is access keys for the web service calls.
+type WebServiceKeys struct {
+ autorest.Response `json:"-"`
+ Primary *string `json:"primary,omitempty"`
+ Secondary *string `json:"secondary,omitempty"`
+}
+
+// WebServiceProperties is the set of properties specific to the Azure ML web
+// service resource.
+type WebServiceProperties struct {
+ Title *string `json:"title,omitempty"`
+ Description *string `json:"description,omitempty"`
+ CreatedOn *date.Time `json:"createdOn,omitempty"`
+ ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ Keys *WebServiceKeys `json:"keys,omitempty"`
+ ReadOnly *bool `json:"readOnly,omitempty"`
+ SwaggerLocation *string `json:"swaggerLocation,omitempty"`
+ ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
+ RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
+ Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
+ StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
+ MachineLearningWorkspace *Workspace `json:"machineLearningWorkspace,omitempty"`
+ CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
+ Input *ServiceInputOutputSpecification `json:"input,omitempty"`
+ Output *ServiceInputOutputSpecification `json:"output,omitempty"`
+ ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
+ Assets *map[string]*AssetItem `json:"assets,omitempty"`
+ Parameters *map[string]*string `json:"parameters,omitempty"`
+}
+
+// WebServicePropertiesForGraph is properties specific to a Graph based web
+// service.
+type WebServicePropertiesForGraph struct {
+ Title *string `json:"title,omitempty"`
+ Description *string `json:"description,omitempty"`
+ CreatedOn *date.Time `json:"createdOn,omitempty"`
+ ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ Keys *WebServiceKeys `json:"keys,omitempty"`
+ ReadOnly *bool `json:"readOnly,omitempty"`
+ SwaggerLocation *string `json:"swaggerLocation,omitempty"`
+ ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
+ RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
+ Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
+ StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
+ MachineLearningWorkspace *Workspace `json:"machineLearningWorkspace,omitempty"`
+ CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
+ Input *ServiceInputOutputSpecification `json:"input,omitempty"`
+ Output *ServiceInputOutputSpecification `json:"output,omitempty"`
+ ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
+ Assets *map[string]*AssetItem `json:"assets,omitempty"`
+ Parameters *map[string]*string `json:"parameters,omitempty"`
+ Package *GraphPackage `json:"package,omitempty"`
+}
+
+// Workspace is information about the machine learning workspace containing
+// the experiment that is source for the web service.
+type Workspace struct {
+ ID *string `json:"id,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package machinelearning
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "machinelearning", "2016-05-01-preview")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/webservices.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/webservices.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/webservices.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/machinelearning/webservices.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,509 @@
+package machinelearning
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// WebServicesClient is the these APIs allow end users to operate on Azure
+// Machine Learning Web Services resources. They support the following
+// operations:
Create or update a web service
Get a web
+// service
Patch a web service
Delete a web
+// service
Get All Web Services in a Resource Group
Get All
+// Web Services in a Subscription
Get Web Services Keys
+type WebServicesClient struct {
+ ManagementClient
+}
+
+// NewWebServicesClient creates an instance of the WebServicesClient client.
+func NewWebServicesClient(subscriptionID string) WebServicesClient {
+ return NewWebServicesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWebServicesClientWithBaseURI creates an instance of the
+// WebServicesClient client.
+func NewWebServicesClientWithBaseURI(baseURI string, subscriptionID string) WebServicesClient {
+ return WebServicesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates a new Azure ML web service or update an
+// existing one. This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// createOrUpdatePayload is the payload to create or update the Azure ML web
+// service. resourceGroupName is name of the resource group. webServiceName
+// is the Azure ML web service name which you want to reach.
+func (client WebServicesClient) CreateOrUpdate(createOrUpdatePayload WebService, resourceGroupName string, webServiceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(createOrUpdatePayload, resourceGroupName, webServiceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client WebServicesClient) CreateOrUpdatePreparer(createOrUpdatePayload WebService, resourceGroupName string, webServiceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "webServiceName": autorest.Encode("path", webServiceName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
+ autorest.WithJSON(createOrUpdatePayload),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get retrieve an Azure ML web service definition by its subscription,
+// resource group and name.
+//
+// resourceGroupName is name of the resource group. webServiceName is the
+// Azure ML web service name which you want to reach.
+func (client WebServicesClient) Get(resourceGroupName string, webServiceName string) (result WebService, err error) {
+ req, err := client.GetPreparer(resourceGroupName, webServiceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client WebServicesClient) GetPreparer(resourceGroupName string, webServiceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "webServiceName": autorest.Encode("path", webServiceName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) GetResponder(resp *http.Response) (result WebService, 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 retrieve all Azure ML web services in the current Azure subscription.
+//
+// skiptoken is continuation token for pagination.
+func (client WebServicesClient) List(skiptoken string) (result PaginatedWebServicesList, err error) {
+ req, err := client.ListPreparer(skiptoken)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client WebServicesClient) ListPreparer(skiptoken string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(skiptoken) > 0 {
+ queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/webServices", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) ListResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListInResourceGroup retrieve all Azure ML web services in a given resource
+// group.
+//
+// resourceGroupName is name of the resource group. skiptoken is continuation
+// token for pagination.
+func (client WebServicesClient) ListInResourceGroup(resourceGroupName string, skiptoken string) (result PaginatedWebServicesList, err error) {
+ req, err := client.ListInResourceGroupPreparer(resourceGroupName, skiptoken)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListInResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListInResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListInResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListInResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListInResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListInResourceGroupPreparer prepares the ListInResourceGroup request.
+func (client WebServicesClient) ListInResourceGroupPreparer(resourceGroupName string, skiptoken string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(skiptoken) > 0 {
+ queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListInResourceGroupSender sends the ListInResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) ListInResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListInResourceGroupResponder handles the response to the ListInResourceGroup request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) ListInResourceGroupResponder(resp *http.Response) (result PaginatedWebServicesList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListKeys get the access keys of a particular Azure ML web service
+//
+// resourceGroupName is name of the resource group. webServiceName is the
+// Azure ML web service name which you want to reach.
+func (client WebServicesClient) ListKeys(resourceGroupName string, webServiceName string) (result WebServiceKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, webServiceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client WebServicesClient) ListKeysPreparer(resourceGroupName string, webServiceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "webServiceName": autorest.Encode("path", webServiceName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) ListKeysResponder(resp *http.Response) (result WebServiceKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Patch patch an existing Azure ML web service resource. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// patchPayload is the payload to patch the Azure ML web service with.
+// resourceGroupName is name of the resource group. webServiceName is the
+// Azure ML web service name which you want to reach.
+func (client WebServicesClient) Patch(patchPayload WebService, resourceGroupName string, webServiceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.PatchPreparer(patchPayload, resourceGroupName, webServiceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Patch", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Patch", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Patch", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchPreparer prepares the Patch request.
+func (client WebServicesClient) PatchPreparer(patchPayload WebService, resourceGroupName string, webServiceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "webServiceName": autorest.Encode("path", webServiceName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
+ autorest.WithJSON(patchPayload),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// PatchSender sends the Patch request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) PatchSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// PatchResponder handles the response to the Patch request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Remove remove an existing Azure ML web service. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is name of the resource group. webServiceName is the
+// Azure ML web service name which you want to reach.
+func (client WebServicesClient) Remove(resourceGroupName string, webServiceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RemovePreparer(resourceGroupName, webServiceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Remove", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RemoveSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Remove", resp, "Failure sending request")
+ }
+
+ result, err = client.RemoveResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "machinelearning.WebServicesClient", "Remove", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RemovePreparer prepares the Remove request.
+func (client WebServicesClient) RemovePreparer(resourceGroupName string, webServiceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "webServiceName": autorest.Encode("path", webServiceName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// RemoveSender sends the Remove request. The method will close the
+// http.Response Body if it receives an error.
+func (client WebServicesClient) RemoveSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// RemoveResponder handles the response to the Remove request. The method always
+// closes the http.Response Body.
+func (client WebServicesClient) RemoveResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/appcollections.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/appcollections.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/appcollections.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/appcollections.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,186 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AppCollectionsClient is the microsoft Azure Mobile Engagement REST APIs.
+type AppCollectionsClient struct {
+ ManagementClient
+}
+
+// NewAppCollectionsClient creates an instance of the AppCollectionsClient
+// client.
+func NewAppCollectionsClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) AppCollectionsClient {
+ return NewAppCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewAppCollectionsClientWithBaseURI creates an instance of the
+// AppCollectionsClient client.
+func NewAppCollectionsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) AppCollectionsClient {
+ return AppCollectionsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// CheckNameAvailability checks availability of an app collection name in the
+// Engagement domain.
+//
+func (client AppCollectionsClient) CheckNameAvailability(parameters AppCollectionNameAvailability) (result AppCollectionNameAvailability, err error) {
+ req, err := client.CheckNameAvailabilityPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "CheckNameAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client AppCollectionsClient) CheckNameAvailabilityPreparer(parameters AppCollectionNameAvailability) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/checkAppCollectionNameAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppCollectionsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client AppCollectionsClient) CheckNameAvailabilityResponder(resp *http.Response) (result AppCollectionNameAvailability, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List lists app collections in a subscription.
+func (client AppCollectionsClient) List() (result AppCollectionListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AppCollectionsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/appCollections", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppCollectionsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AppCollectionsClient) ListResponder(resp *http.Response) (result AppCollectionListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client AppCollectionsClient) ListNextResults(lastResults AppCollectionListResult) (result AppCollectionListResult, err error) {
+ req, err := lastResults.AppCollectionListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.AppCollectionsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/apps.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/apps.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/apps.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/apps.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,124 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AppsClient is the microsoft Azure Mobile Engagement REST APIs.
+type AppsClient struct {
+ ManagementClient
+}
+
+// NewAppsClient creates an instance of the AppsClient client.
+func NewAppsClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) AppsClient {
+ return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewAppsClientWithBaseURI creates an instance of the AppsClient client.
+func NewAppsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) AppsClient {
+ return AppsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// List lists apps in an appCollection.
+func (client AppsClient) List() (result AppListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AppsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AppsClient) ListResponder(resp *http.Response) (result AppListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client AppsClient) ListNextResults(lastResults AppListResult) (result AppListResult, err error) {
+ req, err := lastResults.AppListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.AppsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/campaigns.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/campaigns.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/campaigns.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/campaigns.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,977 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// CampaignsClient is the microsoft Azure Mobile Engagement REST APIs.
+type CampaignsClient struct {
+ ManagementClient
+}
+
+// NewCampaignsClient creates an instance of the CampaignsClient client.
+func NewCampaignsClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) CampaignsClient {
+ return NewCampaignsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewCampaignsClientWithBaseURI creates an instance of the CampaignsClient
+// client.
+func NewCampaignsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) CampaignsClient {
+ return CampaignsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// Activate activate a campaign previously created by a call to Create
+// campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) Activate(kind CampaignKinds, id int32) (result CampaignStateResult, err error) {
+ req, err := client.ActivatePreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ActivateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", resp, "Failure sending request")
+ }
+
+ result, err = client.ActivateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Activate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ActivatePreparer prepares the Activate request.
+func (client CampaignsClient) ActivatePreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/activate", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ActivateSender sends the Activate request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) ActivateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ActivateResponder handles the response to the Activate request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) ActivateResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Create create a push campaign (announcement, poll, data push or native
+// push).
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' parameters is parameters supplied to the
+// Update Campaign operation.
+func (client CampaignsClient) Create(kind CampaignKinds, parameters Campaign) (result CampaignStateResult, err error) {
+ req, err := client.CreatePreparer(kind, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client CampaignsClient) CreatePreparer(kind CampaignKinds, parameters Campaign) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) CreateResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete a campaign previously created by a call to Create campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) Delete(kind CampaignKinds, id int32) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client CampaignsClient) DeletePreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Finish finish a push campaign previously activated by a call to Activate
+// campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) Finish(kind CampaignKinds, id int32) (result CampaignStateResult, err error) {
+ req, err := client.FinishPreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", nil, "Failure preparing request")
+ }
+
+ resp, err := client.FinishSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", resp, "Failure sending request")
+ }
+
+ result, err = client.FinishResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Finish", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// FinishPreparer prepares the Finish request.
+func (client CampaignsClient) FinishPreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/finish", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// FinishSender sends the Finish request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) FinishSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// FinishResponder handles the response to the Finish request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) FinishResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get the Get campaign operation retrieves information about a previously
+// created campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) Get(kind CampaignKinds, id int32) (result CampaignResult, err error) {
+ req, err := client.GetPreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client CampaignsClient) GetPreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) GetResponder(resp *http.Response) (result CampaignResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByName the Get campaign operation retrieves information about a
+// previously created campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' name is campaign name.
+func (client CampaignsClient) GetByName(kind CampaignKinds, name string) (result CampaignResult, err error) {
+ req, err := client.GetByNamePreparer(kind, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByNamePreparer prepares the GetByName request.
+func (client CampaignsClient) GetByNamePreparer(kind CampaignKinds, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "kind": autorest.Encode("path", kind),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaignsByName/{kind}/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByNameSender sends the GetByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) GetByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByNameResponder handles the response to the GetByName request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) GetByNameResponder(resp *http.Response) (result CampaignResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetStatistics get all the campaign statistics.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) GetStatistics(kind CampaignKinds, id int32) (result CampaignStatisticsResult, err error) {
+ req, err := client.GetStatisticsPreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetStatisticsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", resp, "Failure sending request")
+ }
+
+ result, err = client.GetStatisticsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "GetStatistics", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetStatisticsPreparer prepares the GetStatistics request.
+func (client CampaignsClient) GetStatisticsPreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/statistics", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetStatisticsSender sends the GetStatistics request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) GetStatisticsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetStatisticsResponder handles the response to the GetStatistics request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) GetStatisticsResponder(resp *http.Response) (result CampaignStatisticsResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get the list of campaigns.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' skip is control paging of campaigns, start
+// results at the given offset, defaults to 0 (1st page of data). top is
+// control paging of campaigns, number of campaigns to return with each call.
+// It returns all campaigns by default. When specifying $top parameter, the
+// response contains a `nextLink` property describing the path to get the
+// next page if there are more results. filter is filter can be used to
+// restrict the results to campaigns matching a specific state. The syntax is
+// `$filter=state eq 'draft'`. Valid state values are: draft, scheduled,
+// in-progress, and finished. Only the eq operator and the state property are
+// supported. orderby is sort results by an expression which looks like
+// `$orderby=id asc` (this example is actually the default behavior). The
+// syntax is orderby={property} {direction} or just orderby={property}. The
+// available sorting properties are id, name, state, activatedDate, and
+// finishedDate. The available directions are asc (for ascending order) and
+// desc (for descending order). When not specified the asc direction is used.
+// Only one property at a time can be used for sorting. search is restrict
+// results to campaigns matching the optional `search` expression. This
+// currently performs the search based on the name on the campaign only, case
+// insensitive. If the campaign contains the value of the `search` parameter
+// anywhere in the name, it matches.
+func (client CampaignsClient) List(kind CampaignKinds, skip *int32, top *int32, filter string, orderby string, search string) (result CampaignsListResult, err error) {
+ req, err := client.ListPreparer(kind, skip, top, filter, orderby, search)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client CampaignsClient) ListPreparer(kind CampaignKinds, skip *int32, top *int32, filter string, orderby string, search string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if skip != nil {
+ queryParameters["$skip"] = autorest.Encode("query", *skip)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if len(orderby) > 0 {
+ queryParameters["$orderby"] = autorest.Encode("query", orderby)
+ }
+ if len(search) > 0 {
+ queryParameters["$search"] = autorest.Encode("query", search)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) ListResponder(resp *http.Response) (result CampaignsListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client CampaignsClient) ListNextResults(lastResults CampaignsListResult) (result CampaignsListResult, err error) {
+ req, err := lastResults.CampaignsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Push push a previously saved campaign (created with Create campaign) to a
+// set of devices.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier. parameters is
+// parameters supplied to the Push Campaign operation.
+func (client CampaignsClient) Push(kind CampaignKinds, id int32, parameters CampaignPushParameters) (result CampaignPushResult, err error) {
+ req, err := client.PushPreparer(kind, id, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PushSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", resp, "Failure sending request")
+ }
+
+ result, err = client.PushResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Push", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PushPreparer prepares the Push request.
+func (client CampaignsClient) PushPreparer(kind CampaignKinds, id int32, parameters CampaignPushParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/push", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PushSender sends the Push request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) PushSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PushResponder handles the response to the Push request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) PushResponder(resp *http.Response) (result CampaignPushResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Suspend suspend a push campaign previously activated by a call to Activate
+// campaign.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier.
+func (client CampaignsClient) Suspend(kind CampaignKinds, id int32) (result CampaignStateResult, err error) {
+ req, err := client.SuspendPreparer(kind, id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", nil, "Failure preparing request")
+ }
+
+ resp, err := client.SuspendSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", resp, "Failure sending request")
+ }
+
+ result, err = client.SuspendResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Suspend", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// SuspendPreparer prepares the Suspend request.
+func (client CampaignsClient) SuspendPreparer(kind CampaignKinds, id int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/suspend", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// SuspendSender sends the Suspend request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) SuspendSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// SuspendResponder handles the response to the Suspend request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) SuspendResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// TestNew test a new campaign on a set of devices.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' parameters is parameters supplied to the Test
+// Campaign operation.
+func (client CampaignsClient) TestNew(kind CampaignKinds, parameters CampaignTestNewParameters) (result CampaignState, err error) {
+ req, err := client.TestNewPreparer(kind, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", nil, "Failure preparing request")
+ }
+
+ resp, err := client.TestNewSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", resp, "Failure sending request")
+ }
+
+ result, err = client.TestNewResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestNew", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// TestNewPreparer prepares the TestNew request.
+func (client CampaignsClient) TestNewPreparer(kind CampaignKinds, parameters CampaignTestNewParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/test", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// TestNewSender sends the TestNew request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) TestNewSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// TestNewResponder handles the response to the TestNew request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) TestNewResponder(resp *http.Response) (result CampaignState, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// TestSaved test an existing campaign (created with Create campaign) on a set
+// of devices.
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier. parameters is
+// parameters supplied to the Test Campaign operation.
+func (client CampaignsClient) TestSaved(kind CampaignKinds, id int32, parameters CampaignTestSavedParameters) (result CampaignStateResult, err error) {
+ req, err := client.TestSavedPreparer(kind, id, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", nil, "Failure preparing request")
+ }
+
+ resp, err := client.TestSavedSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", resp, "Failure sending request")
+ }
+
+ result, err = client.TestSavedResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "TestSaved", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// TestSavedPreparer prepares the TestSaved request.
+func (client CampaignsClient) TestSavedPreparer(kind CampaignKinds, id int32, parameters CampaignTestSavedParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}/test", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// TestSavedSender sends the TestSaved request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) TestSavedSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// TestSavedResponder handles the response to the TestSaved request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) TestSavedResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update an existing push campaign (announcement, poll, data push or
+// native push).
+//
+// kind is campaign kind. Possible values include: 'announcements', 'polls',
+// 'dataPushes', 'nativePushes' id is campaign identifier. parameters is
+// parameters supplied to the Update Campaign operation.
+func (client CampaignsClient) Update(kind CampaignKinds, id int32, parameters Campaign) (result CampaignStateResult, err error) {
+ req, err := client.UpdatePreparer(kind, id, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.CampaignsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client CampaignsClient) UpdatePreparer(kind CampaignKinds, id int32, parameters Campaign) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "kind": autorest.Encode("path", kind),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/campaigns/{kind}/{id}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client CampaignsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client CampaignsClient) UpdateResponder(resp *http.Response) (result CampaignStateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,64 @@
+// Package mobileengagement implements the Azure ARM Mobileengagement service
+// API version 2014-12-01.
+//
+// Microsoft Azure Mobile Engagement REST APIs.
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Mobileengagement
+ APIVersion = "2014-12-01"
+
+ // DefaultBaseURI is the default URI used for the service Mobileengagement
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Mobileengagement.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+ ResourceGroupName string
+ AppCollection string
+ AppName string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string, resourceGroupName string, appCollection string, appName string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ ResourceGroupName: resourceGroupName,
+ AppCollection: appCollection,
+ AppName: appName,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/devices.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/devices.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/devices.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/devices.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,442 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// DevicesClient is the microsoft Azure Mobile Engagement REST APIs.
+type DevicesClient struct {
+ ManagementClient
+}
+
+// NewDevicesClient creates an instance of the DevicesClient client.
+func NewDevicesClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) DevicesClient {
+ return NewDevicesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewDevicesClientWithBaseURI creates an instance of the DevicesClient client.
+func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) DevicesClient {
+ return DevicesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// GetByDeviceID get the information associated to a device running an
+// application.
+//
+// deviceID is device identifier.
+func (client DevicesClient) GetByDeviceID(deviceID string) (result Device, err error) {
+ req, err := client.GetByDeviceIDPreparer(deviceID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByDeviceIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByDeviceIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByDeviceID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByDeviceIDPreparer prepares the GetByDeviceID request.
+func (client DevicesClient) GetByDeviceIDPreparer(deviceID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "deviceId": autorest.Encode("path", deviceID),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/{deviceId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByDeviceIDSender sends the GetByDeviceID request. The method will close the
+// http.Response Body if it receives an error.
+func (client DevicesClient) GetByDeviceIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByDeviceIDResponder handles the response to the GetByDeviceID request. The method always
+// closes the http.Response Body.
+func (client DevicesClient) GetByDeviceIDResponder(resp *http.Response) (result Device, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByUserID get the information associated to a device running an
+// application using the user identifier.
+//
+// userID is user identifier.
+func (client DevicesClient) GetByUserID(userID string) (result Device, err error) {
+ req, err := client.GetByUserIDPreparer(userID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByUserIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByUserIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "GetByUserID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByUserIDPreparer prepares the GetByUserID request.
+func (client DevicesClient) GetByUserIDPreparer(userID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "userId": autorest.Encode("path", userID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/users/{userId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByUserIDSender sends the GetByUserID request. The method will close the
+// http.Response Body if it receives an error.
+func (client DevicesClient) GetByUserIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByUserIDResponder handles the response to the GetByUserID request. The method always
+// closes the http.Response Body.
+func (client DevicesClient) GetByUserIDResponder(resp *http.Response) (result Device, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List query the information associated to the devices running an application.
+//
+// top is number of devices to return with each call. Defaults to 100 and
+// cannot return more. Passing a greater value is ignored. The response
+// contains a `nextLink` property describing the URI path to get the next
+// page of results if not all results could be returned at once.
+// selectParameter is by default all `meta` and `appInfo` properties are
+// returned, this property is used to restrict the output to the desired
+// properties. It also excludes all devices from the output that have none of
+// the selected properties. In other terms, only devices having at least one
+// of the selected property being set is part of the results. Examples: -
+// `$select=appInfo` : select all devices having at least 1 appInfo, return
+// them all and don’t return any meta property. - `$select=meta` : return
+// only meta properties in the output. -
+// `$select=appInfo,meta/firstSeen,meta/lastSeen` : return all `appInfo`,
+// plus meta object containing only firstSeen and lastSeen properties. The
+// format is thus a comma separated list of properties to select. Use
+// `appInfo` to select all appInfo properties, `meta` to select all meta
+// properties. Use `appInfo/{key}` and `meta/{key}` to select specific
+// appInfo and meta properties. filter is filter can be used to reduce the
+// number of results. Filter is a boolean expression that can look like the
+// following examples: * `$filter=deviceId gt
+// 'abcdef0123456789abcdef0123456789'` * `$filter=lastModified le
+// 1447284263690L` * `$filter=(deviceId ge
+// 'abcdef0123456789abcdef0123456789') and (deviceId lt
+// 'bacdef0123456789abcdef0123456789') and (lastModified gt 1447284263690L)`
+// The first example is used automatically for paging when returning the
+// `nextLink` property. The filter expression is a combination of checks on
+// some properties that can be compared to their value. The available
+// operators are: * `gt` : greater than * `ge` : greater than or equals *
+// `lt` : less than * `le` : less than or equals * `and` : to add multiple
+// checks (all checks must pass), optional parentheses can be used. The
+// properties that can be used in the expression are the following: *
+// `deviceId {operator} '{deviceIdValue}'` : a lexicographical comparison is
+// made on the deviceId value, use single quotes for the value. *
+// `lastModified {operator} {number}L` : returns only meta properties or
+// appInfo properties whose last value modification timestamp compared to the
+// specified value is matching (value is milliseconds since January 1st, 1970
+// UTC). Please note the `L` character after the number of milliseconds, its
+// required when the number of milliseconds exceeds `2^31 - 1` (which is
+// always the case for recent timestamps). Using `lastModified` excludes all
+// devices from the output that have no property matching the timestamp
+// criteria, like `$select`. Please note that the internal value of
+// `lastModified` timestamp for a given property is never part of the
+// results.
+func (client DevicesClient) List(top *int32, selectParameter string, filter string) (result DevicesQueryResult, err error) {
+ req, err := client.ListPreparer(top, selectParameter, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DevicesClient) ListPreparer(top *int32, selectParameter string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client DevicesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client DevicesClient) ListResponder(resp *http.Response) (result DevicesQueryResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client DevicesClient) ListNextResults(lastResults DevicesQueryResult) (result DevicesQueryResult, err error) {
+ req, err := lastResults.DevicesQueryResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// TagByDeviceID update the tags registered for a set of devices running an
+// application. Updates are performed asynchronously, meaning that a few
+// seconds are needed before the modifications appear in the results of the
+// Get device command.
+//
+func (client DevicesClient) TagByDeviceID(parameters DeviceTagsParameters) (result DeviceTagsResult, err error) {
+ req, err := client.TagByDeviceIDPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.TagByDeviceIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", resp, "Failure sending request")
+ }
+
+ result, err = client.TagByDeviceIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByDeviceID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// TagByDeviceIDPreparer prepares the TagByDeviceID request.
+func (client DevicesClient) TagByDeviceIDPreparer(parameters DeviceTagsParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/tag", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// TagByDeviceIDSender sends the TagByDeviceID request. The method will close the
+// http.Response Body if it receives an error.
+func (client DevicesClient) TagByDeviceIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// TagByDeviceIDResponder handles the response to the TagByDeviceID request. The method always
+// closes the http.Response Body.
+func (client DevicesClient) TagByDeviceIDResponder(resp *http.Response) (result DeviceTagsResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// TagByUserID update the tags registered for a set of users running an
+// application. Updates are performed asynchronously, meaning that a few
+// seconds are needed before the modifications appear in the results of the
+// Get device command.
+//
+func (client DevicesClient) TagByUserID(parameters DeviceTagsParameters) (result DeviceTagsResult, err error) {
+ req, err := client.TagByUserIDPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.TagByUserIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", resp, "Failure sending request")
+ }
+
+ result, err = client.TagByUserIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.DevicesClient", "TagByUserID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// TagByUserIDPreparer prepares the TagByUserID request.
+func (client DevicesClient) TagByUserIDPreparer(parameters DeviceTagsParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/users/tag", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// TagByUserIDSender sends the TagByUserID request. The method will close the
+// http.Response Body if it receives an error.
+func (client DevicesClient) TagByUserIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// TagByUserIDResponder handles the response to the TagByUserID request. The method always
+// closes the http.Response Body.
+func (client DevicesClient) TagByUserIDResponder(resp *http.Response) (result DeviceTagsResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/exporttasks.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/exporttasks.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/exporttasks.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/exporttasks.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,858 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ExportTasksClient is the microsoft Azure Mobile Engagement REST APIs.
+type ExportTasksClient struct {
+ ManagementClient
+}
+
+// NewExportTasksClient creates an instance of the ExportTasksClient client.
+func NewExportTasksClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) ExportTasksClient {
+ return NewExportTasksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewExportTasksClientWithBaseURI creates an instance of the
+// ExportTasksClient client.
+func NewExportTasksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) ExportTasksClient {
+ return ExportTasksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// CreateActivitiesTask creates a task to export activities.
+//
+func (client ExportTasksClient) CreateActivitiesTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateActivitiesTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateActivitiesTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateActivitiesTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateActivitiesTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateActivitiesTaskPreparer prepares the CreateActivitiesTask request.
+func (client ExportTasksClient) CreateActivitiesTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/activities", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateActivitiesTaskSender sends the CreateActivitiesTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateActivitiesTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateActivitiesTaskResponder handles the response to the CreateActivitiesTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateActivitiesTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateCrashesTask creates a task to export crashes.
+//
+func (client ExportTasksClient) CreateCrashesTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateCrashesTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateCrashesTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateCrashesTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateCrashesTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateCrashesTaskPreparer prepares the CreateCrashesTask request.
+func (client ExportTasksClient) CreateCrashesTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/crashes", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateCrashesTaskSender sends the CreateCrashesTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateCrashesTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateCrashesTaskResponder handles the response to the CreateCrashesTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateCrashesTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateErrorsTask creates a task to export errors.
+//
+func (client ExportTasksClient) CreateErrorsTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateErrorsTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateErrorsTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateErrorsTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateErrorsTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateErrorsTaskPreparer prepares the CreateErrorsTask request.
+func (client ExportTasksClient) CreateErrorsTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/errors", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateErrorsTaskSender sends the CreateErrorsTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateErrorsTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateErrorsTaskResponder handles the response to the CreateErrorsTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateErrorsTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateEventsTask creates a task to export events.
+//
+func (client ExportTasksClient) CreateEventsTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateEventsTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateEventsTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateEventsTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateEventsTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateEventsTaskPreparer prepares the CreateEventsTask request.
+func (client ExportTasksClient) CreateEventsTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/events", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateEventsTaskSender sends the CreateEventsTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateEventsTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateEventsTaskResponder handles the response to the CreateEventsTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateEventsTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateFeedbackTaskByCampaign creates a task to export push campaign data
+// for a set of campaigns.
+//
+func (client ExportTasksClient) CreateFeedbackTaskByCampaign(parameters FeedbackByCampaignParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateFeedbackTaskByCampaignPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateFeedbackTaskByCampaignSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateFeedbackTaskByCampaignResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByCampaign", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateFeedbackTaskByCampaignPreparer prepares the CreateFeedbackTaskByCampaign request.
+func (client ExportTasksClient) CreateFeedbackTaskByCampaignPreparer(parameters FeedbackByCampaignParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/feedbackByCampaign", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateFeedbackTaskByCampaignSender sends the CreateFeedbackTaskByCampaign request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateFeedbackTaskByCampaignSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateFeedbackTaskByCampaignResponder handles the response to the CreateFeedbackTaskByCampaign request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateFeedbackTaskByCampaignResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateFeedbackTaskByDateRange creates a task to export push campaign data
+// for a date range.
+//
+func (client ExportTasksClient) CreateFeedbackTaskByDateRange(parameters FeedbackByDateRangeParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateFeedbackTaskByDateRangePreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateFeedbackTaskByDateRangeSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateFeedbackTaskByDateRangeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateFeedbackTaskByDateRange", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateFeedbackTaskByDateRangePreparer prepares the CreateFeedbackTaskByDateRange request.
+func (client ExportTasksClient) CreateFeedbackTaskByDateRangePreparer(parameters FeedbackByDateRangeParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/feedbackByDate", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateFeedbackTaskByDateRangeSender sends the CreateFeedbackTaskByDateRange request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateFeedbackTaskByDateRangeSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateFeedbackTaskByDateRangeResponder handles the response to the CreateFeedbackTaskByDateRange request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateFeedbackTaskByDateRangeResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateJobsTask creates a task to export jobs.
+//
+func (client ExportTasksClient) CreateJobsTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateJobsTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateJobsTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateJobsTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateJobsTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateJobsTaskPreparer prepares the CreateJobsTask request.
+func (client ExportTasksClient) CreateJobsTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/jobs", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateJobsTaskSender sends the CreateJobsTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateJobsTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateJobsTaskResponder handles the response to the CreateJobsTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateJobsTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateSessionsTask creates a task to export sessions.
+//
+func (client ExportTasksClient) CreateSessionsTask(parameters DateRangeExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateSessionsTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSessionsTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateSessionsTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateSessionsTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateSessionsTaskPreparer prepares the CreateSessionsTask request.
+func (client ExportTasksClient) CreateSessionsTaskPreparer(parameters DateRangeExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/sessions", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSessionsTaskSender sends the CreateSessionsTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateSessionsTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateSessionsTaskResponder handles the response to the CreateSessionsTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateSessionsTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateTagsTask creates a task to export tags.
+//
+func (client ExportTasksClient) CreateTagsTask(parameters ExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateTagsTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateTagsTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateTagsTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTagsTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateTagsTaskPreparer prepares the CreateTagsTask request.
+func (client ExportTasksClient) CreateTagsTaskPreparer(parameters ExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/tags", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateTagsTaskSender sends the CreateTagsTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateTagsTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateTagsTaskResponder handles the response to the CreateTagsTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateTagsTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateTokensTask creates a task to export tags.
+//
+func (client ExportTasksClient) CreateTokensTask(parameters ExportTaskParameter) (result ExportTaskResult, err error) {
+ req, err := client.CreateTokensTaskPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateTokensTaskSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateTokensTaskResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "CreateTokensTask", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateTokensTaskPreparer prepares the CreateTokensTask request.
+func (client ExportTasksClient) CreateTokensTaskPreparer(parameters ExportTaskParameter) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/tokens", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateTokensTaskSender sends the CreateTokensTask request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) CreateTokensTaskSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateTokensTaskResponder handles the response to the CreateTokensTask request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) CreateTokensTaskResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get retrieves information about a previously created export task.
+//
+// id is export task identifier.
+func (client ExportTasksClient) Get(id string) (result ExportTaskResult, err error) {
+ req, err := client.GetPreparer(id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ExportTasksClient) GetPreparer(id string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks/{id}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) GetResponder(resp *http.Response) (result ExportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get the list of export tasks.
+//
+// skip is control paging of export tasks, start results at the given offset,
+// defaults to 0 (1st page of data). top is control paging of export tasks,
+// number of export tasks to return with each call. By default, it returns
+// all export tasks with a default paging of 20.
+// The response contains a `nextLink` property describing the path to get the
+// next page if there are more results.
+// The maximum paging limit for $top is 40. orderby is sort results by an
+// expression which looks like `$orderby=taskId asc` (default when not
+// specified).
+// The syntax is orderby={property} {direction} or just orderby={property}.
+// Properties that can be specified for sorting: taskId, errorDetails,
+// dateCreated, taskStatus, and dateCreated.
+// The available directions are asc (for ascending order) and desc (for
+// descending order).
+// When not specified the asc direction is used.
+// Only one orderby property can be specified.
+func (client ExportTasksClient) List(skip *int32, top *int32, orderby string) (result ExportTaskListResult, err error) {
+ req, err := client.ListPreparer(skip, top, orderby)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ExportTasksClient) ListPreparer(skip *int32, top *int32, orderby string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if skip != nil {
+ queryParameters["$skip"] = autorest.Encode("query", *skip)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderby) > 0 {
+ queryParameters["$orderby"] = autorest.Encode("query", orderby)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/exportTasks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExportTasksClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ExportTasksClient) ListResponder(resp *http.Response) (result ExportTaskListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client ExportTasksClient) ListNextResults(lastResults ExportTaskListResult) (result ExportTaskListResult, err error) {
+ req, err := lastResults.ExportTaskListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ExportTasksClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/importtasks.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/importtasks.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/importtasks.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/importtasks.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,281 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ImportTasksClient is the microsoft Azure Mobile Engagement REST APIs.
+type ImportTasksClient struct {
+ ManagementClient
+}
+
+// NewImportTasksClient creates an instance of the ImportTasksClient client.
+func NewImportTasksClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) ImportTasksClient {
+ return NewImportTasksClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewImportTasksClientWithBaseURI creates an instance of the
+// ImportTasksClient client.
+func NewImportTasksClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) ImportTasksClient {
+ return ImportTasksClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// Create creates a job to import the specified data to a storageUrl.
+//
+func (client ImportTasksClient) Create(parameters ImportTask) (result ImportTaskResult, err error) {
+ req, err := client.CreatePreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client ImportTasksClient) CreatePreparer(parameters ImportTask) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client ImportTasksClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client ImportTasksClient) CreateResponder(resp *http.Response) (result ImportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get the Get import job operation retrieves information about a previously
+// created import job.
+//
+// id is import job identifier.
+func (client ImportTasksClient) Get(id string) (result ImportTaskResult, err error) {
+ req, err := client.GetPreparer(id)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ImportTasksClient) GetPreparer(id string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "id": autorest.Encode("path", id),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks/{id}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ImportTasksClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ImportTasksClient) GetResponder(resp *http.Response) (result ImportTaskResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get the list of import jobs.
+//
+// skip is control paging of import jobs, start results at the given offset,
+// defaults to 0 (1st page of data). top is control paging of import jobs,
+// number of import jobs to return with each call. By default, it returns all
+// import jobs with a default paging of 20.
+// The response contains a `nextLink` property describing the path to get the
+// next page if there are more results.
+// The maximum paging limit for $top is 40. orderby is sort results by an
+// expression which looks like `$orderby=jobId asc` (default when not
+// specified).
+// The syntax is orderby={property} {direction} or just orderby={property}.
+// Properties that can be specified for sorting: jobId, errorDetails,
+// dateCreated, jobStatus, and dateCreated.
+// The available directions are asc (for ascending order) and desc (for
+// descending order).
+// When not specified the asc direction is used.
+// Only one orderby property can be specified.
+func (client ImportTasksClient) List(skip *int32, top *int32, orderby string) (result ImportTaskListResult, err error) {
+ req, err := client.ListPreparer(skip, top, orderby)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ImportTasksClient) ListPreparer(skip *int32, top *int32, orderby string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "appCollection": autorest.Encode("path", client.AppCollection),
+ "appName": autorest.Encode("path", client.AppName),
+ "resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if skip != nil {
+ queryParameters["$skip"] = autorest.Encode("query", *skip)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+ if len(orderby) > 0 {
+ queryParameters["$orderby"] = autorest.Encode("query", orderby)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ImportTasksClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ImportTasksClient) ListResponder(resp *http.Response) (result ImportTaskListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client ImportTasksClient) ListNextResults(lastResults ImportTaskListResult) (result ImportTaskListResult, err error) {
+ req, err := lastResults.ImportTaskListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.ImportTasksClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,920 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// AudienceOperators enumerates the values for audience operators.
+type AudienceOperators string
+
+const (
+ // EQ specifies the eq state for audience operators.
+ EQ AudienceOperators = "EQ"
+ // GE specifies the ge state for audience operators.
+ GE AudienceOperators = "GE"
+ // GT specifies the gt state for audience operators.
+ GT AudienceOperators = "GT"
+ // LE specifies the le state for audience operators.
+ LE AudienceOperators = "LE"
+ // LT specifies the lt state for audience operators.
+ LT AudienceOperators = "LT"
+)
+
+// CampaignFeedbacks enumerates the values for campaign feedbacks.
+type CampaignFeedbacks string
+
+const (
+ // Actioned specifies the actioned state for campaign feedbacks.
+ Actioned CampaignFeedbacks = "actioned"
+ // Exited specifies the exited state for campaign feedbacks.
+ Exited CampaignFeedbacks = "exited"
+ // Pushed specifies the pushed state for campaign feedbacks.
+ Pushed CampaignFeedbacks = "pushed"
+ // Replied specifies the replied state for campaign feedbacks.
+ Replied CampaignFeedbacks = "replied"
+)
+
+// CampaignKinds enumerates the values for campaign kinds.
+type CampaignKinds string
+
+const (
+ // Announcements specifies the announcements state for campaign kinds.
+ Announcements CampaignKinds = "announcements"
+ // DataPushes specifies the data pushes state for campaign kinds.
+ DataPushes CampaignKinds = "dataPushes"
+ // NativePushes specifies the native pushes state for campaign kinds.
+ NativePushes CampaignKinds = "nativePushes"
+ // Polls specifies the polls state for campaign kinds.
+ Polls CampaignKinds = "polls"
+)
+
+// CampaignStates enumerates the values for campaign states.
+type CampaignStates string
+
+const (
+ // Draft specifies the draft state for campaign states.
+ Draft CampaignStates = "draft"
+ // Finished specifies the finished state for campaign states.
+ Finished CampaignStates = "finished"
+ // InProgress specifies the in progress state for campaign states.
+ InProgress CampaignStates = "in-progress"
+ // Queued specifies the queued state for campaign states.
+ Queued CampaignStates = "queued"
+ // Scheduled specifies the scheduled state for campaign states.
+ Scheduled CampaignStates = "scheduled"
+)
+
+// CampaignType enumerates the values for campaign type.
+type CampaignType string
+
+const (
+ // Announcement specifies the announcement state for campaign type.
+ Announcement CampaignType = "Announcement"
+ // DataPush specifies the data push state for campaign type.
+ DataPush CampaignType = "DataPush"
+ // NativePush specifies the native push state for campaign type.
+ NativePush CampaignType = "NativePush"
+ // Poll specifies the poll state for campaign type.
+ Poll CampaignType = "Poll"
+)
+
+// CampaignTypes enumerates the values for campaign types.
+type CampaignTypes string
+
+const (
+ // OnlyNotif specifies the only notif state for campaign types.
+ OnlyNotif CampaignTypes = "only_notif"
+ // Textbase64 specifies the textbase 64 state for campaign types.
+ Textbase64 CampaignTypes = "text/base64"
+ // Texthtml specifies the texthtml state for campaign types.
+ Texthtml CampaignTypes = "text/html"
+ // Textplain specifies the textplain state for campaign types.
+ Textplain CampaignTypes = "text/plain"
+)
+
+// DeliveryTimes enumerates the values for delivery times.
+type DeliveryTimes string
+
+const (
+ // Any specifies the any state for delivery times.
+ Any DeliveryTimes = "any"
+ // Background specifies the background state for delivery times.
+ Background DeliveryTimes = "background"
+ // Session specifies the session state for delivery times.
+ Session DeliveryTimes = "session"
+)
+
+// ExportFormat enumerates the values for export format.
+type ExportFormat string
+
+const (
+ // CsvBlob specifies the csv blob state for export format.
+ CsvBlob ExportFormat = "CsvBlob"
+ // JSONBlob specifies the json blob state for export format.
+ JSONBlob ExportFormat = "JsonBlob"
+)
+
+// ExportState enumerates the values for export state.
+type ExportState string
+
+const (
+ // ExportStateFailed specifies the export state failed state for export
+ // state.
+ ExportStateFailed ExportState = "Failed"
+ // ExportStateQueued specifies the export state queued state for export
+ // state.
+ ExportStateQueued ExportState = "Queued"
+ // ExportStateStarted specifies the export state started state for export
+ // state.
+ ExportStateStarted ExportState = "Started"
+ // ExportStateSucceeded specifies the export state succeeded state for
+ // export state.
+ ExportStateSucceeded ExportState = "Succeeded"
+)
+
+// ExportType enumerates the values for export type.
+type ExportType string
+
+const (
+ // ExportTypeActivity specifies the export type activity state for export
+ // type.
+ ExportTypeActivity ExportType = "Activity"
+ // ExportTypeCrash specifies the export type crash state for export type.
+ ExportTypeCrash ExportType = "Crash"
+ // ExportTypeError specifies the export type error state for export type.
+ ExportTypeError ExportType = "Error"
+ // ExportTypeEvent specifies the export type event state for export type.
+ ExportTypeEvent ExportType = "Event"
+ // ExportTypeJob specifies the export type job state for export type.
+ ExportTypeJob ExportType = "Job"
+ // ExportTypePush specifies the export type push state for export type.
+ ExportTypePush ExportType = "Push"
+ // ExportTypeSession specifies the export type session state for export
+ // type.
+ ExportTypeSession ExportType = "Session"
+ // ExportTypeTag specifies the export type tag state for export type.
+ ExportTypeTag ExportType = "Tag"
+ // ExportTypeToken specifies the export type token state for export type.
+ ExportTypeToken ExportType = "Token"
+)
+
+// JobStates enumerates the values for job states.
+type JobStates string
+
+const (
+ // JobStatesFailed specifies the job states failed state for job states.
+ JobStatesFailed JobStates = "Failed"
+ // JobStatesQueued specifies the job states queued state for job states.
+ JobStatesQueued JobStates = "Queued"
+ // JobStatesStarted specifies the job states started state for job states.
+ JobStatesStarted JobStates = "Started"
+ // JobStatesSucceeded specifies the job states succeeded state for job
+ // states.
+ JobStatesSucceeded JobStates = "Succeeded"
+)
+
+// NotificationTypes enumerates the values for notification types.
+type NotificationTypes string
+
+const (
+ // Popup specifies the popup state for notification types.
+ Popup NotificationTypes = "popup"
+ // System specifies the system state for notification types.
+ System NotificationTypes = "system"
+)
+
+// ProvisioningStates enumerates the values for provisioning states.
+type ProvisioningStates string
+
+const (
+ // Creating specifies the creating state for provisioning states.
+ Creating ProvisioningStates = "Creating"
+ // Succeeded specifies the succeeded state for provisioning states.
+ Succeeded ProvisioningStates = "Succeeded"
+)
+
+// PushModes enumerates the values for push modes.
+type PushModes string
+
+const (
+ // Manual specifies the manual state for push modes.
+ Manual PushModes = "manual"
+ // OneShot specifies the one shot state for push modes.
+ OneShot PushModes = "one-shot"
+ // RealTime specifies the real time state for push modes.
+ RealTime PushModes = "real-time"
+)
+
+// AnnouncementFeedbackCriterion is used to target devices who received an
+// announcement.
+type AnnouncementFeedbackCriterion struct {
+ ContentID *int32 `json:"content-id,omitempty"`
+ Action CampaignFeedbacks `json:"action,omitempty"`
+}
+
+// APIError is
+type APIError struct {
+ Error *APIErrorError `json:"error,omitempty"`
+}
+
+// APIErrorError is
+type APIErrorError struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// App is the Mobile Engagement App resource.
+type App struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *AppProperties `json:"properties,omitempty"`
+}
+
+// AppCollection is the AppCollection resource.
+type AppCollection struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *AppCollectionProperties `json:"properties,omitempty"`
+}
+
+// AppCollectionListResult is the list AppCollections operation response.
+type AppCollectionListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]AppCollection `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
+
+// AppCollectionListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client AppCollectionListResult) AppCollectionListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// AppCollectionNameAvailability is
+type AppCollectionNameAvailability struct {
+ autorest.Response `json:"-"`
+ Name *string `json:"name,omitempty"`
+ Available *bool `json:"available,omitempty"`
+ UnavailabilityReason *string `json:"unavailabilityReason,omitempty"`
+}
+
+// AppCollectionProperties is
+type AppCollectionProperties struct {
+ ProvisioningState ProvisioningStates `json:"provisioningState,omitempty"`
+}
+
+// AppInfoFilter is send only to users who have some app info set. This is a
+// special filter that is automatically added if your campaign contains
+// appInfo parameters. It is not intended to be public and should not be used
+// as it could be removed or replaced by the API.
+type AppInfoFilter struct {
+ AppInfo *[]string `json:"appInfo,omitempty"`
+}
+
+// ApplicationVersionCriterion is used to target devices based on the version
+// of the application they are using.
+type ApplicationVersionCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// AppListResult is the list Apps operation response.
+type AppListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]App `json:"value,omitempty"`
+ NextLink *string `json:",omitempty"`
+}
+
+// AppListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client AppListResult) AppListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// AppProperties is
+type AppProperties struct {
+ BackendID *string `json:"backendId,omitempty"`
+ Platform *string `json:"platform,omitempty"`
+ AppState *string `json:"appState,omitempty"`
+}
+
+// BooleanTagCriterion is target devices based on a boolean tag value.
+type BooleanTagCriterion struct {
+ Name *string `json:"name,omitempty"`
+ Value *bool `json:"value,omitempty"`
+}
+
+// Campaign is
+type Campaign struct {
+ NotificationTitle *string `json:"notificationTitle,omitempty"`
+ NotificationMessage *string `json:"notificationMessage,omitempty"`
+ NotificationImage *[]byte `json:"notificationImage,omitempty"`
+ NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"`
+ Title *string `json:"title,omitempty"`
+ Body *string `json:"body,omitempty"`
+ ActionButtonText *string `json:"actionButtonText,omitempty"`
+ ExitButtonText *string `json:"exitButtonText,omitempty"`
+ ActionURL *string `json:"actionUrl,omitempty"`
+ Payload *map[string]interface{} `json:"payload,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Audience *CampaignAudience `json:"audience,omitempty"`
+ Category *string `json:"category,omitempty"`
+ PushMode PushModes `json:"pushMode,omitempty"`
+ Type CampaignTypes `json:"type,omitempty"`
+ DeliveryTime DeliveryTimes `json:"deliveryTime,omitempty"`
+ DeliveryActivities *[]string `json:"deliveryActivities,omitempty"`
+ StartTime *string `json:"startTime,omitempty"`
+ EndTime *string `json:"endTime,omitempty"`
+ Timezone *string `json:"timezone,omitempty"`
+ NotificationType NotificationTypes `json:"notificationType,omitempty"`
+ NotificationIcon *bool `json:"notificationIcon,omitempty"`
+ NotificationCloseable *bool `json:"notificationCloseable,omitempty"`
+ NotificationVibrate *bool `json:"notificationVibrate,omitempty"`
+ NotificationSound *bool `json:"notificationSound,omitempty"`
+ NotificationBadge *bool `json:"notificationBadge,omitempty"`
+ Localization *map[string]*CampaignLocalization `json:"localization,omitempty"`
+ Questions *[]PollQuestion `json:"questions,omitempty"`
+}
+
+// CampaignAudience is specify which users will be targeted by this campaign.
+// By default, all users will be targeted. If you set `pushMode` property to
+// `manual`, the only thing you can specify in the audience is the push quota
+// filter. An audience is a boolean expression made of criteria (variables)
+// operators (`not`, `and` or `or`) and parenthesis. Additionally, a set of
+// filters can be added to an audience. 65535 bytes max as per JSON encoding.
+type CampaignAudience struct {
+ Expression *string `json:"expression,omitempty"`
+ Criteria *map[string]*Criterion `json:"criteria,omitempty"`
+ Filters *[]Filter `json:"filters,omitempty"`
+}
+
+// CampaignListResult is
+type CampaignListResult struct {
+ State CampaignStates `json:"state,omitempty"`
+ ID *int32 `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ ActivatedDate *date.Time `json:"activatedDate,omitempty"`
+ FinishedDate *date.Time `json:"finishedDate,omitempty"`
+ StartTime *date.Time `json:"startTime,omitempty"`
+ EndTime *date.Time `json:"endTime,omitempty"`
+ Timezone *string `json:"timezone,omitempty"`
+}
+
+// CampaignLocalization is
+type CampaignLocalization struct {
+ NotificationTitle *string `json:"notificationTitle,omitempty"`
+ NotificationMessage *string `json:"notificationMessage,omitempty"`
+ NotificationImage *[]byte `json:"notificationImage,omitempty"`
+ NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"`
+ Title *string `json:"title,omitempty"`
+ Body *string `json:"body,omitempty"`
+ ActionButtonText *string `json:"actionButtonText,omitempty"`
+ ExitButtonText *string `json:"exitButtonText,omitempty"`
+ ActionURL *string `json:"actionUrl,omitempty"`
+ Payload *map[string]interface{} `json:"payload,omitempty"`
+}
+
+// CampaignPushParameters is
+type CampaignPushParameters struct {
+ DeviceIds *[]string `json:"deviceIds,omitempty"`
+ Data *Campaign `json:"data,omitempty"`
+}
+
+// CampaignPushResult is
+type CampaignPushResult struct {
+ autorest.Response `json:"-"`
+ InvalidDeviceIds *[]string `json:"invalidDeviceIds,omitempty"`
+}
+
+// CampaignResult is
+type CampaignResult struct {
+ autorest.Response `json:"-"`
+ NotificationTitle *string `json:"notificationTitle,omitempty"`
+ NotificationMessage *string `json:"notificationMessage,omitempty"`
+ NotificationImage *[]byte `json:"notificationImage,omitempty"`
+ NotificationOptions *NotificationOptions `json:"notificationOptions,omitempty"`
+ Title *string `json:"title,omitempty"`
+ Body *string `json:"body,omitempty"`
+ ActionButtonText *string `json:"actionButtonText,omitempty"`
+ ExitButtonText *string `json:"exitButtonText,omitempty"`
+ ActionURL *string `json:"actionUrl,omitempty"`
+ Payload *map[string]interface{} `json:"payload,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Audience *CampaignAudience `json:"audience,omitempty"`
+ Category *string `json:"category,omitempty"`
+ PushMode PushModes `json:"pushMode,omitempty"`
+ Type CampaignTypes `json:"type,omitempty"`
+ DeliveryTime DeliveryTimes `json:"deliveryTime,omitempty"`
+ DeliveryActivities *[]string `json:"deliveryActivities,omitempty"`
+ StartTime *string `json:"startTime,omitempty"`
+ EndTime *string `json:"endTime,omitempty"`
+ Timezone *string `json:"timezone,omitempty"`
+ NotificationType NotificationTypes `json:"notificationType,omitempty"`
+ NotificationIcon *bool `json:"notificationIcon,omitempty"`
+ NotificationCloseable *bool `json:"notificationCloseable,omitempty"`
+ NotificationVibrate *bool `json:"notificationVibrate,omitempty"`
+ NotificationSound *bool `json:"notificationSound,omitempty"`
+ NotificationBadge *bool `json:"notificationBadge,omitempty"`
+ Localization *map[string]*CampaignLocalization `json:"localization,omitempty"`
+ Questions *[]PollQuestion `json:"questions,omitempty"`
+ ID *int32 `json:"id,omitempty"`
+ State CampaignStates `json:"state,omitempty"`
+ ActivatedDate *date.Time `json:"activatedDate,omitempty"`
+ FinishedDate *date.Time `json:"finishedDate,omitempty"`
+}
+
+// CampaignsListResult is the campaigns list result.
+type CampaignsListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]CampaignListResult `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// CampaignsListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client CampaignsListResult) CampaignsListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// CampaignState is
+type CampaignState struct {
+ autorest.Response `json:"-"`
+ State CampaignStates `json:"state,omitempty"`
+}
+
+// CampaignStateResult is
+type CampaignStateResult struct {
+ autorest.Response `json:"-"`
+ State CampaignStates `json:"state,omitempty"`
+ ID *int32 `json:"id,omitempty"`
+}
+
+// CampaignStatisticsResult is
+type CampaignStatisticsResult struct {
+ autorest.Response `json:"-"`
+ Queued *int32 `json:"queued,omitempty"`
+ Pushed *int32 `json:"pushed,omitempty"`
+ PushedNative *int32 `json:"pushed-native,omitempty"`
+ PushedNativeGoogle *int32 `json:"pushed-native-google,omitempty"`
+ PushedNativeAdm *int32 `json:"pushed-native-adm,omitempty"`
+ Delivered *int32 `json:"delivered,omitempty"`
+ Dropped *int32 `json:"dropped,omitempty"`
+ SystemNotificationDisplayed *int32 `json:"system-notification-displayed,omitempty"`
+ InAppNotificationDisplayed *int32 `json:"in-app-notification-displayed,omitempty"`
+ ContentDisplayed *int32 `json:"content-displayed,omitempty"`
+ SystemNotificationActioned *int32 `json:"system-notification-actioned,omitempty"`
+ SystemNotificationExited *int32 `json:"system-notification-exited,omitempty"`
+ InAppNotificationActioned *int32 `json:"in-app-notification-actioned,omitempty"`
+ InAppNotificationExited *int32 `json:"in-app-notification-exited,omitempty"`
+ ContentActioned *int32 `json:"content-actioned,omitempty"`
+ ContentExited *int32 `json:"content-exited,omitempty"`
+ Answers *map[string]map[string]interface{} `json:"answers,omitempty"`
+}
+
+// CampaignTestNewParameters is
+type CampaignTestNewParameters struct {
+ DeviceID *string `json:"deviceId,omitempty"`
+ Lang *string `json:"lang,omitempty"`
+ Data *Campaign `json:"data,omitempty"`
+}
+
+// CampaignTestSavedParameters is
+type CampaignTestSavedParameters struct {
+ DeviceID *string `json:"deviceId,omitempty"`
+ Lang *string `json:"lang,omitempty"`
+}
+
+// CarrierCountryCriterion is used to target devices based on their carrier
+// country.
+type CarrierCountryCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// CarrierNameCriterion is used to target devices based on their carrier name.
+type CarrierNameCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// Criterion is
+type Criterion struct {
+}
+
+// DatapushFeedbackCriterion is used to target devices who received a data
+// push.
+type DatapushFeedbackCriterion struct {
+ ContentID *int32 `json:"content-id,omitempty"`
+ Action CampaignFeedbacks `json:"action,omitempty"`
+}
+
+// DateRangeExportTaskParameter is
+type DateRangeExportTaskParameter struct {
+ ContainerURL *string `json:"containerUrl,omitempty"`
+ Description *string `json:"description,omitempty"`
+ StartDate *date.Date `json:"startDate,omitempty"`
+ EndDate *date.Date `json:"endDate,omitempty"`
+ ExportFormat ExportFormat `json:"exportFormat,omitempty"`
+}
+
+// DateTagCriterion is target devices based on a date tag value.
+type DateTagCriterion struct {
+ Name *string `json:"name,omitempty"`
+ Value *date.Date `json:"value,omitempty"`
+ Op AudienceOperators `json:"op,omitempty"`
+}
+
+// Device is
+type Device struct {
+ autorest.Response `json:"-"`
+ DeviceID *string `json:"deviceId,omitempty"`
+ Meta *DeviceMeta `json:"meta,omitempty"`
+ Info *DeviceInfo `json:"info,omitempty"`
+ Location *DeviceLocation `json:"location,omitempty"`
+ AppInfo *map[string]*string `json:"appInfo,omitempty"`
+}
+
+// DeviceInfo is
+type DeviceInfo struct {
+ PhoneModel *string `json:"phoneModel,omitempty"`
+ PhoneManufacturer *string `json:"phoneManufacturer,omitempty"`
+ FirmwareVersion *string `json:"firmwareVersion,omitempty"`
+ FirmwareName *string `json:"firmwareName,omitempty"`
+ AndroidAPILevel *int32 `json:"androidAPILevel,omitempty"`
+ CarrierCountry *string `json:"carrierCountry,omitempty"`
+ Locale *string `json:"locale,omitempty"`
+ CarrierName *string `json:"carrierName,omitempty"`
+ NetworkType *string `json:"networkType,omitempty"`
+ NetworkSubtype *string `json:"networkSubtype,omitempty"`
+ ApplicationVersionName *string `json:"applicationVersionName,omitempty"`
+ ApplicationVersionCode *int32 `json:"applicationVersionCode,omitempty"`
+ TimeZoneOffset *int32 `json:"timeZoneOffset,omitempty"`
+ ServiceVersion *string `json:"serviceVersion,omitempty"`
+}
+
+// DeviceLocation is
+type DeviceLocation struct {
+ Countrycode *string `json:"countrycode,omitempty"`
+ Region *string `json:"region,omitempty"`
+ Locality *string `json:"locality,omitempty"`
+}
+
+// DeviceManufacturerCriterion is used to target devices based on the device
+// manufacturer.
+type DeviceManufacturerCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// DeviceMeta is
+type DeviceMeta struct {
+ FirstSeen *int64 `json:"firstSeen,omitempty"`
+ LastSeen *int64 `json:"lastSeen,omitempty"`
+ LastInfo *int64 `json:"lastInfo,omitempty"`
+ LastLocation *int64 `json:"lastLocation,omitempty"`
+ NativePushEnabled *bool `json:"nativePushEnabled,omitempty"`
+}
+
+// DeviceModelCriterion is used to target devices based on the device model.
+type DeviceModelCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// DeviceQueryResult is
+type DeviceQueryResult struct {
+ DeviceID *string `json:"deviceId,omitempty"`
+ Meta *DeviceMeta `json:"meta,omitempty"`
+ AppInfo *map[string]*string `json:"appInfo,omitempty"`
+}
+
+// DevicesQueryResult is the campaigns list result.
+type DevicesQueryResult struct {
+ autorest.Response `json:"-"`
+ Value *[]DeviceQueryResult `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DevicesQueryResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client DevicesQueryResult) DevicesQueryResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// DeviceTagsParameters is
+type DeviceTagsParameters struct {
+ Tags *map[string]map[string]string `json:"tags,omitempty"`
+ DeleteOnNull *bool `json:"deleteOnNull,omitempty"`
+}
+
+// DeviceTagsResult is
+type DeviceTagsResult struct {
+ autorest.Response `json:"-"`
+ InvalidIds *[]string `json:"invalidIds,omitempty"`
+}
+
+// EngageActiveUsersFilter is send only to users who have used the app in the
+// last {threshold} days.
+type EngageActiveUsersFilter struct {
+ Threshold *int32 `json:"threshold,omitempty"`
+}
+
+// EngageIdleUsersFilter is send only to users who haven't used the app in the
+// last {threshold} days.
+type EngageIdleUsersFilter struct {
+ Threshold *int32 `json:"threshold,omitempty"`
+}
+
+// EngageNewUsersFilter is send only to users whose first app use is less than
+// {threshold} days old.
+type EngageNewUsersFilter struct {
+ Threshold *int32 `json:"threshold,omitempty"`
+}
+
+// EngageOldUsersFilter is send only to users whose first app use is more than
+// {threshold} days old.
+type EngageOldUsersFilter struct {
+ Threshold *int32 `json:"threshold,omitempty"`
+}
+
+// EngageSubsetFilter is send only to a maximum of max users.
+type EngageSubsetFilter struct {
+ Max *int32 `json:"max,omitempty"`
+}
+
+// ExportOptions is options to control export generation.
+type ExportOptions struct {
+ ExportUserID *bool `json:"exportUserId,omitempty"`
+}
+
+// ExportTaskListResult is gets a paged list of ExportTasks.
+type ExportTaskListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ExportTaskResult `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ExportTaskListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ExportTaskListResult) ExportTaskListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ExportTaskParameter is
+type ExportTaskParameter struct {
+ ContainerURL *string `json:"containerUrl,omitempty"`
+ Description *string `json:"description,omitempty"`
+ ExportFormat ExportFormat `json:"exportFormat,omitempty"`
+}
+
+// ExportTaskResult is
+type ExportTaskResult struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Description *string `json:"description,omitempty"`
+ State ExportState `json:"state,omitempty"`
+ DateCreated *date.Time `json:"dateCreated,omitempty"`
+ DateCompleted *date.Time `json:"dateCompleted,omitempty"`
+ ExportType ExportType `json:"exportType,omitempty"`
+ ErrorDetails *string `json:"errorDetails,omitempty"`
+}
+
+// FeedbackByCampaignParameter is
+type FeedbackByCampaignParameter struct {
+ ContainerURL *string `json:"containerUrl,omitempty"`
+ Description *string `json:"description,omitempty"`
+ CampaignType CampaignType `json:"campaignType,omitempty"`
+ CampaignIds *[]int32 `json:"campaignIds,omitempty"`
+ ExportFormat ExportFormat `json:"exportFormat,omitempty"`
+}
+
+// FeedbackByDateRangeParameter is
+type FeedbackByDateRangeParameter struct {
+ ContainerURL *string `json:"containerUrl,omitempty"`
+ Description *string `json:"description,omitempty"`
+ CampaignType CampaignType `json:"campaignType,omitempty"`
+ CampaignWindowStart *date.Time `json:"campaignWindowStart,omitempty"`
+ CampaignWindowEnd *date.Time `json:"campaignWindowEnd,omitempty"`
+ ExportFormat ExportFormat `json:"exportFormat,omitempty"`
+}
+
+// Filter is
+type Filter struct {
+}
+
+// FirmwareVersionCriterion is used to target devices based on their firmware
+// version.
+type FirmwareVersionCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// GeoFencingCriterion is used to target devices based on a specific region. A
+// center point (defined by a latitude and longitude) and a radius form the
+// boundary for the region. This criterion will be met when the user crosses
+// the boundaries of the region.
+type GeoFencingCriterion struct {
+ Lat *float64 `json:"lat,omitempty"`
+ Lon *float64 `json:"lon,omitempty"`
+ Radius *int32 `json:"radius,omitempty"`
+ Expiration *int32 `json:"expiration,omitempty"`
+}
+
+// ImportTask is
+type ImportTask struct {
+ StorageURL *string `json:"storageUrl,omitempty"`
+}
+
+// ImportTaskListResult is gets a paged list of import tasks.
+type ImportTaskListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ImportTaskResult `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ImportTaskListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ImportTaskListResult) ImportTaskListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ImportTaskResult is
+type ImportTaskResult struct {
+ autorest.Response `json:"-"`
+ StorageURL *string `json:"storageUrl,omitempty"`
+ ID *string `json:"id,omitempty"`
+ State JobStates `json:"state,omitempty"`
+ DateCreated *date.Time `json:"dateCreated,omitempty"`
+ DateCompleted *date.Time `json:"dateCompleted,omitempty"`
+ ErrorDetails *string `json:"errorDetails,omitempty"`
+}
+
+// IntegerTagCriterion is target devices based on an integer tag value.
+type IntegerTagCriterion struct {
+ Name *string `json:"name,omitempty"`
+ Value *int32 `json:"value,omitempty"`
+ Op AudienceOperators `json:"op,omitempty"`
+}
+
+// LanguageCriterion is used to target devices based on the language of their
+// device.
+type LanguageCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// LocationCriterion is used to target devices based on their last know area.
+type LocationCriterion struct {
+ Country *string `json:"country,omitempty"`
+ Region *string `json:"region,omitempty"`
+ Locality *string `json:"locality,omitempty"`
+}
+
+// NativePushEnabledFilter is engage only users with native push enabled.
+type NativePushEnabledFilter struct {
+}
+
+// NetworkTypeCriterion is used to target devices based their network type.
+type NetworkTypeCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// NotificationOptions is
+type NotificationOptions struct {
+ BigText *string `json:"bigText,omitempty"`
+ BigPicture *string `json:"bigPicture,omitempty"`
+ Sound *string `json:"sound,omitempty"`
+ ActionText *string `json:"actionText,omitempty"`
+}
+
+// PollAnswerFeedbackCriterion is used to target devices who answered X to a
+// given question.
+type PollAnswerFeedbackCriterion struct {
+ ContentID *int32 `json:"content-id,omitempty"`
+ ChoiceID *int32 `json:"choice-id,omitempty"`
+}
+
+// PollFeedbackCriterion is used to target devices who received a poll.
+type PollFeedbackCriterion struct {
+ ContentID *int32 `json:"content-id,omitempty"`
+ Action CampaignFeedbacks `json:"action,omitempty"`
+}
+
+// PollQuestion is
+type PollQuestion struct {
+ Title *string `json:"title,omitempty"`
+ ID *int32 `json:"id,omitempty"`
+ Localization *map[string]*PollQuestionLocalization `json:"localization,omitempty"`
+ Choices *[]PollQuestionChoice `json:"choices,omitempty"`
+}
+
+// PollQuestionChoice is
+type PollQuestionChoice struct {
+ Title *string `json:"title,omitempty"`
+ ID *int32 `json:"id,omitempty"`
+ Localization *map[string]*PollQuestionChoiceLocalization `json:"localization,omitempty"`
+ IsDefault *bool `json:"isDefault,omitempty"`
+}
+
+// PollQuestionChoiceLocalization is
+type PollQuestionChoiceLocalization struct {
+ Title *string `json:"title,omitempty"`
+}
+
+// PollQuestionLocalization is
+type PollQuestionLocalization struct {
+ Title *string `json:"title,omitempty"`
+}
+
+// PushQuotaFilter is engage only users for whom the push quota is not reached.
+type PushQuotaFilter struct {
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ScreenSizeCriterion is used to target devices based on the screen
+// resolution of their device.
+type ScreenSizeCriterion struct {
+ Name *string `json:"name,omitempty"`
+}
+
+// SegmentCriterion is target devices based on an existing segment.
+type SegmentCriterion struct {
+ ID *int32 `json:"id,omitempty"`
+ Exclude *bool `json:"exclude,omitempty"`
+}
+
+// StringTagCriterion is target devices based on a string tag value.
+type StringTagCriterion struct {
+ Name *string `json:"name,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// SupportedPlatformsListResult is
+type SupportedPlatformsListResult struct {
+ autorest.Response `json:"-"`
+ Platforms *[]string `json:"platforms,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/supportedplatforms.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/supportedplatforms.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/supportedplatforms.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/supportedplatforms.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,101 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// SupportedPlatformsClient is the microsoft Azure Mobile Engagement REST
+// APIs.
+type SupportedPlatformsClient struct {
+ ManagementClient
+}
+
+// NewSupportedPlatformsClient creates an instance of the
+// SupportedPlatformsClient client.
+func NewSupportedPlatformsClient(subscriptionID string, resourceGroupName string, appCollection string, appName string) SupportedPlatformsClient {
+ return NewSupportedPlatformsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, appCollection, appName)
+}
+
+// NewSupportedPlatformsClientWithBaseURI creates an instance of the
+// SupportedPlatformsClient client.
+func NewSupportedPlatformsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, appCollection string, appName string) SupportedPlatformsClient {
+ return SupportedPlatformsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, appCollection, appName)}
+}
+
+// List lists supported platforms for Engagement applications.
+func (client SupportedPlatformsClient) List() (result SupportedPlatformsListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "mobileengagement.SupportedPlatformsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client SupportedPlatformsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/supportedPlatforms", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client SupportedPlatformsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client SupportedPlatformsClient) ListResponder(resp *http.Response) (result SupportedPlatformsListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/mobileengagement/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package mobileengagement
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "mobileengagement", "2014-12-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ApplicationGatewaysClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// ApplicationGatewaysClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type ApplicationGatewaysClient struct {
ManagementClient
@@ -46,122 +46,128 @@
}
// CreateOrUpdate the Put ApplicationGateway operation creates/updates a
-// ApplicationGateway
+// ApplicationGateway This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the ApplicationGateway. parameters is parameters supplied
// to the create/delete ApplicationGateway operation
-func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (result ApplicationGateway, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, applicationGatewayName, parameters)
+func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, applicationGatewayName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (*http.Request, error) {
+func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "applicationGatewayName": url.QueryEscape(applicationGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "applicationGatewayName": autorest.Encode("path", applicationGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGateway, err error) {
+func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete applicationgateway operation deletes the specified
-// applicationgateway.
+// applicationgateway. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the applicationgateway.
-func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applicationGatewayName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, applicationGatewayName)
+func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, applicationGatewayName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client ApplicationGatewaysClient) DeletePreparer(resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
+func (client ApplicationGatewaysClient) DeletePreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "applicationGatewayName": url.QueryEscape(applicationGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "applicationGatewayName": autorest.Encode("path", applicationGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +176,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusNoContent, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -181,21 +187,21 @@
//
// resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the applicationgateway.
-func (client ApplicationGatewaysClient) Get(resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, ae error) {
+func (client ApplicationGatewaysClient) Get(resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) {
req, err := client.GetPreparer(resourceGroupName, applicationGatewayName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure responding to request")
}
return
@@ -204,28 +210,27 @@
// GetPreparer prepares the Get request.
func (client ApplicationGatewaysClient) GetPreparer(resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "applicationGatewayName": url.QueryEscape(applicationGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "applicationGatewayName": autorest.Encode("path", applicationGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -234,7 +239,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -245,21 +250,21 @@
// applicationgateways in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client ApplicationGatewaysClient) List(resourceGroupName string) (result ApplicationGatewayListResult, ae error) {
+func (client ApplicationGatewaysClient) List(resourceGroupName string) (result ApplicationGatewayListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to request")
}
return
@@ -268,27 +273,26 @@
// ListPreparer prepares the List request.
func (client ApplicationGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -297,7 +301,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -305,10 +309,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, ae error) {
+func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) {
req, err := lastResults.ApplicationGatewayListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -317,12 +321,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -330,21 +334,21 @@
// ListAll the List applicationgateway opertion retrieves all the
// applicationgateways in a subscription.
-func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, ae error) {
+func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -353,26 +357,25 @@
// ListAllPreparer prepares the ListAll request.
func (client ApplicationGatewaysClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -381,7 +384,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -389,10 +392,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client ApplicationGatewaysClient) ListAllNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, ae error) {
+func (client ApplicationGatewaysClient) ListAllNextResults(lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) {
req, err := lastResults.ApplicationGatewayListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -401,67 +404,71 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to next results request request")
}
return
}
// Start the Start ApplicationGateway operation starts application gatewayin
-// the specified resource group through Network resource provider.
+// the specified resource group through Network resource provider. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway.
-func (client ApplicationGatewaysClient) Start(resourceGroupName string, applicationGatewayName string) (result autorest.Response, ae error) {
- req, err := client.StartPreparer(resourceGroupName, applicationGatewayName)
+func (client ApplicationGatewaysClient) Start(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StartPreparer(resourceGroupName, applicationGatewayName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Start", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", nil, "Failure preparing request")
}
resp, err := client.StartSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Start", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", resp, "Failure sending request")
}
result, err = client.StartResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Start", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", resp, "Failure responding to request")
}
return
}
// StartPreparer prepares the Start request.
-func (client ApplicationGatewaysClient) StartPreparer(resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
+func (client ApplicationGatewaysClient) StartPreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "applicationGatewayName": url.QueryEscape(applicationGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "applicationGatewayName": autorest.Encode("path", applicationGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) StartSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// StartResponder handles the response to the Start request. The method always
@@ -470,62 +477,66 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Stop the STOP ApplicationGateway operation stops application gatewayin the
-// specified resource group through Network resource provider.
+// specified resource group through Network resource provider. This method
+// may poll for completion. Polling can be canceled by passing the cancel
+// channel argument. The channel will be used to cancel polling and any
+// outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway.
-func (client ApplicationGatewaysClient) Stop(resourceGroupName string, applicationGatewayName string) (result autorest.Response, ae error) {
- req, err := client.StopPreparer(resourceGroupName, applicationGatewayName)
+func (client ApplicationGatewaysClient) Stop(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.StopPreparer(resourceGroupName, applicationGatewayName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Stop", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", nil, "Failure preparing request")
}
resp, err := client.StopSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Stop", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", resp, "Failure sending request")
}
result, err = client.StopResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ApplicationGatewaysClient", "Stop", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", resp, "Failure responding to request")
}
return
}
// StopPreparer prepares the Stop request.
-func (client ApplicationGatewaysClient) StopPreparer(resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
+func (client ApplicationGatewaysClient) StopPreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "applicationGatewayName": url.QueryEscape(applicationGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "applicationGatewayName": autorest.Encode("path", applicationGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StopSender sends the Stop request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewaysClient) StopSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// StopResponder handles the response to the Stop request. The method always
@@ -534,7 +545,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,10 @@
+// Package network implements the Azure ARM Network service API version
+// 2016-03-30.
+//
+// The Microsoft Azure Network management API provides a RESTful set of web
+// services that interact with Microsoft Azure Networks service to manage
+// your network resrources. The API has entities that capture the
+// relationship between an end user and the Microsoft Azure Networks service.
package network
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,32 +21,29 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
const (
// APIVersion is the version of the Network
- APIVersion = "2015-05-01-preview"
+ APIVersion = "2016-03-30"
// DefaultBaseURI is the default URI used for the service Network
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the the Windows Azure Network management API provides a
-// RESTful set of web services that interact with Windows Azure Networks
-// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
-// Networks service.
+// ManagementClient is the base client for Network.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -53,6 +57,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
@@ -63,21 +68,21 @@
// location is the location of the domain name domainNameLabel is the domain
// name to be verified. It must conform to the following regular expression:
// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
-func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, ae error) {
+func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) {
req, err := client.CheckDNSNameAvailabilityPreparer(location, domainNameLabel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ManagementClient", "CheckDNSNameAvailability", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ManagementClient", "CheckDNSNameAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckDNSNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ManagementClient", "CheckDNSNameAvailability", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ManagementClient", "CheckDNSNameAvailability", resp, "Failure sending request")
}
result, err = client.CheckDNSNameAvailabilityResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ManagementClient", "CheckDNSNameAvailability", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ManagementClient", "CheckDNSNameAvailability", resp, "Failure responding to request")
}
return
@@ -86,30 +91,29 @@
// CheckDNSNameAvailabilityPreparer prepares the CheckDNSNameAvailability request.
func (client ManagementClient) CheckDNSNameAvailabilityPreparer(location string, domainNameLabel string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(domainNameLabel) > 0 {
- queryParameters["domainNameLabel"] = domainNameLabel
+ queryParameters["domainNameLabel"] = autorest.Encode("query", domainNameLabel)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CheckDNSNameAvailabilitySender sends the CheckDNSNameAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) CheckDNSNameAvailabilitySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CheckDNSNameAvailabilityResponder handles the response to the CheckDNSNameAvailability request. The method always
@@ -118,7 +122,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ExpressRouteCircuitAuthorizationsClient is the the Windows Azure Network
+// ExpressRouteCircuitAuthorizationsClient is the the Microsoft Azure Network
// management API provides a RESTful set of web services that interact with
-// Windows Azure Networks service to manage your network resrources. The API
-// has entities that capture the relationship between an end user and the
-// Windows Azure Networks service.
+// Microsoft Azure Networks service to manage your network resrources. The
+// API has entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type ExpressRouteCircuitAuthorizationsClient struct {
ManagementClient
}
@@ -46,126 +46,134 @@
}
// CreateOrUpdate the Put Authorization operation creates/updates an
-// authorization in thespecified ExpressRouteCircuits
+// authorization in thespecified ExpressRouteCircuits This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the
// authorization. authorizationParameters is parameters supplied to the
// create/update ExpressRouteCircuitAuthorization operation
-func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorization, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, authorizationName, authorizationParameters)
+func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, authorizationName, authorizationParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (*http.Request, error) {
+func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "authorizationName": url.QueryEscape(authorizationName),
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "authorizationName": autorest.Encode("path", authorizationName),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithJSON(authorizationParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) {
+func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete authorization operation deletes the specified
-// authorization from the specified ExpressRouteCircuit.
+// authorization from the specified ExpressRouteCircuit. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the
// authorization.
-func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName string, circuitName string, authorizationName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, circuitName, authorizationName)
+func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, circuitName, authorizationName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) {
+func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "authorizationName": url.QueryEscape(authorizationName),
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "authorizationName": autorest.Encode("path", authorizationName),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -174,7 +182,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -186,21 +194,21 @@
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the
// authorization.
-func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, ae error) {
+func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName, authorizationName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure responding to request")
}
return
@@ -209,29 +217,28 @@
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "authorizationName": url.QueryEscape(authorizationName),
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "authorizationName": autorest.Encode("path", authorizationName),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -240,7 +247,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -252,21 +259,21 @@
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the curcuit.
-func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, ae error) {
+func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, circuitName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to request")
}
return
@@ -275,28 +282,27 @@
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -305,7 +311,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -313,10 +319,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResults AuthorizationListResult) (result AuthorizationListResult, ae error) {
+func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResults AuthorizationListResult) (result AuthorizationListResult, err error) {
req, err := lastResults.AuthorizationListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -325,12 +331,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitAuthorizationsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ExpressRouteCircuitPeeringsClient is the the Windows Azure Network
+// ExpressRouteCircuitPeeringsClient is the the Microsoft Azure Network
// management API provides a RESTful set of web services that interact with
-// Windows Azure Networks service to manage your network resrources. The API
-// has entities that capture the relationship between an end user and the
-// Windows Azure Networks service.
+// Microsoft Azure Networks service to manage your network resrources. The
+// API has entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type ExpressRouteCircuitPeeringsClient struct {
ManagementClient
}
@@ -46,125 +46,131 @@
}
// CreateOrUpdate the Put Pering operation creates/updates an peering in the
-// specified ExpressRouteCircuits
+// specified ExpressRouteCircuits This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering.
// peeringParameters is parameters supplied to the create/update
// ExpressRouteCircuit Peering operation
-func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (result ExpressRouteCircuitPeering, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, peeringName, peeringParameters)
+func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, peeringName, peeringParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (*http.Request, error) {
+func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "peeringName": url.QueryEscape(peeringName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithJSON(peeringParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) {
+func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete peering operation deletes the specified peering from the
-// ExpressRouteCircuit.
+// ExpressRouteCircuit. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering.
-func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, circuitName string, peeringName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, circuitName, peeringName)
+func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, circuitName string, peeringName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, circuitName, peeringName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) {
+func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName string, circuitName string, peeringName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "peeringName": url.QueryEscape(peeringName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -173,7 +179,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -184,21 +190,21 @@
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering.
-func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, ae error) {
+func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName, peeringName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure responding to request")
}
return
@@ -207,29 +213,28 @@
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitPeeringsClient) GetPreparer(resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "peeringName": url.QueryEscape(peeringName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -238,7 +243,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -250,21 +255,21 @@
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the curcuit.
-func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, ae error) {
+func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, circuitName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to request")
}
return
@@ -273,28 +278,27 @@
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitPeeringsClient) ListPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -303,7 +307,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -311,10 +315,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults ExpressRouteCircuitPeeringListResult) (result ExpressRouteCircuitPeeringListResult, ae error) {
+func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults ExpressRouteCircuitPeeringListResult) (result ExpressRouteCircuitPeeringListResult, err error) {
req, err := lastResults.ExpressRouteCircuitPeeringListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -323,12 +327,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitPeeringsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ExpressRouteCircuitsClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
-// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
-// Networks service.
+// ExpressRouteCircuitsClient is the the Microsoft Azure Network management
+// API provides a RESTful set of web services that interact with Microsoft
+// Azure Networks service to manage your network resrources. The API has
+// entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type ExpressRouteCircuitsClient struct {
ManagementClient
}
@@ -46,122 +46,128 @@
}
// CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a
-// ExpressRouteCircuit
+// ExpressRouteCircuit This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. parameters is parameters supplied to the
// create/delete ExpressRouteCircuit operation
-func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (result ExpressRouteCircuit, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, parameters)
+func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (*http.Request, error) {
+func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuit, err error) {
+func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete ExpressRouteCircuit operation deletes the specified
-// ExpressRouteCircuit.
+// ExpressRouteCircuit. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the express route Circuit.
-func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, circuitName)
+func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, circuitName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client ExpressRouteCircuitsClient) DeletePreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
+func (client ExpressRouteCircuitsClient) DeletePreparer(resourceGroupName string, circuitName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +176,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -181,21 +187,21 @@
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit.
-func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, ae error) {
+func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure responding to request")
}
return
@@ -204,28 +210,27 @@
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitsClient) GetPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -234,7 +239,136 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetPeeringStats the Liststats ExpressRouteCircuit opertion retrieves all
+// the stats from a ExpressRouteCircuits in a resource group.
+//
+// resourceGroupName is the name of the resource group. circuitName is the
+// name of the circuit. peeringName is the name of the peering.
+func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) {
+ req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetPeeringStatsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure sending request")
+ }
+
+ result, err = client.GetPeeringStatsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPeeringStatsPreparer prepares the GetPeeringStats request.
+func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "circuitName": autorest.Encode("path", circuitName),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetPeeringStatsSender sends the GetPeeringStats request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetPeeringStatsResponder handles the response to the GetPeeringStats request. The method always
+// closes the http.Response Body.
+func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetStats the Liststats ExpressRouteCircuit opertion retrieves all the stats
+// from a ExpressRouteCircuits in a resource group.
+//
+// resourceGroupName is the name of the resource group. circuitName is the
+// name of the circuit.
+func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) {
+ req, err := client.GetStatsPreparer(resourceGroupName, circuitName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetStatsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure sending request")
+ }
+
+ result, err = client.GetStatsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetStatsPreparer prepares the GetStats request.
+func (client ExpressRouteCircuitsClient) GetStatsPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "circuitName": autorest.Encode("path", circuitName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetStatsSender sends the GetStats request. The method will close the
+// http.Response Body if it receives an error.
+func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetStatsResponder handles the response to the GetStats request. The method always
+// closes the http.Response Body.
+func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -245,21 +379,21 @@
// ExpressRouteCircuits in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result ExpressRouteCircuitListResult, ae error) {
+func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result ExpressRouteCircuitListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to request")
}
return
@@ -268,27 +402,26 @@
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -297,7 +430,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -305,10 +438,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, ae error) {
+func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) {
req, err := lastResults.ExpressRouteCircuitListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -317,12 +450,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -330,21 +463,21 @@
// ListAll the List ExpressRouteCircuit opertion retrieves all the
// ExpressRouteCircuits in a subscription.
-func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, ae error) {
+func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -353,26 +486,25 @@
// ListAllPreparer prepares the ListAll request.
func (client ExpressRouteCircuitsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -381,7 +513,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -389,10 +521,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, ae error) {
+func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) {
req, err := lastResults.ExpressRouteCircuitListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -401,12 +533,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to next results request request")
}
return
@@ -414,269 +546,216 @@
// ListArpTable the ListArpTable from ExpressRouteCircuit opertion retrieves
// the currently advertised arp table associated with the
-// ExpressRouteCircuits in a resource group.
+// ExpressRouteCircuits in a resource group. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
-// name of the circuit.
-func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsArpTableListResult, ae error) {
- req, err := client.ListArpTablePreparer(resourceGroupName, circuitName)
+// name of the circuit. peeringName is the name of the peering. devicePath is
+// the path of the device.
+func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ListArpTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure preparing request")
}
resp, err := client.ListArpTableSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", resp, "Failure sending request")
}
result, err = client.ListArpTableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", resp, "Failure responding to request")
}
return
}
// ListArpTablePreparer prepares the ListArpTable request.
-func (client ExpressRouteCircuitsClient) ListArpTablePreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
+func (client ExpressRouteCircuitsClient) ListArpTablePreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "devicePath": autorest.Encode("path", devicePath),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}arpTable"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListArpTableSender sends the ListArpTable request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListArpTableResponder handles the response to the ListArpTable request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) {
+func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListArpTableNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitsClient) ListArpTableNextResults(lastResults ExpressRouteCircuitsArpTableListResult) (result ExpressRouteCircuitsArpTableListResult, ae error) {
- req, err := lastResults.ExpressRouteCircuitsArpTableListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListArpTableSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure sending next results request request")
- }
-
- result, err = client.ListArpTableResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListArpTable", "Failure responding to next results request request")
- }
-
+ result.Response = resp
return
}
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit opertion
// retrieves the currently advertised routes table associated with the
-// ExpressRouteCircuits in a resource group.
+// ExpressRouteCircuits in a resource group. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
-// name of the circuit.
-func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsRoutesTableListResult, ae error) {
- req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName)
+// name of the circuit. peeringName is the name of the peering. devicePath is
+// the path of the device.
+func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure preparing request")
}
resp, err := client.ListRoutesTableSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", resp, "Failure sending request")
}
result, err = client.ListRoutesTableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", resp, "Failure responding to request")
}
return
}
// ListRoutesTablePreparer prepares the ListRoutesTable request.
-func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
+func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "devicePath": autorest.Encode("path", devicePath),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}routesTable"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListRoutesTableSender sends the ListRoutesTable request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) {
+func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListRoutesTableNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitsClient) ListRoutesTableNextResults(lastResults ExpressRouteCircuitsRoutesTableListResult) (result ExpressRouteCircuitsRoutesTableListResult, ae error) {
- req, err := lastResults.ExpressRouteCircuitsRoutesTableListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListRoutesTableSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure sending next results request request")
- }
-
- result, err = client.ListRoutesTableResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListRoutesTable", "Failure responding to next results request request")
- }
-
+ result.Response = resp
return
}
-// ListStats the Liststats ExpressRouteCircuit opertion retrieves all the
-// stats from a ExpressRouteCircuits in a resource group.
+// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit
+// opertion retrieves the currently advertised routes table associated with
+// the ExpressRouteCircuits in a resource group. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
-// name of the loadBalancer.
-func (client ExpressRouteCircuitsClient) ListStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsStatsListResult, ae error) {
- req, err := client.ListStatsPreparer(resourceGroupName, circuitName)
+// name of the circuit. peeringName is the name of the peering. devicePath is
+// the path of the device.
+func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ListRoutesTableSummaryPreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure preparing request")
}
- resp, err := client.ListStatsSender(req)
+ resp, err := client.ListRoutesTableSummarySender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", resp, "Failure sending request")
}
- result, err = client.ListStatsResponder(resp)
+ result, err = client.ListRoutesTableSummaryResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", resp, "Failure responding to request")
}
return
}
-// ListStatsPreparer prepares the ListStats request.
-func (client ExpressRouteCircuitsClient) ListStatsPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
+// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request.
+func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "circuitName": url.QueryEscape(circuitName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "circuitName": autorest.Encode("path", circuitName),
+ "devicePath": autorest.Encode("path", devicePath),
+ "peeringName": autorest.Encode("path", peeringName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}stats"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
-// ListStatsSender sends the ListStats request. The method will close the
+// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the
// http.Response Body if it receives an error.
-func (client ExpressRouteCircuitsClient) ListStatsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
-// ListStatsResponder handles the response to the ListStats request. The method always
+// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always
// closes the http.Response Body.
-func (client ExpressRouteCircuitsClient) ListStatsResponder(resp *http.Response) (result ExpressRouteCircuitsStatsListResult, err error) {
+func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListStatsNextResults retrieves the next set of results, if any.
-func (client ExpressRouteCircuitsClient) ListStatsNextResults(lastResults ExpressRouteCircuitsStatsListResult) (result ExpressRouteCircuitsStatsListResult, ae error) {
- req, err := lastResults.ExpressRouteCircuitsStatsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListStatsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure sending next results request request")
- }
-
- result, err = client.ListStatsResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteCircuitsClient", "ListStats", "Failure responding to next results request request")
- }
-
+ result.Response = resp
return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// ExpressRouteServiceProvidersClient is the the Windows Azure Network
+// ExpressRouteServiceProvidersClient is the the Microsoft Azure Network
// management API provides a RESTful set of web services that interact with
-// Windows Azure Networks service to manage your network resrources. The API
-// has entities that capture the relationship between an end user and the
-// Windows Azure Networks service.
+// Microsoft Azure Networks service to manage your network resrources. The
+// API has entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type ExpressRouteServiceProvidersClient struct {
ManagementClient
}
@@ -47,21 +47,21 @@
// List the List ExpressRouteServiceProvider opertion retrieves all the
// available ExpressRouteServiceProviders.
-func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, ae error) {
+func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to request")
}
return
@@ -70,26 +70,25 @@
// ListPreparer prepares the List request.
func (client ExpressRouteServiceProvidersClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteServiceProvidersClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -98,7 +97,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -106,10 +105,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults ExpressRouteServiceProviderListResult) (result ExpressRouteServiceProviderListResult, ae error) {
+func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults ExpressRouteServiceProviderListResult) (result ExpressRouteServiceProviderListResult, err error) {
req, err := lastResults.ExpressRouteServiceProviderListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -118,12 +117,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/ExpressRouteServiceProvidersClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// InterfacesClient is the the Windows Azure Network management API provides a
-// RESTful set of web services that interact with Windows Azure Networks
+// InterfacesClient is the the Microsoft Azure Network management API provides
+// a RESTful set of web services that interact with Microsoft Azure Networks
// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
+// capture the relationship between an end user and the Microsoft Azure
// Networks service.
type InterfacesClient struct {
ManagementClient
@@ -45,122 +45,128 @@
}
// CreateOrUpdate the Put NetworkInterface operation creates/updates a
-// networkInterface
+// networkInterface This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. parameters is parameters supplied to
// the create/update NetworkInterface operation
-func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface) (result Interface, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkInterfaceName, parameters)
+func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkInterfaceName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client InterfacesClient) CreateOrUpdatePreparer(resourceGroupName string, networkInterfaceName string, parameters Interface) (*http.Request, error) {
+func (client InterfacesClient) CreateOrUpdatePreparer(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkInterfaceName": url.QueryEscape(networkInterfaceName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkInterfaceName": autorest.Encode("path", networkInterfaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) {
+func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete netwokInterface operation deletes the specified
-// netwokInterface.
+// netwokInterface. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface.
-func (client InterfacesClient) Delete(resourceGroupName string, networkInterfaceName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, networkInterfaceName)
+func (client InterfacesClient) Delete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, networkInterfaceName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client InterfacesClient) DeletePreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) {
+func (client InterfacesClient) DeletePreparer(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkInterfaceName": url.QueryEscape(networkInterfaceName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkInterfaceName": autorest.Encode("path", networkInterfaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -169,7 +175,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -179,52 +185,55 @@
// specified network interface.
//
// resourceGroupName is the name of the resource group. networkInterfaceName
-// is the name of the network interface.
-func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string) (result Interface, ae error) {
- req, err := client.GetPreparer(resourceGroupName, networkInterfaceName)
+// is the name of the network interface. expand is expand references
+// resources.
+func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) {
+ req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client InterfacesClient) GetPreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) {
+func (client InterfacesClient) GetPreparer(resourceGroupName string, networkInterfaceName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkInterfaceName": url.QueryEscape(networkInterfaceName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkInterfaceName": autorest.Encode("path", networkInterfaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -233,7 +242,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,54 +256,56 @@
// resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set.
// virtualmachineIndex is the virtual machine index. networkInterfaceName is
-// the name of the network interface.
-func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string) (result Interface, ae error) {
- req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName)
+// the name of the network interface. expand is expand references resources.
+func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) {
+ req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", nil, "Failure preparing request")
}
resp, err := client.GetVirtualMachineScaleSetNetworkInterfaceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure sending request")
}
result, err = client.GetVirtualMachineScaleSetNetworkInterfaceResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure responding to request")
}
return
}
// GetVirtualMachineScaleSetNetworkInterfacePreparer prepares the GetVirtualMachineScaleSetNetworkInterface request.
-func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string) (*http.Request, error) {
+func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkInterfaceName": url.QueryEscape(networkInterfaceName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualmachineIndex": url.QueryEscape(virtualmachineIndex),
- "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
+ "networkInterfaceName": autorest.Encode("path", networkInterfaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex),
+ "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetVirtualMachineScaleSetNetworkInterfaceSender sends the GetVirtualMachineScaleSetNetworkInterface request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetVirtualMachineScaleSetNetworkInterfaceResponder handles the response to the GetVirtualMachineScaleSetNetworkInterface request. The method always
@@ -303,7 +314,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -314,21 +325,21 @@
// networkInterfaces in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to request")
}
return
@@ -337,27 +348,26 @@
// ListPreparer prepares the List request.
func (client InterfacesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -366,7 +376,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -374,10 +384,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) {
req, err := lastResults.InterfaceListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -386,12 +396,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -399,21 +409,21 @@
// ListAll the List networkInterfaces opertion retrieves all the
// networkInterfaces in a subscription.
-func (client InterfacesClient) ListAll() (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -422,26 +432,25 @@
// ListAllPreparer prepares the ListAll request.
func (client InterfacesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -450,7 +459,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -458,10 +467,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) {
req, err := lastResults.InterfaceListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -470,12 +479,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to next results request request")
}
return
@@ -487,21 +496,21 @@
//
// resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set.
-func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResult, err error) {
req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing request")
}
resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending request")
}
result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to request")
}
return
@@ -510,28 +519,27 @@
// ListVirtualMachineScaleSetNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetNetworkInterfaces request.
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListVirtualMachineScaleSetNetworkInterfacesSender sends the ListVirtualMachineScaleSetNetworkInterfaces request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListVirtualMachineScaleSetNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetNetworkInterfaces request. The method always
@@ -540,7 +548,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -548,10 +556,10 @@
}
// ListVirtualMachineScaleSetNetworkInterfacesNextResults retrieves the next set of results, if any.
-func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) {
req, err := lastResults.InterfaceListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -560,12 +568,12 @@
resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending next results request request")
}
result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to next results request request")
}
return
@@ -578,21 +586,21 @@
// resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set.
// virtualmachineIndex is the virtual machine index.
-func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResult, err error) {
req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing request")
}
resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending request")
}
result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to request")
}
return
@@ -601,29 +609,28 @@
// ListVirtualMachineScaleSetVMNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetVMNetworkInterfaces request.
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualmachineIndex": url.QueryEscape(virtualmachineIndex),
- "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex),
+ "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListVirtualMachineScaleSetVMNetworkInterfacesSender sends the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method will close the
// http.Response Body if it receives an error.
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListVirtualMachineScaleSetVMNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method always
@@ -632,7 +639,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -640,10 +647,10 @@
}
// ListVirtualMachineScaleSetVMNetworkInterfacesNextResults retrieves the next set of results, if any.
-func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
+func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) {
req, err := lastResults.InterfaceListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -652,12 +659,12 @@
resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending next results request request")
}
result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// LoadBalancersClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// LoadBalancersClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type LoadBalancersClient struct {
ManagementClient
@@ -45,121 +45,129 @@
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
-// CreateOrUpdate the Put LoadBalancer operation creates/updates a LoadBalancer
+// CreateOrUpdate the Put LoadBalancer operation creates/updates a
+// LoadBalancer This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. loadBalancerName is
// the name of the loadBalancer. parameters is parameters supplied to the
// create/delete LoadBalancer operation
-func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancer, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, parameters)
+func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (*http.Request, error) {
+func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "loadBalancerName": url.QueryEscape(loadBalancerName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "loadBalancerName": autorest.Encode("path", loadBalancerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) {
+func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// Delete the delete loadbalancer operation deletes the specified loadbalancer.
+// Delete the delete loadbalancer operation deletes the specified
+// loadbalancer. This method may poll for completion. Polling can be canceled
+// by passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. loadBalancerName is
// the name of the loadBalancer.
-func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, loadBalancerName)
+func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, loadBalancerName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) {
+func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "loadBalancerName": url.QueryEscape(loadBalancerName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "loadBalancerName": autorest.Encode("path", loadBalancerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -168,7 +176,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -178,52 +186,54 @@
// specified network interface.
//
// resourceGroupName is the name of the resource group. loadBalancerName is
-// the name of the loadBalancer.
-func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string) (result LoadBalancer, ae error) {
- req, err := client.GetPreparer(resourceGroupName, loadBalancerName)
+// the name of the loadBalancer. expand is expand references resources.
+func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) {
+ req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) {
+func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "loadBalancerName": url.QueryEscape(loadBalancerName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "loadBalancerName": autorest.Encode("path", loadBalancerName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -232,7 +242,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -243,21 +253,21 @@
// resource group.
//
// resourceGroupName is the name of the resource group.
-func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBalancerListResult, ae error) {
+func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBalancerListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request")
}
return
@@ -266,27 +276,26 @@
// ListPreparer prepares the List request.
func (client LoadBalancersClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -295,7 +304,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -303,10 +312,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, ae error) {
+func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) {
req, err := lastResults.LoadBalancerListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -315,12 +324,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -328,21 +337,21 @@
// ListAll the List loadBalancer opertion retrieves all the loadbalancers in a
// subscription.
-func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, ae error) {
+func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -351,26 +360,25 @@
// ListAllPreparer prepares the ListAll request.
func (client LoadBalancersClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -379,7 +387,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -387,10 +395,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, ae error) {
+func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) {
req, err := lastResults.LoadBalancerListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -399,12 +407,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LoadBalancersClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// LocalNetworkGatewaysClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
-// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
-// Networks service.
+// LocalNetworkGatewaysClient is the the Microsoft Azure Network management
+// API provides a RESTful set of web services that interact with Microsoft
+// Azure Networks service to manage your network resrources. The API has
+// entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type LocalNetworkGatewaysClient struct {
ManagementClient
}
@@ -47,123 +47,130 @@
// CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a
// local network gateway in the specified resource group through Network
-// resource provider.
+// resource provider. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// localNetworkGatewayName is the name of the local network gateway.
// parameters is parameters supplied to the Begin Create or update Local
// Network Gateway operation through Network resource provider.
-func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (result LocalNetworkGateway, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, localNetworkGatewayName, parameters)
+func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, localNetworkGatewayName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (*http.Request, error) {
+func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result LocalNetworkGateway, err error) {
+func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete LocalNetworkGateway operation deletes the specifed local
-// network Gateway through Network resource provider.
+// network Gateway through Network resource provider. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group.
// localNetworkGatewayName is the name of the local network gateway.
-func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localNetworkGatewayName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, localNetworkGatewayName)
+func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, localNetworkGatewayName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) {
+func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -172,7 +179,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
@@ -183,21 +190,21 @@
//
// resourceGroupName is the name of the resource group.
// localNetworkGatewayName is the name of the local network gateway.
-func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, ae error) {
+func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) {
req, err := client.GetPreparer(resourceGroupName, localNetworkGatewayName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure responding to request")
}
return
@@ -206,28 +213,27 @@
// GetPreparer prepares the Get request.
func (client LocalNetworkGatewaysClient) GetPreparer(resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -236,7 +242,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +253,21 @@
// gateways stored.
//
// resourceGroupName is the name of the resource group.
-func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, ae error) {
+func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to request")
}
return
@@ -270,27 +276,26 @@
// ListPreparer prepares the List request.
func (client LocalNetworkGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -299,7 +304,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -307,10 +312,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetworkGatewayListResult) (result LocalNetworkGatewayListResult, ae error) {
+func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetworkGatewayListResult) (result LocalNetworkGatewayListResult, err error) {
req, err := lastResults.LocalNetworkGatewayListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -319,12 +324,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/LocalNetworkGatewaysClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,13 +14,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
@@ -75,6 +75,9 @@
// Basic specifies the basic state for application gateway request routing
// rule type.
Basic ApplicationGatewayRequestRoutingRuleType = "Basic"
+ // PathBasedRouting specifies the path based routing state for application
+ // gateway request routing rule type.
+ PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting"
)
// ApplicationGatewaySkuName enumerates the values for application gateway sku
@@ -197,6 +200,16 @@
Static IPAllocationMethod = "Static"
)
+// IPVersion enumerates the values for ip version.
+type IPVersion string
+
+const (
+ // IPv4 specifies the i pv 4 state for ip version.
+ IPv4 IPVersion = "IPv4"
+ // IPv6 specifies the i pv 6 state for ip version.
+ IPv6 IPVersion = "IPv6"
+)
+
// LoadDistribution enumerates the values for load distribution.
type LoadDistribution string
@@ -234,6 +247,16 @@
ProbeProtocolTCP ProbeProtocol = "Tcp"
)
+// ProcessorArchitecture enumerates the values for processor architecture.
+type ProcessorArchitecture string
+
+const (
+ // Amd64 specifies the amd 64 state for processor architecture.
+ Amd64 ProcessorArchitecture = "Amd64"
+ // X86 specifies the x86 state for processor architecture.
+ X86 ProcessorArchitecture = "X86"
+)
+
// RouteNextHopType enumerates the values for route next hop type.
type RouteNextHopType string
@@ -318,14 +341,6 @@
TransportProtocolUDP TransportProtocol = "Udp"
)
-// UsageUnit enumerates the values for usage unit.
-type UsageUnit string
-
-const (
- // Count specifies the count state for usage unit.
- Count UsageUnit = "Count"
-)
-
// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual
// network gateway connection status.
type VirtualNetworkGatewayConnectionStatus string
@@ -364,6 +379,40 @@
VPNClient VirtualNetworkGatewayConnectionType = "VPNClient"
)
+// VirtualNetworkGatewaySkuName enumerates the values for virtual network
+// gateway sku name.
+type VirtualNetworkGatewaySkuName string
+
+const (
+ // VirtualNetworkGatewaySkuNameBasic specifies the virtual network gateway
+ // sku name basic state for virtual network gateway sku name.
+ VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic"
+ // VirtualNetworkGatewaySkuNameHighPerformance specifies the virtual
+ // network gateway sku name high performance state for virtual network
+ // gateway sku name.
+ VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance"
+ // VirtualNetworkGatewaySkuNameStandard specifies the virtual network
+ // gateway sku name standard state for virtual network gateway sku name.
+ VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard"
+)
+
+// VirtualNetworkGatewaySkuTier enumerates the values for virtual network
+// gateway sku tier.
+type VirtualNetworkGatewaySkuTier string
+
+const (
+ // VirtualNetworkGatewaySkuTierBasic specifies the virtual network gateway
+ // sku tier basic state for virtual network gateway sku tier.
+ VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic"
+ // VirtualNetworkGatewaySkuTierHighPerformance specifies the virtual
+ // network gateway sku tier high performance state for virtual network
+ // gateway sku tier.
+ VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance"
+ // VirtualNetworkGatewaySkuTierStandard specifies the virtual network
+ // gateway sku tier standard state for virtual network gateway sku tier.
+ VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard"
+)
+
// VirtualNetworkGatewayType enumerates the values for virtual network gateway
// type.
type VirtualNetworkGatewayType string
@@ -423,7 +472,7 @@
// ApplicationGatewayBackendAddressPoolPropertiesFormat is properties of
// Backend Address Pool of application gateway
type ApplicationGatewayBackendAddressPoolPropertiesFormat struct {
- BackendIPConfigurations *[]SubResource `json:"backendIPConfigurations,omitempty"`
+ BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -440,9 +489,11 @@
// ApplicationGatewayBackendHTTPSettingsPropertiesFormat is properties of
// Backend address pool settings of application gateway
type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct {
- Port *int `json:"port,omitempty"`
+ Port *int32 `json:"port,omitempty"`
Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"`
+ RequestTimeout *int32 `json:"requestTimeout,omitempty"`
+ Probe *SubResource `json:"probe,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -476,7 +527,7 @@
// ApplicationGatewayFrontendPortPropertiesFormat is properties of Frontend
// Port of application gateway
type ApplicationGatewayFrontendPortPropertiesFormat struct {
- Port *int `json:"port,omitempty"`
+ Port *int32 `json:"port,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -491,11 +542,13 @@
// ApplicationGatewayHTTPListenerPropertiesFormat is properties of Http
// listener of application gateway
type ApplicationGatewayHTTPListenerPropertiesFormat struct {
- FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
- FrontendPort *SubResource `json:"frontendPort,omitempty"`
- Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
- SslCertificate *SubResource `json:"sslCertificate,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
+ FrontendPort *SubResource `json:"frontendPort,omitempty"`
+ Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
+ HostName *string `json:"hostName,omitempty"`
+ SslCertificate *SubResource `json:"sslCertificate,omitempty"`
+ RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewayIPConfiguration is iP configuration of application gateway
@@ -533,6 +586,44 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
+// ApplicationGatewayPathRule is path rule of URL path map of application
+// gateway
+type ApplicationGatewayPathRule struct {
+ ID *string `json:"id,omitempty"`
+ Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// ApplicationGatewayPathRulePropertiesFormat is properties of probe of
+// application gateway
+type ApplicationGatewayPathRulePropertiesFormat struct {
+ Paths *[]string `json:"paths,omitempty"`
+ BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
+ BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// ApplicationGatewayProbe is probe of application gateway
+type ApplicationGatewayProbe struct {
+ ID *string `json:"id,omitempty"`
+ Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// ApplicationGatewayProbePropertiesFormat is properties of probe of
+// application gateway
+type ApplicationGatewayProbePropertiesFormat struct {
+ Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
+ Host *string `json:"host,omitempty"`
+ Path *string `json:"path,omitempty"`
+ Interval *int32 `json:"interval,omitempty"`
+ Timeout *int32 `json:"timeout,omitempty"`
+ UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
// ApplicationGatewayPropertiesFormat is properties of Application Gateway
type ApplicationGatewayPropertiesFormat struct {
Sku *ApplicationGatewaySku `json:"sku,omitempty"`
@@ -541,9 +632,11 @@
SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"`
FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"`
+ Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"`
BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"`
BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"`
+ URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"`
RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -565,6 +658,7 @@
BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
HTTPListener *SubResource `json:"httpListener,omitempty"`
+ URLPathMap *SubResource `json:"urlPathMap,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -572,7 +666,7 @@
type ApplicationGatewaySku struct {
Name ApplicationGatewaySkuName `json:"name,omitempty"`
Tier ApplicationGatewayTier `json:"tier,omitempty"`
- Capacity *int `json:"capacity,omitempty"`
+ Capacity *int32 `json:"capacity,omitempty"`
}
// ApplicationGatewaySslCertificate is sSL certificates of application gateway
@@ -592,6 +686,23 @@
ProvisioningState *string `json:"provisioningState,omitempty"`
}
+// ApplicationGatewayURLPathMap is urlPathMap of application gateway
+type ApplicationGatewayURLPathMap struct {
+ ID *string `json:"id,omitempty"`
+ Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// ApplicationGatewayURLPathMapPropertiesFormat is properties of probe of
+// application gateway
+type ApplicationGatewayURLPathMapPropertiesFormat struct {
+ DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"`
+ DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"`
+ PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
// AuthorizationListResult is response for ListAuthorizations Api service
// callRetrieves all authorizations that belongs to an ExpressRouteCircuit
type AuthorizationListResult struct {
@@ -642,16 +753,23 @@
// BackendAddressPoolPropertiesFormat is properties of BackendAddressPool
type BackendAddressPoolPropertiesFormat struct {
- BackendIPConfigurations *[]SubResource `json:"backendIPConfigurations,omitempty"`
- LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
- OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
+ LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
+ OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// BgpSettings is
+type BgpSettings struct {
+ Asn *int64 `json:"asn,omitempty"`
+ BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`
+ PeerWeight *int32 `json:"peerWeight,omitempty"`
}
// ConnectionResetSharedKey is
type ConnectionResetSharedKey struct {
autorest.Response `json:"-"`
- KeyLength *int32 `json:"keyLength,omitempty"`
+ KeyLength *int64 `json:"keyLength,omitempty"`
}
// ConnectionSharedKey is response for GetConnectionSharedKey Api servive call
@@ -660,6 +778,13 @@
Value *string `json:"value,omitempty"`
}
+// ConnectionSharedKeyResult is response for CheckConnectionSharedKey Api
+// servive call
+type ConnectionSharedKeyResult struct {
+ autorest.Response `json:"-"`
+ Value *string `json:"value,omitempty"`
+}
+
// DhcpOptions is dHCPOptions contains an array of DNS servers available to
// VMs deployed in the virtual networkStandard DHCP option for a subnet
// overrides VNET DHCP options.
@@ -706,6 +831,8 @@
// ExpressRouteCircuitArpTable is the arp table associated with the
// ExpressRouteCircuit
type ExpressRouteCircuitArpTable struct {
+ Age *int32 `json:"age,omitempty"`
+ Interface *string `json:"interface,omitempty"`
IPAddress *string `json:"ipAddress,omitempty"`
MacAddress *string `json:"macAddress,omitempty"`
}
@@ -753,7 +880,7 @@
type ExpressRouteCircuitPeeringConfig struct {
AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"`
AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"`
- CustomerASN *int `json:"customerASN,omitempty"`
+ CustomerASN *int32 `json:"customerASN,omitempty"`
RoutingRegistryName *string `json:"routingRegistryName,omitempty"`
}
@@ -781,14 +908,14 @@
type ExpressRouteCircuitPeeringPropertiesFormat struct {
PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"`
State ExpressRouteCircuitPeeringState `json:"state,omitempty"`
- AzureASN *int `json:"azureASN,omitempty"`
- PeerASN *int `json:"peerASN,omitempty"`
+ AzureASN *int32 `json:"azureASN,omitempty"`
+ PeerASN *int32 `json:"peerASN,omitempty"`
PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"`
SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"`
PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"`
SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"`
SharedKey *string `json:"sharedKey,omitempty"`
- VlanID *int `json:"vlanId,omitempty"`
+ VlanID *int32 `json:"vlanId,omitempty"`
MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
Stats *ExpressRouteCircuitStats `json:"stats,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -796,6 +923,7 @@
// ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit
type ExpressRouteCircuitPropertiesFormat struct {
+ AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"`
CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"`
ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"`
Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"`
@@ -809,10 +937,21 @@
// ExpressRouteCircuitRoutesTable is the routes table associated with the
// ExpressRouteCircuit
type ExpressRouteCircuitRoutesTable struct {
- AddressPrefix *string `json:"addressPrefix,omitempty"`
- NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
- NextHopIP *string `json:"nextHopIP,omitempty"`
- AsPath *string `json:"asPath,omitempty"`
+ Network *string `json:"network,omitempty"`
+ NextHop *string `json:"nextHop,omitempty"`
+ LocPrf *string `json:"locPrf,omitempty"`
+ Weight *int32 `json:"weight,omitempty"`
+ Path *string `json:"path,omitempty"`
+}
+
+// ExpressRouteCircuitRoutesTableSummary is the routes table associated with
+// the ExpressRouteCircuit
+type ExpressRouteCircuitRoutesTableSummary struct {
+ Neighbor *string `json:"neighbor,omitempty"`
+ V *int32 `json:"v,omitempty"`
+ As *int32 `json:"as,omitempty"`
+ UpDown *string `json:"upDown,omitempty"`
+ StatePfxRcd *string `json:"statePfxRcd,omitempty"`
}
// ExpressRouteCircuitsArpTableListResult is response for ListArpTable
@@ -823,24 +962,12 @@
NextLink *string `json:"nextLink,omitempty"`
}
-// ExpressRouteCircuitsArpTableListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ExpressRouteCircuitsArpTableListResult) ExpressRouteCircuitsArpTableListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
// ExpressRouteCircuitServiceProviderProperties is contains
// ServiceProviderProperties in an ExpressRouteCircuit
type ExpressRouteCircuitServiceProviderProperties struct {
ServiceProviderName *string `json:"serviceProviderName,omitempty"`
PeeringLocation *string `json:"peeringLocation,omitempty"`
- BandwidthInMbps *int `json:"bandwidthInMbps,omitempty"`
+ BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
}
// ExpressRouteCircuitSku is contains sku in an ExpressRouteCircuit
@@ -858,42 +985,21 @@
NextLink *string `json:"nextLink,omitempty"`
}
-// ExpressRouteCircuitsRoutesTableListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ExpressRouteCircuitsRoutesTableListResult) ExpressRouteCircuitsRoutesTableListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// ExpressRouteCircuitsStatsListResult is response for ListStats from Express
-// Route Circuits Api service call
-type ExpressRouteCircuitsStatsListResult struct {
+// ExpressRouteCircuitsRoutesTableSummaryListResult is response for
+// ListRoutesTable associated with the Express Route Circuits Api
+type ExpressRouteCircuitsRoutesTableSummaryListResult struct {
autorest.Response `json:"-"`
- Value *[]ExpressRouteCircuitStats `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ExpressRouteCircuitsStatsListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ExpressRouteCircuitsStatsListResult) ExpressRouteCircuitsStatsListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
+ Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
}
// ExpressRouteCircuitStats is contains Stats associated with the peering
type ExpressRouteCircuitStats struct {
- BytesIn *int `json:"bytesIn,omitempty"`
- BytesOut *int `json:"bytesOut,omitempty"`
+ autorest.Response `json:"-"`
+ PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"`
+ PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"`
+ SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"`
+ SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"`
}
// ExpressRouteServiceProvider is expressRouteResourceProvider object
@@ -901,6 +1007,8 @@
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
Properties *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"`
}
@@ -908,7 +1016,7 @@
// in ExpressRouteServiceProviders
type ExpressRouteServiceProviderBandwidthsOffered struct {
OfferName *string `json:"offerName,omitempty"`
- ValueInMbps *int `json:"valueInMbps,omitempty"`
+ ValueInMbps *int32 `json:"valueInMbps,omitempty"`
}
// ExpressRouteServiceProviderListResult is response for
@@ -950,14 +1058,14 @@
// FrontendIPConfigurationPropertiesFormat is properties of Frontend IP
// Configuration of the load balancer
type FrontendIPConfigurationPropertiesFormat struct {
- PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
- PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
- Subnet *SubResource `json:"subnet,omitempty"`
- PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"`
InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"`
OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"`
LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
+ PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
+ PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
+ Subnet *Subnet `json:"subnet,omitempty"`
+ PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -973,9 +1081,9 @@
type InboundNatPoolPropertiesFormat struct {
FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
Protocol TransportProtocol `json:"protocol,omitempty"`
- FrontendPortRangeStart *int `json:"frontendPortRangeStart,omitempty"`
- FrontendPortRangeEnd *int `json:"frontendPortRangeEnd,omitempty"`
- BackendPort *int `json:"backendPort,omitempty"`
+ FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"`
+ FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"`
+ BackendPort *int32 `json:"backendPort,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -989,14 +1097,14 @@
// InboundNatRulePropertiesFormat is properties of Inbound NAT rule
type InboundNatRulePropertiesFormat struct {
- FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
- BackendIPConfiguration *SubResource `json:"backendIPConfiguration,omitempty"`
- Protocol TransportProtocol `json:"protocol,omitempty"`
- FrontendPort *int `json:"frontendPort,omitempty"`
- BackendPort *int `json:"backendPort,omitempty"`
- IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`
- EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
+ BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"`
+ Protocol TransportProtocol `json:"protocol,omitempty"`
+ FrontendPort *int32 `json:"frontendPort,omitempty"`
+ BackendPort *int32 `json:"backendPort,omitempty"`
+ IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
+ EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
// Interface is a NetworkInterface in a resource group
@@ -1013,10 +1121,11 @@
// InterfaceDNSSettings is dns Settings of a network interface
type InterfaceDNSSettings struct {
- DNSServers *[]string `json:"dnsServers,omitempty"`
- AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
- InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
- InternalFqdn *string `json:"internalFqdn,omitempty"`
+ DNSServers *[]string `json:"dnsServers,omitempty"`
+ AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
+ InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
+ InternalFqdn *string `json:"internalFqdn,omitempty"`
+ InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"`
}
// InterfaceIPConfiguration is iPConfiguration in a NetworkInterface
@@ -1029,13 +1138,16 @@
// InterfaceIPConfigurationPropertiesFormat is properties of IPConfiguration
type InterfaceIPConfigurationPropertiesFormat struct {
- PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
- PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
- Subnet *SubResource `json:"subnet,omitempty"`
- PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
- LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
- LoadBalancerInboundNatRules *[]SubResource `json:"loadBalancerInboundNatRules,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"`
+ LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"`
+ LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"`
+ PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
+ PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
+ PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
+ Subnet *Subnet `json:"subnet,omitempty"`
+ Primary *bool `json:"primary,omitempty"`
+ PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
// InterfaceListResult is response for ListNetworkInterface Api service call
@@ -1060,7 +1172,7 @@
// InterfacePropertiesFormat is networkInterface properties.
type InterfacePropertiesFormat struct {
VirtualMachine *SubResource `json:"virtualMachine,omitempty"`
- NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
+ NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"`
DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"`
MacAddress *string `json:"macAddress,omitempty"`
@@ -1070,6 +1182,23 @@
ProvisioningState *string `json:"provisioningState,omitempty"`
}
+// IPConfiguration is iPConfiguration
+type IPConfiguration struct {
+ ID *string `json:"id,omitempty"`
+ Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// IPConfigurationPropertiesFormat is properties of IPConfiguration
+type IPConfigurationPropertiesFormat struct {
+ PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
+ PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
+ Subnet *Subnet `json:"subnet,omitempty"`
+ PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
// LoadBalancer is loadBalancer resource
type LoadBalancer struct {
autorest.Response `json:"-"`
@@ -1129,9 +1258,9 @@
Probe *SubResource `json:"probe,omitempty"`
Protocol TransportProtocol `json:"protocol,omitempty"`
LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"`
- FrontendPort *int `json:"frontendPort,omitempty"`
- BackendPort *int `json:"backendPort,omitempty"`
- IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`
+ FrontendPort *int32 `json:"frontendPort,omitempty"`
+ BackendPort *int32 `json:"backendPort,omitempty"`
+ IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1172,6 +1301,7 @@
type LocalNetworkGatewayPropertiesFormat struct {
LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"`
GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"`
+ BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1186,7 +1316,7 @@
// OutboundNatRulePropertiesFormat is outbound NAT pool of the loadbalancer
type OutboundNatRulePropertiesFormat struct {
- AllocatedOutboundPorts *int `json:"allocatedOutboundPorts,omitempty"`
+ AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"`
FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"`
BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1204,9 +1334,9 @@
type ProbePropertiesFormat struct {
LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
Protocol ProbeProtocol `json:"protocol,omitempty"`
- Port *int `json:"port,omitempty"`
- IntervalInSeconds *int `json:"intervalInSeconds,omitempty"`
- NumberOfProbes *int `json:"numberOfProbes,omitempty"`
+ Port *int32 `json:"port,omitempty"`
+ IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"`
+ NumberOfProbes *int32 `json:"numberOfProbes,omitempty"`
RequestPath *string `json:"requestPath,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1254,10 +1384,11 @@
// PublicIPAddressPropertiesFormat is publicIpAddress properties
type PublicIPAddressPropertiesFormat struct {
PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`
- IPConfiguration *SubResource `json:"ipConfiguration,omitempty"`
+ PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
+ IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"`
DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
IPAddress *string `json:"ipAddress,omitempty"`
- IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`
+ IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1340,9 +1471,9 @@
// RouteTablePropertiesFormat is route Table resource
type RouteTablePropertiesFormat struct {
- Routes *[]Route `json:"routes,omitempty"`
- Subnets *[]SubResource `json:"subnets,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ Routes *[]Route `json:"routes,omitempty"`
+ Subnets *[]Subnet `json:"subnets,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
// SecurityGroup is networkSecurityGroup resource
@@ -1381,8 +1512,8 @@
type SecurityGroupPropertiesFormat struct {
SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
- NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"`
- Subnets *[]SubResource `json:"subnets,omitempty"`
+ NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
+ Subnets *[]Subnet `json:"subnets,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1425,11 +1556,17 @@
SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
Access SecurityRuleAccess `json:"access,omitempty"`
- Priority *int `json:"priority,omitempty"`
+ Priority *int32 `json:"priority,omitempty"`
Direction SecurityRuleDirection `json:"direction,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
+// String is
+type String struct {
+ autorest.Response `json:"-"`
+ Value *string `json:"value,omitempty"`
+}
+
// Subnet is subnet in a VirtualNework resource
type Subnet struct {
autorest.Response `json:"-"`
@@ -1461,11 +1598,11 @@
// SubnetPropertiesFormat is
type SubnetPropertiesFormat struct {
- AddressPrefix *string `json:"addressPrefix,omitempty"`
- NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
- RouteTable *SubResource `json:"routeTable,omitempty"`
- IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ AddressPrefix *string `json:"addressPrefix,omitempty"`
+ NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
+ RouteTable *RouteTable `json:"routeTable,omitempty"`
+ IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
// SubResource is
@@ -1475,9 +1612,9 @@
// Usage is describes Network Resource Usage.
type Usage struct {
- Unit UsageUnit `json:"unit,omitempty"`
- CurrentValue *int `json:"currentValue,omitempty"`
- Limit *int32 `json:"limit,omitempty"`
+ Unit *string `json:"unit,omitempty"`
+ CurrentValue *int64 `json:"currentValue,omitempty"`
+ Limit *int64 `json:"limit,omitempty"`
Name *UsageName `json:"name,omitempty"`
}
@@ -1553,16 +1690,18 @@
// VirtualNetworkGatewayConnectionPropertiesFormat is
// virtualNeworkGatewayConnection properties
type VirtualNetworkGatewayConnectionPropertiesFormat struct {
+ AuthorizationKey *string `json:"authorizationKey,omitempty"`
VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"`
VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"`
LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"`
ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"`
- RoutingWeight *int `json:"routingWeight,omitempty"`
+ RoutingWeight *int32 `json:"routingWeight,omitempty"`
SharedKey *string `json:"sharedKey,omitempty"`
ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
- EgressBytesTransferred *int32 `json:"egressBytesTransferred,omitempty"`
- IngressBytesTransferred *int32 `json:"ingressBytesTransferred,omitempty"`
+ EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
+ IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
Peer *SubResource `json:"peer,omitempty"`
+ EnableBgp *bool `json:"enableBgp,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@@ -1608,13 +1747,23 @@
// VirtualNetworkGatewayPropertiesFormat is virtualNeworkGateay properties
type VirtualNetworkGatewayPropertiesFormat struct {
- IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`
- GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"`
- VpnType VpnType `json:"vpnType,omitempty"`
- EnableBgp *bool `json:"enableBgp,omitempty"`
- GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`
- ResourceGUID *string `json:"resourceGuid,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
+ IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`
+ GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"`
+ VpnType VpnType `json:"vpnType,omitempty"`
+ EnableBgp *bool `json:"enableBgp,omitempty"`
+ GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`
+ Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"`
+ VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"`
+ BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
+ ResourceGUID *string `json:"resourceGuid,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// VirtualNetworkGatewaySku is virtualNetworkGatewaySku details
+type VirtualNetworkGatewaySku struct {
+ Name VirtualNetworkGatewaySkuName `json:"name,omitempty"`
+ Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"`
+ Capacity *int32 `json:"capacity,omitempty"`
}
// VirtualNetworkListResult is response for ListVirtualNetworks Api servive
@@ -1645,3 +1794,47 @@
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
+
+// VpnClientConfiguration is vpnClientConfiguration for P2S client
+type VpnClientConfiguration struct {
+ VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"`
+ VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"`
+ VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`
+}
+
+// VpnClientParameters is vpnClientParameters
+type VpnClientParameters struct {
+ ProcessorArchitecture ProcessorArchitecture `json:"ProcessorArchitecture,omitempty"`
+}
+
+// VpnClientRevokedCertificate is vPN client revoked certificate of virtual
+// network gateway
+type VpnClientRevokedCertificate struct {
+ ID *string `json:"id,omitempty"`
+ Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// VpnClientRevokedCertificatePropertiesFormat is properties of the revoked
+// VPN client certificate of virtual network gateway
+type VpnClientRevokedCertificatePropertiesFormat struct {
+ Thumbprint *string `json:"thumbprint,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// VpnClientRootCertificate is vPN client root certificate of virtual network
+// gateway
+type VpnClientRootCertificate struct {
+ ID *string `json:"id,omitempty"`
+ Properties *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Etag *string `json:"etag,omitempty"`
+}
+
+// VpnClientRootCertificatePropertiesFormat is properties of SSL certificates
+// of application gateway
+type VpnClientRootCertificatePropertiesFormat struct {
+ PublicCertData *string `json:"publicCertData,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// PublicIPAddressesClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// PublicIPAddressesClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type PublicIPAddressesClient struct {
ManagementClient
@@ -46,122 +46,128 @@
}
// CreateOrUpdate the Put PublicIPAddress operation creates/updates a
-// stable/dynamic PublicIP address
+// stable/dynamic PublicIP address This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. publicIPAddressName is
// the name of the publicIpAddress. parameters is parameters supplied to the
// create/update PublicIPAddress operation
-func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (result PublicIPAddress, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, publicIPAddressName, parameters)
+func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, publicIPAddressName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client PublicIPAddressesClient) CreateOrUpdatePreparer(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (*http.Request, error) {
+func (client PublicIPAddressesClient) CreateOrUpdatePreparer(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "publicIpAddressName": url.QueryEscape(publicIPAddressName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "publicIpAddressName": autorest.Encode("path", publicIPAddressName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPAddress, err error) {
+func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete publicIpAddress operation deletes the specified
-// publicIpAddress.
+// publicIpAddress. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. publicIPAddressName is
// the name of the subnet.
-func (client PublicIPAddressesClient) Delete(resourceGroupName string, publicIPAddressName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, publicIPAddressName)
+func (client PublicIPAddressesClient) Delete(resourceGroupName string, publicIPAddressName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, publicIPAddressName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client PublicIPAddressesClient) DeletePreparer(resourceGroupName string, publicIPAddressName string) (*http.Request, error) {
+func (client PublicIPAddressesClient) DeletePreparer(resourceGroupName string, publicIPAddressName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "publicIpAddressName": url.QueryEscape(publicIPAddressName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "publicIpAddressName": autorest.Encode("path", publicIPAddressName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +176,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -180,52 +186,54 @@
// specified pubicIpAddress
//
// resourceGroupName is the name of the resource group. publicIPAddressName is
-// the name of the subnet.
-func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string) (result PublicIPAddress, ae error) {
- req, err := client.GetPreparer(resourceGroupName, publicIPAddressName)
+// the name of the subnet. expand is expand references resources.
+func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) {
+ req, err := client.GetPreparer(resourceGroupName, publicIPAddressName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client PublicIPAddressesClient) GetPreparer(resourceGroupName string, publicIPAddressName string) (*http.Request, error) {
+func (client PublicIPAddressesClient) GetPreparer(resourceGroupName string, publicIPAddressName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "publicIpAddressName": url.QueryEscape(publicIPAddressName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "publicIpAddressName": autorest.Encode("path", publicIPAddressName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client PublicIPAddressesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -234,7 +242,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -245,21 +253,21 @@
// in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client PublicIPAddressesClient) List(resourceGroupName string) (result PublicIPAddressListResult, ae error) {
+func (client PublicIPAddressesClient) List(resourceGroupName string) (result PublicIPAddressListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to request")
}
return
@@ -268,27 +276,26 @@
// ListPreparer prepares the List request.
func (client PublicIPAddressesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client PublicIPAddressesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -297,7 +304,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -305,10 +312,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, ae error) {
+func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) {
req, err := lastResults.PublicIPAddressListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -317,12 +324,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -330,21 +337,21 @@
// ListAll the List publicIpAddress opertion retrieves all the
// publicIpAddresses in a subscription.
-func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, ae error) {
+func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -353,26 +360,25 @@
// ListAllPreparer prepares the ListAll request.
func (client PublicIPAddressesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client PublicIPAddressesClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -381,7 +387,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -389,10 +395,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client PublicIPAddressesClient) ListAllNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, ae error) {
+func (client PublicIPAddressesClient) ListAllNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) {
req, err := lastResults.PublicIPAddressListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -401,12 +407,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/PublicIPAddressesClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/routes.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/routes.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/routes.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/routes.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// RoutesClient is the the Windows Azure Network management API provides a
-// RESTful set of web services that interact with Windows Azure Networks
+// RoutesClient is the the Microsoft Azure Network management API provides a
+// RESTful set of web services that interact with Microsoft Azure Networks
// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
+// capture the relationship between an end user and the Microsoft Azure
// Networks service.
type RoutesClient struct {
ManagementClient
@@ -44,124 +44,130 @@
}
// CreateOrUpdate the Put route operation creates/updates a route in the
-// specified route table
+// specified route table This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route.
// routeParameters is parameters supplied to the create/update routeoperation
-func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result Route, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, routeName, routeParameters)
+func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, routeName, routeParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RoutesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client RoutesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (*http.Request, error) {
+func (client RoutesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithJSON(routeParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result Route, err error) {
+func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete route operation deletes the specified route from a route
-// table.
+// table. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route.
-func (client RoutesClient) Delete(resourceGroupName string, routeTableName string, routeName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, routeTableName, routeName)
+func (client RoutesClient) Delete(resourceGroupName string, routeTableName string, routeName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, routeTableName, routeName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RoutesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client RoutesClient) DeletePreparer(resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) {
+func (client RoutesClient) DeletePreparer(resourceGroupName string, routeTableName string, routeName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client RoutesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +176,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -181,21 +187,21 @@
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route.
-func (client RoutesClient) Get(resourceGroupName string, routeTableName string, routeName string) (result Route, ae error) {
+func (client RoutesClient) Get(resourceGroupName string, routeTableName string, routeName string) (result Route, err error) {
req, err := client.GetPreparer(resourceGroupName, routeTableName, routeName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RoutesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure responding to request")
}
return
@@ -204,29 +210,28 @@
// GetPreparer prepares the Get request.
func (client RoutesClient) GetPreparer(resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client RoutesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -235,7 +240,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +252,21 @@
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table.
-func (client RoutesClient) List(resourceGroupName string, routeTableName string) (result RouteListResult, ae error) {
+func (client RoutesClient) List(resourceGroupName string, routeTableName string) (result RouteListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, routeTableName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to request")
}
return
@@ -270,28 +275,27 @@
// ListPreparer prepares the List request.
func (client RoutesClient) ListPreparer(resourceGroupName string, routeTableName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client RoutesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -300,7 +304,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -308,10 +312,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client RoutesClient) ListNextResults(lastResults RouteListResult) (result RouteListResult, ae error) {
+func (client RoutesClient) ListNextResults(lastResults RouteListResult) (result RouteListResult, err error) {
req, err := lastResults.RouteListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -320,12 +324,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RoutesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// RouteTablesClient is the the Windows Azure Network management API provides
-// a RESTful set of web services that interact with Windows Azure Networks
-// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
+// RouteTablesClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
+// Networks service to manage your network resrources. The API has entities
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type RouteTablesClient struct {
ManagementClient
@@ -45,121 +45,128 @@
}
// CreateOrUpdate the Put RouteTable operation creates/updates a route tablein
-// the specified resource group.
+// the specified resource group. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. parameters is parameters supplied to the
// create/update Route Table operation
-func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTable, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, parameters)
+func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client RouteTablesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, parameters RouteTable) (*http.Request, error) {
+func (client RouteTablesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteTable, err error) {
+func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete RouteTable operation deletes the specifed Route Table
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table.
-func (client RouteTablesClient) Delete(resourceGroupName string, routeTableName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, routeTableName)
+func (client RouteTablesClient) Delete(resourceGroupName string, routeTableName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, routeTableName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client RouteTablesClient) DeletePreparer(resourceGroupName string, routeTableName string) (*http.Request, error) {
+func (client RouteTablesClient) DeletePreparer(resourceGroupName string, routeTableName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client RouteTablesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -168,7 +175,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
@@ -178,52 +185,54 @@
// route table.
//
// resourceGroupName is the name of the resource group. routeTableName is the
-// name of the route table.
-func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string) (result RouteTable, ae error) {
- req, err := client.GetPreparer(resourceGroupName, routeTableName)
+// name of the route table. expand is expand references resources.
+func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) {
+ req, err := client.GetPreparer(resourceGroupName, routeTableName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client RouteTablesClient) GetPreparer(resourceGroupName string, routeTableName string) (*http.Request, error) {
+func (client RouteTablesClient) GetPreparer(resourceGroupName string, routeTableName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeTableName": url.QueryEscape(routeTableName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeTableName": autorest.Encode("path", routeTableName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client RouteTablesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -232,7 +241,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -242,21 +251,21 @@
// List the list RouteTables returns all route tables in a resource group
//
// resourceGroupName is the name of the resource group.
-func (client RouteTablesClient) List(resourceGroupName string) (result RouteTableListResult, ae error) {
+func (client RouteTablesClient) List(resourceGroupName string) (result RouteTableListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to request")
}
return
@@ -265,27 +274,26 @@
// ListPreparer prepares the List request.
func (client RouteTablesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client RouteTablesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -294,7 +302,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -302,10 +310,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult) (result RouteTableListResult, ae error) {
+func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult) (result RouteTableListResult, err error) {
req, err := lastResults.RouteTableListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -314,33 +322,33 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to next results request request")
}
return
}
// ListAll the list RouteTables returns all route tables in a subscription
-func (client RouteTablesClient) ListAll() (result RouteTableListResult, ae error) {
+func (client RouteTablesClient) ListAll() (result RouteTableListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -349,26 +357,25 @@
// ListAllPreparer prepares the ListAll request.
func (client RouteTablesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client RouteTablesClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -377,7 +384,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -385,10 +392,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client RouteTablesClient) ListAllNextResults(lastResults RouteTableListResult) (result RouteTableListResult, ae error) {
+func (client RouteTablesClient) ListAllNextResults(lastResults RouteTableListResult) (result RouteTableListResult, err error) {
req, err := lastResults.RouteTableListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -397,12 +404,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/RouteTablesClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// SecurityGroupsClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// SecurityGroupsClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type SecurityGroupsClient struct {
ManagementClient
@@ -46,123 +46,130 @@
}
// CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a
-// network security groupin the specified resource group.
+// network security groupin the specified resource group. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
// parameters is parameters supplied to the create/update Network Security
// Group operation
-func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroup, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, parameters)
+func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client SecurityGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (*http.Request, error) {
+func (client SecurityGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityGroup, err error) {
+func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete NetworkSecurityGroup operation deletes the specifed
-// network security group
+// network security group This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
-func (client SecurityGroupsClient) Delete(resourceGroupName string, networkSecurityGroupName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, networkSecurityGroupName)
+func (client SecurityGroupsClient) Delete(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, networkSecurityGroupName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client SecurityGroupsClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) {
+func (client SecurityGroupsClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -171,7 +178,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -181,52 +188,55 @@
// specified network security group.
//
// resourceGroupName is the name of the resource group.
-// networkSecurityGroupName is the name of the network security group.
-func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string) (result SecurityGroup, ae error) {
- req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName)
+// networkSecurityGroupName is the name of the network security group. expand
+// is expand references resources.
+func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) {
+ req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client SecurityGroupsClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) {
+func (client SecurityGroupsClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -235,7 +245,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -246,21 +256,21 @@
// a resource group
//
// resourceGroupName is the name of the resource group.
-func (client SecurityGroupsClient) List(resourceGroupName string) (result SecurityGroupListResult, ae error) {
+func (client SecurityGroupsClient) List(resourceGroupName string) (result SecurityGroupListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to request")
}
return
@@ -269,27 +279,26 @@
// ListPreparer prepares the List request.
func (client SecurityGroupsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -298,7 +307,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -306,10 +315,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, ae error) {
+func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) {
req, err := lastResults.SecurityGroupListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -318,12 +327,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -331,21 +340,21 @@
// ListAll the list NetworkSecurityGroups returns all network security groups
// in a subscription
-func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, ae error) {
+func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -354,26 +363,25 @@
// ListAllPreparer prepares the ListAll request.
func (client SecurityGroupsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -382,7 +390,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -390,10 +398,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client SecurityGroupsClient) ListAllNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, ae error) {
+func (client SecurityGroupsClient) ListAllNextResults(lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) {
req, err := lastResults.SecurityGroupListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -402,12 +410,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityGroupsClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// SecurityRulesClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// SecurityRulesClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type SecurityRulesClient struct {
ManagementClient
@@ -46,127 +46,134 @@
}
// CreateOrUpdate the Put network security rule operation creates/updates a
-// security rule in the specified network security group
+// security rule in the specified network security group This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
// securityRuleName is the name of the security rule. securityRuleParameters
// is parameters supplied to the create/update network security rule
// operation
-func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRule, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters)
+func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityRulesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client SecurityRulesClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (*http.Request, error) {
+func (client SecurityRulesClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "securityRuleName": url.QueryEscape(securityRuleName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "securityRuleName": autorest.Encode("path", securityRuleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithJSON(securityRuleParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityRule, err error) {
+func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the delete network security rule operation deletes the specified
-// network security rule.
+// network security rule. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
// securityRuleName is the name of the security rule.
-func (client SecurityRulesClient) Delete(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, networkSecurityGroupName, securityRuleName)
+func (client SecurityRulesClient) Delete(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, networkSecurityGroupName, securityRuleName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client SecurityRulesClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) {
+func (client SecurityRulesClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "securityRuleName": url.QueryEscape(securityRuleName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "securityRuleName": autorest.Encode("path", securityRuleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityRulesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -175,7 +182,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -187,21 +194,21 @@
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
// securityRuleName is the name of the security rule.
-func (client SecurityRulesClient) Get(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, ae error) {
+func (client SecurityRulesClient) Get(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) {
req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, securityRuleName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityRulesClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure responding to request")
}
return
@@ -210,29 +217,28 @@
// GetPreparer prepares the Get request.
func (client SecurityRulesClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "securityRuleName": url.QueryEscape(securityRuleName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "securityRuleName": autorest.Encode("path", securityRuleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -241,7 +247,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -253,21 +259,21 @@
//
// resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group.
-func (client SecurityRulesClient) List(resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResult, ae error) {
+func (client SecurityRulesClient) List(resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, networkSecurityGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to request")
}
return
@@ -276,28 +282,27 @@
// ListPreparer prepares the List request.
func (client SecurityRulesClient) ListPreparer(resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client SecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -306,7 +311,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -314,10 +319,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client SecurityRulesClient) ListNextResults(lastResults SecurityRuleListResult) (result SecurityRuleListResult, ae error) {
+func (client SecurityRulesClient) ListNextResults(lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) {
req, err := lastResults.SecurityRuleListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -326,12 +331,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SecurityRulesClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// SubnetsClient is the the Windows Azure Network management API provides a
-// RESTful set of web services that interact with Windows Azure Networks
+// SubnetsClient is the the Microsoft Azure Network management API provides a
+// RESTful set of web services that interact with Microsoft Azure Networks
// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
+// capture the relationship between an end user and the Microsoft Azure
// Networks service.
type SubnetsClient struct {
ManagementClient
@@ -44,124 +44,131 @@
}
// CreateOrUpdate the Put Subnet operation creates/updates a subnet in
-// thespecified virtual network
+// thespecified virtual network This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet.
// subnetParameters is parameters supplied to the create/update Subnet
// operation
-func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (result Subnet, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, subnetName, subnetParameters)
+func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SubnetsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client SubnetsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (*http.Request, error) {
+func (client SubnetsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subnetName": url.QueryEscape(subnetName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subnetName": autorest.Encode("path", subnetName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithJSON(subnetParameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) {
+func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// Delete the delete subnet operation deletes the specified subnet.
+// Delete the delete subnet operation deletes the specified subnet. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet.
-func (client SubnetsClient) Delete(resourceGroupName string, virtualNetworkName string, subnetName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, virtualNetworkName, subnetName)
+func (client SubnetsClient) Delete(resourceGroupName string, virtualNetworkName string, subnetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, virtualNetworkName, subnetName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SubnetsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client SubnetsClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) {
+func (client SubnetsClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, subnetName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subnetName": url.QueryEscape(subnetName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subnetName": autorest.Encode("path", subnetName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client SubnetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +177,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
@@ -181,52 +188,55 @@
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet.
-func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string) (result Subnet, ae error) {
- req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName)
+// expand is expand references resources.
+func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) {
+ req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SubnetsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client SubnetsClient) GetPreparer(resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) {
+func (client SubnetsClient) GetPreparer(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subnetName": url.QueryEscape(subnetName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subnetName": autorest.Encode("path", subnetName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client SubnetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -235,7 +245,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +257,21 @@
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network.
-func (client SubnetsClient) List(resourceGroupName string, virtualNetworkName string) (result SubnetListResult, ae error) {
+func (client SubnetsClient) List(resourceGroupName string, virtualNetworkName string) (result SubnetListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, virtualNetworkName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to request")
}
return
@@ -270,28 +280,27 @@
// ListPreparer prepares the List request.
func (client SubnetsClient) ListPreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client SubnetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -300,7 +309,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -308,10 +317,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client SubnetsClient) ListNextResults(lastResults SubnetListResult) (result SubnetListResult, ae error) {
+func (client SubnetsClient) ListNextResults(lastResults SubnetListResult) (result SubnetListResult, err error) {
req, err := lastResults.SubnetListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -320,12 +329,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/SubnetsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/usages.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/usages.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/usages.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/usages.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// UsagesClient is the the Windows Azure Network management API provides a
-// RESTful set of web services that interact with Windows Azure Networks
+// UsagesClient is the the Microsoft Azure Network management API provides a
+// RESTful set of web services that interact with Microsoft Azure Networks
// service to manage your network resrources. The API has entities that
-// capture the relationship between an end user and the Windows Azure
+// capture the relationship between an end user and the Microsoft Azure
// Networks service.
type UsagesClient struct {
ManagementClient
@@ -46,21 +46,21 @@
// List lists compute usages for a subscription.
//
// location is the location upon which resource usage is queried.
-func (client UsagesClient) List(location string) (result UsagesListResult, ae error) {
+func (client UsagesClient) List(location string) (result UsagesListResult, err error) {
req, err := client.ListPreparer(location)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/UsagesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/UsagesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/UsagesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to request")
}
return
@@ -69,27 +69,26 @@
// ListPreparer prepares the List request.
func (client UsagesClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "location": url.QueryEscape(location),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -98,7 +97,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "network", "2015-05-01-preview")
+ return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-03-30")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// VirtualNetworkGatewayConnectionsClient is the the Windows Azure Network
+// VirtualNetworkGatewayConnectionsClient is the the Microsoft Azure Network
// management API provides a RESTful set of web services that interact with
-// Windows Azure Networks service to manage your network resrources. The API
-// has entities that capture the relationship between an end user and the
-// Windows Azure Networks service.
+// Microsoft Azure Networks service to manage your network resrources. The
+// API has entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type VirtualNetworkGatewayConnectionsClient struct {
ManagementClient
}
@@ -47,126 +47,133 @@
// CreateOrUpdate the Put VirtualNetworkGatewayConnection operation
// creates/updates a virtual network gateway connection in the specified
-// resource group through Network resource provider.
+// resource group through Network resource provider. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network
// gateway conenction. parameters is parameters supplied to the Begin Create
// or update Virtual Network Gateway connection operation through Network
// resource provider.
-func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (result VirtualNetworkGatewayConnection, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters)
+func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (*http.Request, error) {
+func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) {
+func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete VirtualNetworkGatewayConnection operation deletes the
// specifed virtual network Gateway connection through Network resource
-// provider.
+// provider. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network
// gateway connection.
-func (client VirtualNetworkGatewayConnectionsClient) Delete(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, virtualNetworkGatewayConnectionName)
+func (client VirtualNetworkGatewayConnectionsClient) Delete(resourceGroupName string, virtualNetworkGatewayConnectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) {
+func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -175,7 +182,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -188,21 +195,21 @@
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network
// gateway connection.
-func (client VirtualNetworkGatewayConnectionsClient) Get(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, ae error) {
+func (client VirtualNetworkGatewayConnectionsClient) Get(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) {
req, err := client.GetPreparer(resourceGroupName, virtualNetworkGatewayConnectionName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure responding to request")
}
return
@@ -211,28 +218,27 @@
// GetPreparer prepares the Get request.
func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -241,7 +247,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -253,62 +259,61 @@
// connection shared key through Network resource provider.
//
// resourceGroupName is the name of the resource group.
-// virtualNetworkGatewayConnectionName is the virtual network gateway
-// connection shared key name.
-func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, ae error) {
- req, err := client.GetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName)
+// connectionSharedKeyName is the virtual network gateway connection shared
+// key name.
+func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, connectionSharedKeyName string) (result ConnectionSharedKeyResult, err error) {
+ req, err := client.GetSharedKeyPreparer(resourceGroupName, connectionSharedKeyName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "GetSharedKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request")
}
resp, err := client.GetSharedKeySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "GetSharedKey", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure sending request")
}
result, err = client.GetSharedKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "GetSharedKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure responding to request")
}
return
}
// GetSharedKeyPreparer prepares the GetSharedKey request.
-func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) {
+func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, connectionSharedKeyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "connectionSharedKeyName": autorest.Encode("path", connectionSharedKeyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSharedKeySender sends the GetSharedKey request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSharedKeyResponder handles the response to the GetSharedKey request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) {
+func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKeyResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -319,21 +324,21 @@
// virtual network gateways connections created.
//
// resourceGroupName is the name of the resource group.
-func (client VirtualNetworkGatewayConnectionsClient) List(resourceGroupName string) (result VirtualNetworkGatewayConnectionListResult, ae error) {
+func (client VirtualNetworkGatewayConnectionsClient) List(resourceGroupName string) (result VirtualNetworkGatewayConnectionListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to request")
}
return
@@ -342,27 +347,26 @@
// ListPreparer prepares the List request.
func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -371,7 +375,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -379,10 +383,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults VirtualNetworkGatewayConnectionListResult) (result VirtualNetworkGatewayConnectionListResult, ae error) {
+func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults VirtualNetworkGatewayConnectionListResult) (result VirtualNetworkGatewayConnectionListResult, err error) {
req, err := lastResults.VirtualNetworkGatewayConnectionListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -391,12 +395,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -405,141 +409,147 @@
// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation
// resets the virtual network gateway connection shared key for passed
// virtual network gateway connection in the specified resource group through
-// Network resource provider.
+// Network resource provider. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the virtual network gateway
// connection reset shared key Name. parameters is parameters supplied to the
// Begin Reset Virtual Network Gateway connection shared key operation
// through Network resource provider.
-func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (result ConnectionResetSharedKey, ae error) {
- req, err := client.ResetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters)
+func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ResetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request")
}
resp, err := client.ResetSharedKeySender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", resp, "Failure sending request")
}
result, err = client.ResetSharedKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", resp, "Failure responding to request")
}
return
}
// ResetSharedKeyPreparer prepares the ResetSharedKey request.
-func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (*http.Request, error) {
+func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ResetSharedKeySender sends the ResetSharedKey request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ResetSharedKeyResponder handles the response to the ResetSharedKey request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result ConnectionResetSharedKey, err error) {
+func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation
// sets the virtual network gateway connection shared key for passed virtual
// network gateway connection in the specified resource group through Network
-// resource provider.
+// resource provider. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the virtual network gateway
// connection name. parameters is parameters supplied to the Begin Set
// Virtual Network Gateway conection Shared key operation throughNetwork
// resource provider.
-func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (result ConnectionSharedKey, ae error) {
- req, err := client.SetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters)
+func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.SetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "SetSharedKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request")
}
resp, err := client.SetSharedKeySender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "SetSharedKey", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", resp, "Failure sending request")
}
result, err = client.SetSharedKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewayConnectionsClient", "SetSharedKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", resp, "Failure responding to request")
}
return
}
// SetSharedKeyPreparer prepares the SetSharedKey request.
-func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (*http.Request, error) {
+func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// SetSharedKeySender sends the SetSharedKey request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// SetSharedKeyResponder handles the response to the SetSharedKey request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) {
+func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,21 +14,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// VirtualNetworkGatewaysClient is the the Windows Azure Network management
-// API provides a RESTful set of web services that interact with Windows
+// VirtualNetworkGatewaysClient is the the Microsoft Azure Network management
+// API provides a RESTful set of web services that interact with Microsoft
// Azure Networks service to manage your network resrources. The API has
-// entities that capture the relationship between an end user and the Windows
-// Azure Networks service.
+// entities that capture the relationship between an end user and the
+// Microsoft Azure Networks service.
type VirtualNetworkGatewaysClient struct {
ManagementClient
}
@@ -47,123 +47,130 @@
// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a
// virtual network gateway in the specified resource group through Network
-// resource provider.
+// resource provider. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway.
// parameters is parameters supplied to the Begin Create or update Virtual
// Network Gateway operation through Network resource provider.
-func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGateway, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayName, parameters)
+func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) {
+func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) {
+func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete VirtualNetworkGateway operation deletes the specifed
-// virtual network Gateway through Network resource provider.
+// virtual network Gateway through Network resource provider. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway.
-func (client VirtualNetworkGatewaysClient) Delete(resourceGroupName string, virtualNetworkGatewayName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, virtualNetworkGatewayName)
+func (client VirtualNetworkGatewaysClient) Delete(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, virtualNetworkGatewayName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualNetworkGatewaysClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) {
+func (client VirtualNetworkGatewaysClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -172,32 +179,101 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
}
+// Generatevpnclientpackage the Generatevpnclientpackage operation generates
+// Vpn client package for P2S client of the virtual network gateway in the
+// specified resource group through Network resource provider.
+//
+// resourceGroupName is the name of the resource group.
+// virtualNetworkGatewayName is the name of the virtual network gateway.
+// parameters is parameters supplied to the Begin Generating Virtual Network
+// Gateway Vpn client package operation through Network resource provider.
+func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) {
+ req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GeneratevpnclientpackageSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure sending request")
+ }
+
+ result, err = client.GeneratevpnclientpackageResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request.
+func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the
+// http.Response Body if it receives an error.
+func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always
+// closes the http.Response Body.
+func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
// Get the Get VirtualNetworkGateway operation retrieves information about the
// specified virtual network gateway through Network resource provider.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway.
-func (client VirtualNetworkGatewaysClient) Get(resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, ae error) {
+func (client VirtualNetworkGatewaysClient) Get(resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) {
req, err := client.GetPreparer(resourceGroupName, virtualNetworkGatewayName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request")
}
return
@@ -206,28 +282,27 @@
// GetPreparer prepares the Get request.
func (client VirtualNetworkGatewaysClient) GetPreparer(resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -236,7 +311,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +322,21 @@
// network gateways stored.
//
// resourceGroupName is the name of the resource group.
-func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (result VirtualNetworkGatewayListResult, ae error) {
+func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (result VirtualNetworkGatewayListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request")
}
return
@@ -270,27 +345,26 @@
// ListPreparer prepares the List request.
func (client VirtualNetworkGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -299,7 +373,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -307,10 +381,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, ae error) {
+func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) {
req, err := lastResults.VirtualNetworkGatewayListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -319,82 +393,85 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to next results request request")
}
return
}
// Reset the Reset VirtualNetworkGateway operation resets the primary of the
-// virtual network gatewayin the specified resource group through Network
-// resource provider.
+// virtual network gateway in the specified resource group through Network
+// resource provider. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway.
// parameters is parameters supplied to the Begin Reset Virtual Network
// Gateway operation through Network resource provider.
-func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGateway, ae error) {
- req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, parameters)
+func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Reset", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request")
}
resp, err := client.ResetSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Reset", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", resp, "Failure sending request")
}
result, err = client.ResetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworkGatewaysClient", "Reset", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", resp, "Failure responding to request")
}
return
}
// ResetPreparer prepares the Reset request.
-func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) {
+func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}/reset"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ResetSender sends the Reset request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ResetResponder handles the response to the Reset request. The method always
// closes the http.Response Body.
-func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) {
+func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,20 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// VirtualNetworksClient is the the Windows Azure Network management API
-// provides a RESTful set of web services that interact with Windows Azure
+// VirtualNetworksClient is the the Microsoft Azure Network management API
+// provides a RESTful set of web services that interact with Microsoft Azure
// Networks service to manage your network resrources. The API has entities
-// that capture the relationship between an end user and the Windows Azure
+// that capture the relationship between an end user and the Microsoft Azure
// Networks service.
type VirtualNetworksClient struct {
ManagementClient
@@ -46,122 +46,129 @@
}
// CreateOrUpdate the Put VirtualNetwork operation creates/updates a virtual
-// network in the specified resource group.
+// network in the specified resource group. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. parameters is parameters supplied to the
// create/update Virtual Network operation
-func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (result VirtualNetwork, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, parameters)
+func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "CreateOrUpdate", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualNetworksClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (*http.Request, error) {
+func (client VirtualNetworksClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
-func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetwork, err error) {
+func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// Delete the Delete VirtualNetwork operation deletes the specifed virtual
-// network
+// network This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network.
-func (client VirtualNetworksClient) Delete(resourceGroupName string, virtualNetworkName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, virtualNetworkName)
+func (client VirtualNetworksClient) Delete(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, virtualNetworkName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client VirtualNetworksClient) DeletePreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) {
+func (client VirtualNetworksClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -170,7 +177,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusNoContent, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -180,52 +187,54 @@
// specified virtual network.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
-// the name of the virtual network.
-func (client VirtualNetworksClient) Get(resourceGroupName string, virtualNetworkName string) (result VirtualNetwork, ae error) {
- req, err := client.GetPreparer(resourceGroupName, virtualNetworkName)
+// the name of the virtual network. expand is expand references resources.
+func (client VirtualNetworksClient) Get(resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) {
+ req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, expand)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
-func (client VirtualNetworksClient) GetPreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) {
+func (client VirtualNetworksClient) GetPreparer(resourceGroupName string, virtualNetworkName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "virtualNetworkName": url.QueryEscape(virtualNetworkName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(expand) > 0 {
+ queryParameters["$expand"] = autorest.Encode("query", expand)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -234,7 +243,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -245,21 +254,21 @@
// group
//
// resourceGroupName is the name of the resource group.
-func (client VirtualNetworksClient) List(resourceGroupName string) (result VirtualNetworkListResult, ae error) {
+func (client VirtualNetworksClient) List(resourceGroupName string) (result VirtualNetworkListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to request")
}
return
@@ -268,27 +277,26 @@
// ListPreparer prepares the List request.
func (client VirtualNetworksClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -297,7 +305,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -305,10 +313,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client VirtualNetworksClient) ListNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, ae error) {
+func (client VirtualNetworksClient) ListNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) {
req, err := lastResults.VirtualNetworkListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -317,12 +325,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -330,21 +338,21 @@
// ListAll the list VirtualNetwork returns all Virtual Networks in a
// subscription
-func (client VirtualNetworksClient) ListAll() (result VirtualNetworkListResult, ae error) {
+func (client VirtualNetworksClient) ListAll() (result VirtualNetworkListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing request")
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to request")
}
return
@@ -353,26 +361,25 @@
// ListAllPreparer prepares the ListAll request.
func (client VirtualNetworksClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListAllResponder handles the response to the ListAll request. The method always
@@ -381,7 +388,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -389,10 +396,10 @@
}
// ListAllNextResults retrieves the next set of results, if any.
-func (client VirtualNetworksClient) ListAllNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, ae error) {
+func (client VirtualNetworksClient) ListAllNextResults(lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) {
req, err := lastResults.VirtualNetworkListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -401,12 +408,12 @@
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending next results request request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "network/VirtualNetworksClient", "ListAll", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to next results request request")
}
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,831 @@
+// Package notificationhubs implements the Azure ARM Notificationhubs service
+// API version 2014-09-01.
+//
+// Azure NotificationHub client
+package notificationhubs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Notificationhubs
+ APIVersion = "2014-09-01"
+
+ // DefaultBaseURI is the default URI used for the service Notificationhubs
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Notificationhubs.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
+
+// CheckAvailability checks the availability of the given notificationHub in a
+// namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. parameters is the notificationHub name.
+func (client ManagementClient) CheckAvailability(resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (result CheckAvailabilityResource, err error) {
+ req, err := client.CheckAvailabilityPreparer(resourceGroupName, namespaceName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CheckAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CheckAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CheckAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckAvailabilityPreparer prepares the CheckAvailability request.
+func (client ManagementClient) CheckAvailabilityPreparer(resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckAvailabilitySender sends the CheckAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) CheckAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) CheckAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdate creates/Update a NotificationHub in a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// parameters is parameters supplied to the create/update a NotificationHub
+// Resource.
+func (client ManagementClient) CreateOrUpdate(resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters) (result NotificationHubResource, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, namespaceName, notificationHubName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) CreateOrUpdateResponder(resp *http.Response) (result NotificationHubResource, 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
+}
+
+// CreateOrUpdateAuthorizationRule creates/Updates an authorization rule for a
+// NotificationHub
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is authorization Rule Name. parameters is the shared
+// access authorization rule.
+func (client ManagementClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.CreateOrUpdateAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdateAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdateAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "CreateOrUpdateAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
+func (client ManagementClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAuthorizationRuleSender sends the CreateOrUpdateAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) CreateOrUpdateAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a notification hub associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client ManagementClient) Delete(resourceGroupName string, namespaceName string, notificationHubName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ManagementClient) DeletePreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) 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
+}
+
+// DeleteAuthorizationRule deletes a notificationHub authorization rule
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is authorization Rule Name.
+func (client ManagementClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "DeleteAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "DeleteAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "DeleteAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAuthorizationRulePreparer prepares the DeleteAuthorizationRule request.
+func (client ManagementClient) DeleteAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAuthorizationRuleSender sends the DeleteAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) DeleteAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAuthorizationRuleResponder handles the response to the DeleteAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) DeleteAuthorizationRuleResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get lists the notification hubs associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client ManagementClient) Get(resourceGroupName string, namespaceName string, notificationHubName string) (result NotificationHubResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ManagementClient) GetPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetResponder(resp *http.Response) (result NotificationHubResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAuthorizationRule gets an authorization rule for a NotificationHub by
+// name.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name notificationHubName is the notification hub name.
+// authorizationRuleName is authorization rule name.
+func (client ManagementClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAuthorizationRulePreparer prepares the GetAuthorizationRule request.
+func (client ManagementClient) GetAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAuthorizationRuleSender sends the GetAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetPnsCredentials lists the PNS Credentials associated with a notification
+// hub .
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client ManagementClient) GetPnsCredentials(resourceGroupName string, namespaceName string, notificationHubName string) (result NotificationHubResource, err error) {
+ req, err := client.GetPnsCredentialsPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetPnsCredentials", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetPnsCredentialsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetPnsCredentials", resp, "Failure sending request")
+ }
+
+ result, err = client.GetPnsCredentialsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "GetPnsCredentials", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPnsCredentialsPreparer prepares the GetPnsCredentials request.
+func (client ManagementClient) GetPnsCredentialsPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetPnsCredentialsSender sends the GetPnsCredentials request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetPnsCredentialsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetPnsCredentialsResponder handles the response to the GetPnsCredentials request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetPnsCredentialsResponder(resp *http.Response) (result NotificationHubResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List lists the notification hubs associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client ManagementClient) List(resourceGroupName string, namespaceName string) (result NotificationHubListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ManagementClient) ListPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListResponder(resp *http.Response) (result NotificationHubListResult, 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 ManagementClient) ListNextResults(lastResults NotificationHubListResult) (result NotificationHubListResult, err error) {
+ req, err := lastResults.NotificationHubListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAuthorizationRules gets the authorization rules for a NotificationHub.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name notificationHubName is the notification hub name.
+func (client ManagementClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, notificationHubName string) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAuthorizationRulesPreparer prepares the ListAuthorizationRules request.
+func (client ManagementClient) ListAuthorizationRulesPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAuthorizationRulesSender sends the ListAuthorizationRules request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListAuthorizationRulesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
+func (client ManagementClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListAuthorizationRules", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListKeys gets the Primary and Secondary ConnectionStrings to the
+// NotificationHub
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is the connection string of the NotificationHub for
+// the specified authorizationRule.
+func (client ManagementClient) ListKeys(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result ResourceListKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.ManagementClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client ManagementClient) ListKeysPreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,321 @@
+package notificationhubs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// AccessRights enumerates the values for access rights.
+type AccessRights string
+
+const (
+ // Listen specifies the listen state for access rights.
+ Listen AccessRights = "Listen"
+ // Manage specifies the manage state for access rights.
+ Manage AccessRights = "Manage"
+ // Send specifies the send state for access rights.
+ Send AccessRights = "Send"
+)
+
+// NamespaceType enumerates the values for namespace type.
+type NamespaceType string
+
+const (
+ // Messaging specifies the messaging state for namespace type.
+ Messaging NamespaceType = "Messaging"
+ // NotificationHub specifies the notification hub state for namespace type.
+ NotificationHub NamespaceType = "NotificationHub"
+)
+
+// AdmCredential is description of a NotificationHub AdmCredential.
+type AdmCredential struct {
+ Properties *AdmCredentialProperties `json:"properties,omitempty"`
+}
+
+// AdmCredentialProperties is description of a NotificationHub AdmCredential.
+type AdmCredentialProperties struct {
+ ClientID *string `json:"clientId,omitempty"`
+ ClientSecret *string `json:"clientSecret,omitempty"`
+ AuthTokenURL *string `json:"authTokenUrl,omitempty"`
+}
+
+// ApnsCredential is description of a NotificationHub ApnsCredential.
+type ApnsCredential struct {
+ Properties *ApnsCredentialProperties `json:"properties,omitempty"`
+}
+
+// ApnsCredentialProperties is description of a NotificationHub ApnsCredential.
+type ApnsCredentialProperties struct {
+ ApnsCertificate *string `json:"apnsCertificate,omitempty"`
+ CertificateKey *string `json:"certificateKey,omitempty"`
+ Endpoint *string `json:"endpoint,omitempty"`
+ Thumbprint *string `json:"thumbprint,omitempty"`
+}
+
+// BaiduCredential is description of a NotificationHub BaiduCredential.
+type BaiduCredential struct {
+ Properties *BaiduCredentialProperties `json:"properties,omitempty"`
+}
+
+// BaiduCredentialProperties is description of a NotificationHub
+// BaiduCredential.
+type BaiduCredentialProperties struct {
+ BaiduAPIKey *string `json:"baiduApiKey,omitempty"`
+ BaiduEndPoint *string `json:"baiduEndPoint,omitempty"`
+ BaiduSecretKey *string `json:"baiduSecretKey,omitempty"`
+}
+
+// CheckAvailabilityParameters is parameters supplied to the Check Name
+// Availability for Namespace and NotificationHubs.
+type CheckAvailabilityParameters struct {
+ Name *string `json:"name,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ IsAvailiable *bool `json:"isAvailiable,omitempty"`
+}
+
+// CheckAvailabilityResource is description of a CheckAvailibility resource.
+type CheckAvailabilityResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ IsAvailiable *bool `json:"isAvailiable,omitempty"`
+}
+
+// GcmCredential is description of a NotificationHub GcmCredential.
+type GcmCredential struct {
+ Properties *GcmCredentialProperties `json:"properties,omitempty"`
+}
+
+// GcmCredentialProperties is description of a NotificationHub GcmCredential.
+type GcmCredentialProperties struct {
+ GcmEndpoint *string `json:"gcmEndpoint,omitempty"`
+ GoogleAPIKey *string `json:"googleApiKey,omitempty"`
+}
+
+// MpnsCredential is description of a NotificationHub MpnsCredential.
+type MpnsCredential struct {
+ Properties *MpnsCredentialProperties `json:"properties,omitempty"`
+}
+
+// MpnsCredentialProperties is description of a NotificationHub MpnsCredential.
+type MpnsCredentialProperties struct {
+ MpnsCertificate *string `json:"mpnsCertificate,omitempty"`
+ CertificateKey *string `json:"certificateKey,omitempty"`
+ Thumbprint *string `json:"thumbprint,omitempty"`
+}
+
+// NamespaceCreateOrUpdateParameters is parameters supplied to the
+// CreateOrUpdate Namespace operation.
+type NamespaceCreateOrUpdateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *NamespaceProperties `json:"properties,omitempty"`
+}
+
+// NamespaceListResult is the response of the List Namespace operation.
+type NamespaceListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]NamespaceResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// NamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// NamespaceProperties is namespace properties.
+type NamespaceProperties struct {
+ Name *string `json:"name,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ Region *string `json:"region,omitempty"`
+ Status *string `json:"status,omitempty"`
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+ ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"`
+ SubscriptionID *string `json:"subscriptionId,omitempty"`
+ ScaleUnit *string `json:"scaleUnit,omitempty"`
+ Enabled *bool `json:"enabled,omitempty"`
+ Critical *bool `json:"critical,omitempty"`
+ NamespaceType NamespaceType `json:"namespaceType,omitempty"`
+}
+
+// NamespaceResource is description of a Namespace resource.
+type NamespaceResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *NamespaceProperties `json:"properties,omitempty"`
+}
+
+// NotificationHubCreateOrUpdateParameters is parameters supplied to the
+// CreateOrUpdate NotificationHub operation.
+type NotificationHubCreateOrUpdateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *NotificationHubProperties `json:"properties,omitempty"`
+}
+
+// NotificationHubListResult is the response of the List NotificationHub
+// operation.
+type NotificationHubListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]NotificationHubResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// NotificationHubListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client NotificationHubListResult) NotificationHubListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// NotificationHubProperties is notificationHub properties.
+type NotificationHubProperties struct {
+ Name *string `json:"name,omitempty"`
+ RegistrationTTL *string `json:"registrationTtl,omitempty"`
+ AuthorizationRules *[]SharedAccessAuthorizationRuleProperties `json:"authorizationRules,omitempty"`
+ ApnsCredential *ApnsCredential `json:"apnsCredential,omitempty"`
+ WnsCredential *WnsCredential `json:"wnsCredential,omitempty"`
+ GcmCredential *GcmCredential `json:"gcmCredential,omitempty"`
+ MpnsCredential *MpnsCredential `json:"mpnsCredential,omitempty"`
+ AdmCredential *AdmCredential `json:"admCredential,omitempty"`
+ BaiduCredential *BaiduCredential `json:"baiduCredential,omitempty"`
+}
+
+// NotificationHubResource is description of a NotificationHub Resource.
+type NotificationHubResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *NotificationHubProperties `json:"properties,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceListKeys is namespace/NotificationHub Connection String
+type ResourceListKeys struct {
+ autorest.Response `json:"-"`
+ PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"`
+ SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters
+// supplied to the CreateOrUpdate Namespace AuthorizationRules.
+type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleListResult is the response of the List
+// Namespace operation.
+type SharedAccessAuthorizationRuleListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]SharedAccessAuthorizationRuleResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client SharedAccessAuthorizationRuleListResult) SharedAccessAuthorizationRuleListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// SharedAccessAuthorizationRuleProperties is sharedAccessAuthorizationRule
+// properties.
+type SharedAccessAuthorizationRuleProperties struct {
+ PrimaryKey *string `json:"primaryKey,omitempty"`
+ SecondaryKey *string `json:"secondaryKey,omitempty"`
+ KeyName *string `json:"keyName,omitempty"`
+ ClaimType *string `json:"claimType,omitempty"`
+ ClaimValue *string `json:"claimValue,omitempty"`
+ Rights *[]AccessRights `json:"rights,omitempty"`
+ CreatedTime *date.Time `json:"createdTime,omitempty"`
+ ModifiedTime *date.Time `json:"modifiedTime,omitempty"`
+ Revision *int32 `json:"revision,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleResource is description of a Namespace
+// AuthorizationRules.
+type SharedAccessAuthorizationRuleResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
+}
+
+// SubResource is
+type SubResource struct {
+ ID *string `json:"id,omitempty"`
+}
+
+// WnsCredential is description of a NotificationHub WnsCredential.
+type WnsCredential struct {
+ Properties *WnsCredentialProperties `json:"properties,omitempty"`
+}
+
+// WnsCredentialProperties is description of a NotificationHub WnsCredential.
+type WnsCredentialProperties struct {
+ PackageSid *string `json:"packageSid,omitempty"`
+ SecretKey *string `json:"secretKey,omitempty"`
+ WindowsLiveEndpoint *string `json:"windowsLiveEndpoint,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/namespaces.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/namespaces.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/namespaces.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/namespaces.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,876 @@
+package notificationhubs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// NamespacesClient is the azure NotificationHub client
+type NamespacesClient struct {
+ ManagementClient
+}
+
+// NewNamespacesClient creates an instance of the NamespacesClient client.
+func NewNamespacesClient(subscriptionID string) NamespacesClient {
+ return NewNamespacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewNamespacesClientWithBaseURI creates an instance of the NamespacesClient
+// client.
+func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
+ return NamespacesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckAvailability checks the availability of the given service namespace
+// across all Windows Azure subscriptions. This is useful because the domain
+// name is created based on the service namespace name.
+//
+// parameters is the namespace name.
+func (client NamespacesClient) CheckAvailability(parameters CheckAvailabilityParameters) (result CheckAvailabilityResource, err error) {
+ req, err := client.CheckAvailabilityPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CheckAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CheckAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CheckAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckAvailabilityPreparer prepares the CheckAvailability request.
+func (client NamespacesClient) CheckAvailabilityPreparer(parameters CheckAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckAvailabilitySender sends the CheckAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CheckAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CheckAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdate creates/Updates a service namespace. Once created, this
+// namespace's resource manifest is immutable. This operation is idempotent.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. parameters is parameters supplied to create a Namespace
+// Resource.
+func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters) (result NamespaceResource, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, namespaceName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client NamespacesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (result NamespaceResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdateAuthorizationRule creates an authorization rule for a
+// namespace
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is aauthorization Rule Name.
+// parameters is the shared access authorization rule.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.CreateOrUpdateAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdateAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAuthorizationRuleSender sends the CreateOrUpdateAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an existing namespace. This operation also removes all
+// associated notificationHubs under the namespace. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client NamespacesClient) Delete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, namespaceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client NamespacesClient) DeletePreparer(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteAuthorizationRule deletes a namespace authorization rule
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is authorization Rule Name.
+func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "DeleteAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "DeleteAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "DeleteAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAuthorizationRulePreparer prepares the DeleteAuthorizationRule request.
+func (client NamespacesClient) DeleteAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAuthorizationRuleSender sends the DeleteAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) DeleteAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAuthorizationRuleResponder handles the response to the DeleteAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get returns the description for the specified namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result NamespaceResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client NamespacesClient) GetPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) GetResponder(resp *http.Response) (result NamespaceResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAuthorizationRule gets an authorization rule for a namespace by name.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name authorizationRuleName is authorization rule name.
+func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAuthorizationRulePreparer prepares the GetAuthorizationRule request.
+func (client NamespacesClient) GetAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAuthorizationRuleSender sends the GetAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) GetAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetLongRunningOperationStatus the Get Operation Status operation returns
+// the status of the specified operation. After calling an asynchronous
+// operation, you can call Get Operation Status to determine whether the
+// operation has succeeded, failed, or is still in progress.
+//
+// operationStatusLink is location value returned by the Begin operation.
+func (client NamespacesClient) GetLongRunningOperationStatus(operationStatusLink string) (result autorest.Response, err error) {
+ req, err := client.GetLongRunningOperationStatusPreparer(operationStatusLink)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetLongRunningOperationStatus", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetLongRunningOperationStatusSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetLongRunningOperationStatus", resp, "Failure sending request")
+ }
+
+ result, err = client.GetLongRunningOperationStatusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "GetLongRunningOperationStatus", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetLongRunningOperationStatusPreparer prepares the GetLongRunningOperationStatus request.
+func (client NamespacesClient) GetLongRunningOperationStatusPreparer(operationStatusLink string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "operationStatusLink": operationStatusLink,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{operationStatusLink}", pathParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetLongRunningOperationStatusSender sends the GetLongRunningOperationStatus request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) GetLongRunningOperationStatusSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetLongRunningOperationStatusResponder handles the response to the GetLongRunningOperationStatus request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) GetLongRunningOperationStatusResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNotFound, http.StatusAccepted, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// List lists the available namespaces within a resourceGroup.
+//
+// resourceGroupName is the name of the resource group. If resourceGroupName
+// value is null the method lists all the namespaces within subscription
+func (client NamespacesClient) List(resourceGroupName string) (result NamespaceListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client NamespacesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListResponder(resp *http.Response) (result NamespaceListResult, 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 NamespacesClient) ListNextResults(lastResults NamespaceListResult) (result NamespaceListResult, err error) {
+ req, err := lastResults.NamespaceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAll lists all the available namespaces within the subscription
+// irrespective of the resourceGroups.
+func (client NamespacesClient) ListAll() (result NamespaceListResult, err error) {
+ req, err := client.ListAllPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAllPreparer prepares the ListAll request.
+func (client NamespacesClient) ListAllPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAllSender sends the ListAll request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListAllSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAllResponder handles the response to the ListAll request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListAllResponder(resp *http.Response) (result NamespaceListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAllNextResults retrieves the next set of results, if any.
+func (client NamespacesClient) ListAllNextResults(lastResults NamespaceListResult) (result NamespaceListResult, err error) {
+ req, err := lastResults.NamespaceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAll", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAuthorizationRules gets the authorization rules for a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name
+func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAuthorizationRulesPreparer prepares the ListAuthorizationRules request.
+func (client NamespacesClient) ListAuthorizationRulesPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAuthorizationRulesSender sends the ListAuthorizationRules request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListAuthorizationRulesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
+func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListAuthorizationRules", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListKeys gets the Primary and Secondary ConnectionStrings to the namespace
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is the connection string of the
+// namespace for the specified authorizationRule.
+func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result ResourceListKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.NamespacesClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client NamespacesClient) ListKeysPreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/notificationhubs.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/notificationhubs.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/notificationhubs.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/notificationhubs.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,811 @@
+package notificationhubs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// Client is the azure NotificationHub client
+type Client struct {
+ ManagementClient
+}
+
+// NewClient creates an instance of the Client client.
+func NewClient(subscriptionID string) Client {
+ return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewClientWithBaseURI creates an instance of the Client client.
+func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
+ return Client{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckAvailability checks the availability of the given notificationHub in a
+// namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. parameters is the notificationHub name.
+func (client Client) CheckAvailability(resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (result CheckAvailabilityResource, err error) {
+ req, err := client.CheckAvailabilityPreparer(resourceGroupName, namespaceName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CheckAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CheckAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "CheckAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckAvailabilityPreparer prepares the CheckAvailability request.
+func (client Client) CheckAvailabilityPreparer(resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckAvailabilitySender sends the CheckAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) CheckAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always
+// closes the http.Response Body.
+func (client Client) CheckAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdate creates/Update a NotificationHub in a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// parameters is parameters supplied to the create/update a NotificationHub
+// Resource.
+func (client Client) CreateOrUpdate(resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters) (result NotificationHubResource, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, namespaceName, notificationHubName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client Client) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, notificationHubName string, parameters NotificationHubCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client Client) CreateOrUpdateResponder(resp *http.Response) (result NotificationHubResource, 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
+}
+
+// CreateOrUpdateAuthorizationRule creates/Updates an authorization rule for a
+// NotificationHub
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is authorization Rule Name. parameters is the shared
+// access authorization rule.
+func (client Client) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.CreateOrUpdateAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdateAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdateAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "CreateOrUpdateAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
+func (client Client) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAuthorizationRuleSender sends the CreateOrUpdateAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) CreateOrUpdateAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client Client) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a notification hub associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client Client) Delete(resourceGroupName string, namespaceName string, notificationHubName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client Client) DeletePreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteAuthorizationRule deletes a notificationHub authorization rule
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is authorization Rule Name.
+func (client Client) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "DeleteAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "DeleteAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "DeleteAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAuthorizationRulePreparer prepares the DeleteAuthorizationRule request.
+func (client Client) DeleteAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAuthorizationRuleSender sends the DeleteAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) DeleteAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAuthorizationRuleResponder handles the response to the DeleteAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client Client) DeleteAuthorizationRuleResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get lists the notification hubs associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client Client) Get(resourceGroupName string, namespaceName string, notificationHubName string) (result NotificationHubResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client Client) GetPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client Client) GetResponder(resp *http.Response) (result NotificationHubResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAuthorizationRule gets an authorization rule for a NotificationHub by
+// name.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name notificationHubName is the notification hub name.
+// authorizationRuleName is authorization rule name.
+func (client Client) GetAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "GetAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "GetAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "GetAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAuthorizationRulePreparer prepares the GetAuthorizationRule request.
+func (client Client) GetAuthorizationRulePreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAuthorizationRuleSender sends the GetAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client Client) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetPnsCredentials lists the PNS Credentials associated with a notification
+// hub .
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+func (client Client) GetPnsCredentials(resourceGroupName string, namespaceName string, notificationHubName string) (result NotificationHubResource, err error) {
+ req, err := client.GetPnsCredentialsPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "GetPnsCredentials", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetPnsCredentialsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "GetPnsCredentials", resp, "Failure sending request")
+ }
+
+ result, err = client.GetPnsCredentialsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "GetPnsCredentials", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPnsCredentialsPreparer prepares the GetPnsCredentials request.
+func (client Client) GetPnsCredentialsPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetPnsCredentialsSender sends the GetPnsCredentials request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetPnsCredentialsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetPnsCredentialsResponder handles the response to the GetPnsCredentials request. The method always
+// closes the http.Response Body.
+func (client Client) GetPnsCredentialsResponder(resp *http.Response) (result NotificationHubResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List lists the notification hubs associated with a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client Client) List(resourceGroupName string, namespaceName string) (result NotificationHubListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client Client) ListPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client Client) ListResponder(resp *http.Response) (result NotificationHubListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client Client) ListNextResults(lastResults NotificationHubListResult) (result NotificationHubListResult, err error) {
+ req, err := lastResults.NotificationHubListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAuthorizationRules gets the authorization rules for a NotificationHub.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name notificationHubName is the notification hub name.
+func (client Client) ListAuthorizationRules(resourceGroupName string, namespaceName string, notificationHubName string) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName, notificationHubName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAuthorizationRulesPreparer prepares the ListAuthorizationRules request.
+func (client Client) ListAuthorizationRulesPreparer(resourceGroupName string, namespaceName string, notificationHubName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAuthorizationRulesSender sends the ListAuthorizationRules request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListAuthorizationRulesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
+// closes the http.Response Body.
+func (client Client) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
+func (client Client) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "ListAuthorizationRules", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListKeys gets the Primary and Secondary ConnectionStrings to the
+// NotificationHub
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. notificationHubName is the notification hub name.
+// authorizationRuleName is the connection string of the NotificationHub for
+// the specified authorizationRule.
+func (client Client) ListKeys(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result ResourceListKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "notificationhubs.Client", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "notificationhubs.Client", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client Client) ListKeysPreparer(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "notificationHubName": autorest.Encode("path", notificationHubName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client Client) ListKeysResponder(resp *http.Response) (result ResourceListKeys, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/notificationhubs/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package notificationhubs
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "notificationhubs", "2014-09-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,116 @@
+// Package powerbiembedded implements the Azure ARM Powerbiembedded service
+// API version 2016-01-29.
+//
+// Client to manage your Power BI embedded workspace collections and retrieve
+// workspaces.
+package powerbiembedded
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Powerbiembedded
+ APIVersion = "2016-01-29"
+
+ // DefaultBaseURI is the default URI used for the service Powerbiembedded
+ DefaultBaseURI = "http://management.azure.com"
+)
+
+// ManagementClient is the base client for Powerbiembedded.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
+
+// GetAvailableOperations indicates which operations can be performed by the
+// Power BI Resource Provider.
+func (client ManagementClient) GetAvailableOperations() (result OperationList, err error) {
+ req, err := client.GetAvailableOperationsPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.ManagementClient", "GetAvailableOperations", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAvailableOperationsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.ManagementClient", "GetAvailableOperations", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAvailableOperationsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.ManagementClient", "GetAvailableOperations", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAvailableOperationsPreparer prepares the GetAvailableOperations request.
+func (client ManagementClient) GetAvailableOperationsPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.PowerBI/operations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAvailableOperationsSender sends the GetAvailableOperations request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetAvailableOperationsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAvailableOperationsResponder handles the response to the GetAvailableOperations request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetAvailableOperationsResponder(resp *http.Response) (result OperationList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,162 @@
+package powerbiembedded
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// AccessKeyName enumerates the values for access key name.
+type AccessKeyName string
+
+const (
+ // Key1 specifies the key 1 state for access key name.
+ Key1 AccessKeyName = "key1"
+ // Key2 specifies the key 2 state for access key name.
+ Key2 AccessKeyName = "key2"
+)
+
+// CheckNameReason enumerates the values for check name reason.
+type CheckNameReason string
+
+const (
+ // Invalid specifies the invalid state for check name reason.
+ Invalid CheckNameReason = "Invalid"
+ // Unavailable specifies the unavailable state for check name reason.
+ Unavailable CheckNameReason = "Unavailable"
+)
+
+// AzureSku is
+type AzureSku struct {
+ Name *string `json:"name,omitempty"`
+ Tier *string `json:"tier,omitempty"`
+}
+
+// CheckNameRequest is
+type CheckNameRequest struct {
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// CheckNameResponse is
+type CheckNameResponse struct {
+ autorest.Response `json:"-"`
+ NameAvailable *bool `json:"nameAvailable,omitempty"`
+ Reason CheckNameReason `json:"reason,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// CreateWorkspaceCollectionRequest is
+type CreateWorkspaceCollectionRequest struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *AzureSku `json:"sku,omitempty"`
+}
+
+// Display is
+type Display struct {
+ Provider *string `json:"provider,omitempty"`
+ Resource *string `json:"resource,omitempty"`
+ Operation *string `json:"operation,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Origin *string `json:"origin,omitempty"`
+}
+
+// Error is
+type Error struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Target *string `json:"target,omitempty"`
+ Details *[]ErrorDetail `json:"details,omitempty"`
+}
+
+// ErrorDetail is
+type ErrorDetail struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Target *string `json:"target,omitempty"`
+}
+
+// MigrateWorkspaceCollectionRequest is
+type MigrateWorkspaceCollectionRequest struct {
+ TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
+ Resources *[]string `json:"resources,omitempty"`
+}
+
+// Operation is
+type Operation struct {
+ Name *string `json:"name,omitempty"`
+ Display *Display `json:"display,omitempty"`
+}
+
+// OperationList is
+type OperationList struct {
+ autorest.Response `json:"-"`
+ Value *[]Operation `json:"value,omitempty"`
+}
+
+// UpdateWorkspaceCollectionRequest is
+type UpdateWorkspaceCollectionRequest struct {
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *AzureSku `json:"sku,omitempty"`
+}
+
+// Workspace is
+type Workspace struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
+}
+
+// WorkspaceCollection is
+type WorkspaceCollection struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *AzureSku `json:"sku,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
+}
+
+// WorkspaceCollectionAccessKey is
+type WorkspaceCollectionAccessKey struct {
+ KeyName AccessKeyName `json:"keyName,omitempty"`
+}
+
+// WorkspaceCollectionAccessKeys is
+type WorkspaceCollectionAccessKeys struct {
+ autorest.Response `json:"-"`
+ Key1 *string `json:"key1,omitempty"`
+ Key2 *string `json:"key2,omitempty"`
+}
+
+// WorkspaceCollectionList is
+type WorkspaceCollectionList struct {
+ autorest.Response `json:"-"`
+ Value *[]WorkspaceCollection `json:"value,omitempty"`
+}
+
+// WorkspaceList is
+type WorkspaceList struct {
+ autorest.Response `json:"-"`
+ Value *[]Workspace `json:"value,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package powerbiembedded
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "powerbiembedded", "2016-01-29")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspacecollections.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspacecollections.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspacecollections.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspacecollections.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,688 @@
+package powerbiembedded
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// WorkspaceCollectionsClient is the client to manage your Power BI embedded
+// workspace collections and retrieve workspaces.
+type WorkspaceCollectionsClient struct {
+ ManagementClient
+}
+
+// NewWorkspaceCollectionsClient creates an instance of the
+// WorkspaceCollectionsClient client.
+func NewWorkspaceCollectionsClient(subscriptionID string) WorkspaceCollectionsClient {
+ return NewWorkspaceCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWorkspaceCollectionsClientWithBaseURI creates an instance of the
+// WorkspaceCollectionsClient client.
+func NewWorkspaceCollectionsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceCollectionsClient {
+ return WorkspaceCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckNameAvailability check that the specified Power BI Workspace
+// Collection name is valid and not in use.
+//
+// location is azure location body is check name availability request
+func (client WorkspaceCollectionsClient) CheckNameAvailability(location string, body CheckNameRequest) (result CheckNameResponse, err error) {
+ req, err := client.CheckNameAvailabilityPreparer(location, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "CheckNameAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "CheckNameAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "CheckNameAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client WorkspaceCollectionsClient) CheckNameAvailabilityPreparer(location string, body CheckNameRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Create creates a new Power BI Workspace Collection with the specified
+// properties. A Power BI Workspace Collection contains one or more Power BI
+// Workspaces and can be used to provision keys that provide API access to
+// those Power BI Workspaces.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name body is create workspace collection
+// request
+func (client WorkspaceCollectionsClient) Create(resourceGroupName string, workspaceCollectionName string, body CreateWorkspaceCollectionRequest) (result WorkspaceCollection, err error) {
+ req, err := client.CreatePreparer(resourceGroupName, workspaceCollectionName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client WorkspaceCollectionsClient) CreatePreparer(resourceGroupName string, workspaceCollectionName string, body CreateWorkspaceCollectionRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) CreateResponder(resp *http.Response) (result WorkspaceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete a Power BI Workspace Collection. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name
+func (client WorkspaceCollectionsClient) Delete(resourceGroupName string, workspaceCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, workspaceCollectionName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client WorkspaceCollectionsClient) DeletePreparer(resourceGroupName string, workspaceCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// GetAccessKeys retrieves the primary and secondary access keys for the
+// specified Power BI Workspace Collection.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name
+func (client WorkspaceCollectionsClient) GetAccessKeys(resourceGroupName string, workspaceCollectionName string) (result WorkspaceCollectionAccessKeys, err error) {
+ req, err := client.GetAccessKeysPreparer(resourceGroupName, workspaceCollectionName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetAccessKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAccessKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetAccessKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAccessKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetAccessKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAccessKeysPreparer prepares the GetAccessKeys request.
+func (client WorkspaceCollectionsClient) GetAccessKeysPreparer(resourceGroupName string, workspaceCollectionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAccessKeysSender sends the GetAccessKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) GetAccessKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAccessKeysResponder handles the response to the GetAccessKeys request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) GetAccessKeysResponder(resp *http.Response) (result WorkspaceCollectionAccessKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByName retrieves an existing Power BI Workspace Collection.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name
+func (client WorkspaceCollectionsClient) GetByName(resourceGroupName string, workspaceCollectionName string) (result WorkspaceCollection, err error) {
+ req, err := client.GetByNamePreparer(resourceGroupName, workspaceCollectionName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetByName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetByName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "GetByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByNamePreparer prepares the GetByName request.
+func (client WorkspaceCollectionsClient) GetByNamePreparer(resourceGroupName string, workspaceCollectionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByNameSender sends the GetByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) GetByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByNameResponder handles the response to the GetByName request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) GetByNameResponder(resp *http.Response) (result WorkspaceCollection, 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 retrieves all existing Power BI Workspace Collections
+// in the specified resource group.
+//
+// resourceGroupName is azure resource group
+func (client WorkspaceCollectionsClient) ListByResourceGroup(resourceGroupName string) (result WorkspaceCollectionList, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client WorkspaceCollectionsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceCollectionList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListBySubscription retrieves all existing Power BI Workspace Collections in
+// the specified subscription.
+func (client WorkspaceCollectionsClient) ListBySubscription() (result WorkspaceCollectionList, err error) {
+ req, err := client.ListBySubscriptionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListBySubscription", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListBySubscription", resp, "Failure sending request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client WorkspaceCollectionsClient) ListBySubscriptionPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceCollectionList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Migrate migrates an existing Power BI Workspace Collection to a different
+// resource group and/or subscription.
+//
+// resourceGroupName is azure resource group body is workspace migration
+// request
+func (client WorkspaceCollectionsClient) Migrate(resourceGroupName string, body MigrateWorkspaceCollectionRequest) (result autorest.Response, err error) {
+ req, err := client.MigratePreparer(resourceGroupName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Migrate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.MigrateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Migrate", resp, "Failure sending request")
+ }
+
+ result, err = client.MigrateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Migrate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// MigratePreparer prepares the Migrate request.
+func (client WorkspaceCollectionsClient) MigratePreparer(resourceGroupName string, body MigrateWorkspaceCollectionRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// MigrateSender sends the Migrate request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) MigrateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// MigrateResponder handles the response to the Migrate request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) MigrateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// RegenerateKey regenerates the primary or secondary access key for the
+// specified Power BI Workspace Collection.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name body is access key to regenerate
+func (client WorkspaceCollectionsClient) RegenerateKey(resourceGroupName string, workspaceCollectionName string, body WorkspaceCollectionAccessKey) (result WorkspaceCollectionAccessKeys, err error) {
+ req, err := client.RegenerateKeyPreparer(resourceGroupName, workspaceCollectionName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "RegenerateKey", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegenerateKeySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "RegenerateKey", resp, "Failure sending request")
+ }
+
+ result, err = client.RegenerateKeyResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "RegenerateKey", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegenerateKeyPreparer prepares the RegenerateKey request.
+func (client WorkspaceCollectionsClient) RegenerateKeyPreparer(resourceGroupName string, workspaceCollectionName string, body WorkspaceCollectionAccessKey) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegenerateKeySender sends the RegenerateKey request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) RegenerateKeyResponder(resp *http.Response) (result WorkspaceCollectionAccessKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update an existing Power BI Workspace Collection with the specified
+// properties.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name body is update workspace collection
+// request
+func (client WorkspaceCollectionsClient) Update(resourceGroupName string, workspaceCollectionName string, body UpdateWorkspaceCollectionRequest) (result WorkspaceCollection, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, workspaceCollectionName, body)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspaceCollectionsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client WorkspaceCollectionsClient) UpdatePreparer(resourceGroupName string, workspaceCollectionName string, body UpdateWorkspaceCollectionRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspaceCollectionsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client WorkspaceCollectionsClient) UpdateResponder(resp *http.Response) (result WorkspaceCollection, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspaces.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspaces.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspaces.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/powerbiembedded/workspaces.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,106 @@
+package powerbiembedded
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// WorkspacesClient is the client to manage your Power BI embedded workspace
+// collections and retrieve workspaces.
+type WorkspacesClient struct {
+ ManagementClient
+}
+
+// NewWorkspacesClient creates an instance of the WorkspacesClient client.
+func NewWorkspacesClient(subscriptionID string) WorkspacesClient {
+ return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient
+// client.
+func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient {
+ return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List retrieves all existing Power BI Workspaces in the specified Workspace
+// Collection.
+//
+// resourceGroupName is azure resource group workspaceCollectionName is power
+// BI Embedded workspace collection name
+func (client WorkspacesClient) List(resourceGroupName string, workspaceCollectionName string) (result WorkspaceList, err error) {
+ req, err := client.ListPreparer(resourceGroupName, workspaceCollectionName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspacesClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "powerbiembedded.WorkspacesClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "powerbiembedded.WorkspacesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client WorkspacesClient) ListPreparer(resourceGroupName string, workspaceCollectionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workspaceCollectionName": autorest.Encode("path", workspaceCollectionName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client WorkspacesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client WorkspacesClient) ListResponder(resp *http.Response) (result WorkspaceList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/README.md juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/README.md
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/README.md 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/README.md 2016-10-13 14:32:06.000000000 +0000
@@ -118,7 +118,7 @@
ac := storage.NewAccountsClient(c["subscriptionID"])
- spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.AzureResourceManagerScope)
+ spt, err := helpers.NewServicePrincipalTokenFromCredentials(c, azure.PublicCloud.ResourceManagerEndpoint)
if err != nil {
log.Fatalf("Error: %v", err)
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,6 @@
+// Package redis implements the Azure ARM Redis service API version 2016-04-01.
+//
+// REST API for Azure Redis Cache Service
package redis
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,29 +17,29 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
const (
// APIVersion is the version of the Redis
- APIVersion = "2015-08-01"
+ APIVersion = "2016-04-01"
// DefaultBaseURI is the default URI used for the service Redis
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the .Net client wrapper for the REST API for Azure
-// Redis Cache Management Service
+// ManagementClient is the base client for Redis.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -50,6 +53,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
@@ -60,21 +64,21 @@
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache. parameters is parameters supplied to the CreateOrUpdate
// redis operation.
-func (client ManagementClient) CreateOrUpdate(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (result ResourceWithAccessKey, ae error) {
+func (client ManagementClient) CreateOrUpdate(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (result ResourceWithAccessKey, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -83,29 +87,29 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -114,7 +118,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -125,21 +129,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client ManagementClient) Delete(resourceGroupName string, name string) (result autorest.Response, ae error) {
+func (client ManagementClient) Delete(resourceGroupName string, name string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "Delete", resp, "Failure responding to request")
}
return
@@ -148,28 +152,27 @@
// DeletePreparer prepares the Delete request.
func (client ManagementClient) DeletePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -178,7 +181,140 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Export import data into redis cache. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is parameters for redis export operation.
+func (client ManagementClient) Export(resourceGroupName string, name string, parameters ExportRDBParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ExportPreparer(resourceGroupName, name, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Export", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ExportSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Export", resp, "Failure sending request")
+ }
+
+ result, err = client.ExportResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "Export", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ExportPreparer prepares the Export request.
+func (client ManagementClient) ExportPreparer(resourceGroupName string, name string, parameters ExportRDBParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ExportSender sends the Export request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ExportSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ExportResponder handles the response to the Export request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ExportResponder(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
+}
+
+// ForceReboot reboot specified redis node(s). This operation requires write
+// permission to the cache resource. There can be potential data loss.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is specifies which redis node(s) to reboot.
+func (client ManagementClient) ForceReboot(resourceGroupName string, name string, parameters RebootParameters) (result autorest.Response, err error) {
+ req, err := client.ForceRebootPreparer(resourceGroupName, name, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ForceReboot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ForceRebootSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ForceReboot", resp, "Failure sending request")
+ }
+
+ result, err = client.ForceRebootResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "ForceReboot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ForceRebootPreparer prepares the ForceReboot request.
+func (client ManagementClient) ForceRebootPreparer(resourceGroupName string, name string, parameters RebootParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ForceRebootSender sends the ForceReboot request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ForceRebootSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ForceRebootResponder handles the response to the ForceReboot request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ForceRebootResponder(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
@@ -188,21 +324,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client ManagementClient) Get(resourceGroupName string, name string) (result ResourceType, ae error) {
+func (client ManagementClient) Get(resourceGroupName string, name string) (result ResourceType, err error) {
req, err := client.GetPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "Get", resp, "Failure responding to request")
}
return
@@ -211,28 +347,27 @@
// GetPreparer prepares the Get request.
func (client ManagementClient) GetPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -241,29 +376,97 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// Import import data into redis cache. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is parameters for redis import operation.
+func (client ManagementClient) Import(resourceGroupName string, name string, parameters ImportRDBParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ImportPreparer(resourceGroupName, name, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Import", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ImportSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "Import", resp, "Failure sending request")
+ }
+
+ result, err = client.ImportResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "Import", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ImportPreparer prepares the Import request.
+func (client ManagementClient) ImportPreparer(resourceGroupName string, name string, parameters ImportRDBParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ImportSender sends the Import request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ImportSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ImportResponder handles the response to the Import request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ImportResponder(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
+}
+
// List gets all redis caches in the specified subscription.
-func (client ManagementClient) List() (result ListResult, ae error) {
+func (client ManagementClient) List() (result ListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "List", resp, "Failure responding to request")
}
return
@@ -272,26 +475,25 @@
// ListPreparer prepares the List request.
func (client ManagementClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -300,7 +502,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -308,10 +510,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client ManagementClient) ListNextResults(lastResults ListResult) (result ListResult, ae error) {
+func (client ManagementClient) ListNextResults(lastResults ListResult) (result ListResult, err error) {
req, err := lastResults.ListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -320,12 +522,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -334,21 +536,21 @@
// ListByResourceGroup gets all redis caches in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client ManagementClient) ListByResourceGroup(resourceGroupName string) (result ListResult, ae error) {
+func (client ManagementClient) ListByResourceGroup(resourceGroupName string) (result ListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", nil, "Failure preparing request")
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", resp, "Failure sending request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
@@ -357,27 +559,26 @@
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client ManagementClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
@@ -386,7 +587,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -394,10 +595,10 @@
}
// ListByResourceGroupNextResults retrieves the next set of results, if any.
-func (client ManagementClient) ListByResourceGroupNextResults(lastResults ListResult) (result ListResult, ae error) {
+func (client ManagementClient) ListByResourceGroupNextResults(lastResults ListResult) (result ListResult, err error) {
req, err := lastResults.ListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -406,12 +607,12 @@
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", resp, "Failure sending next results request request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "ListByResourceGroup", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
}
return
@@ -422,21 +623,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client ManagementClient) ListKeys(resourceGroupName string, name string) (result ListKeysResult, ae error) {
+func (client ManagementClient) ListKeys(resourceGroupName string, name string) (result ListKeysResult, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListKeys", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListKeys", nil, "Failure preparing request")
}
resp, err := client.ListKeysSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "ListKeys", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "ListKeys", resp, "Failure sending request")
}
result, err = client.ListKeysResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "ListKeys", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "ListKeys", resp, "Failure responding to request")
}
return
@@ -445,28 +646,27 @@
// ListKeysPreparer prepares the ListKeys request.
func (client ManagementClient) ListKeysPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListKeysSender sends the ListKeys request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) ListKeysSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListKeysResponder handles the response to the ListKeys request. The method always
@@ -475,7 +675,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -487,21 +687,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache. parameters is specifies which key to reset.
-func (client ManagementClient) RegenerateKey(resourceGroupName string, name string, parameters RegenerateKeyParameters) (result ListKeysResult, ae error) {
+func (client ManagementClient) RegenerateKey(resourceGroupName string, name string, parameters RegenerateKeyParameters) (result ListKeysResult, err error) {
req, err := client.RegenerateKeyPreparer(resourceGroupName, name, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "RegenerateKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "RegenerateKey", nil, "Failure preparing request")
}
resp, err := client.RegenerateKeySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/ManagementClient", "RegenerateKey", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.ManagementClient", "RegenerateKey", resp, "Failure sending request")
}
result, err = client.RegenerateKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/ManagementClient", "RegenerateKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.ManagementClient", "RegenerateKey", resp, "Failure responding to request")
}
return
@@ -510,29 +710,29 @@
// RegenerateKeyPreparer prepares the RegenerateKey request.
func (client ManagementClient) RegenerateKeyPreparer(resourceGroupName string, name string, parameters RegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RegenerateKeySender sends the RegenerateKey request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
@@ -541,7 +741,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,16 +14,36 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
+// DayOfWeek enumerates the values for day of week.
+type DayOfWeek string
+
+const (
+ // Friday specifies the friday state for day of week.
+ Friday DayOfWeek = "Friday"
+ // Monday specifies the monday state for day of week.
+ Monday DayOfWeek = "Monday"
+ // Saturday specifies the saturday state for day of week.
+ Saturday DayOfWeek = "Saturday"
+ // Sunday specifies the sunday state for day of week.
+ Sunday DayOfWeek = "Sunday"
+ // Thursday specifies the thursday state for day of week.
+ Thursday DayOfWeek = "Thursday"
+ // Tuesday specifies the tuesday state for day of week.
+ Tuesday DayOfWeek = "Tuesday"
+ // Wednesday specifies the wednesday state for day of week.
+ Wednesday DayOfWeek = "Wednesday"
+)
+
// KeyType enumerates the values for key type.
type KeyType string
@@ -34,6 +54,18 @@
Secondary KeyType = "Secondary"
)
+// RebootType enumerates the values for reboot type.
+type RebootType string
+
+const (
+ // AllNodes specifies the all nodes state for reboot type.
+ AllNodes RebootType = "AllNodes"
+ // PrimaryNode specifies the primary node state for reboot type.
+ PrimaryNode RebootType = "PrimaryNode"
+ // SecondaryNode specifies the secondary node state for reboot type.
+ SecondaryNode RebootType = "SecondaryNode"
+)
+
// SkuFamily enumerates the values for sku family.
type SkuFamily string
@@ -73,6 +105,19 @@
Properties *Properties `json:"properties,omitempty"`
}
+// ExportRDBParameters is parameters for redis export operation.
+type ExportRDBParameters struct {
+ Format *string `json:"format,omitempty"`
+ Prefix *string `json:"prefix,omitempty"`
+ Container *string `json:"container,omitempty"`
+}
+
+// ImportRDBParameters is parameters for redis import operation.
+type ImportRDBParameters struct {
+ Format *string `json:"format,omitempty"`
+ Files *[]string `json:"files,omitempty"`
+}
+
// ListKeysResult is the response of redis list keys operation.
type ListKeysResult struct {
autorest.Response `json:"-"`
@@ -99,53 +144,72 @@
autorest.WithBaseURL(to.String(client.NextLink)))
}
-// Properties is parameters supplied to CreateOrUpdate redis operation.
+// PatchSchedulesRequest is parameters to set patch schedules for redis cache.
+type PatchSchedulesRequest struct {
+ Properties *ScheduleEntries `json:"properties,omitempty"`
+}
+
+// PatchSchedulesResponse is response to put/get patch schedules for redis
+// cache.
+type PatchSchedulesResponse struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Properties *ScheduleEntries `json:"properties,omitempty"`
+}
+
+// Properties is properties supplied to CreateOrUpdate redis operation.
type Properties struct {
RedisVersion *string `json:"redisVersion,omitempty"`
Sku *Sku `json:"sku,omitempty"`
RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"`
EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
TenantSettings *map[string]*string `json:"tenantSettings,omitempty"`
- ShardCount *int `json:"shardCount,omitempty"`
- VirtualNetwork *string `json:"virtualNetwork,omitempty"`
- Subnet *string `json:"subnet,omitempty"`
+ ShardCount *int32 `json:"shardCount,omitempty"`
+ SubnetID *string `json:"subnetId,omitempty"`
StaticIP *string `json:"staticIP,omitempty"`
}
// ReadableProperties is parameters describing a redis instance
type ReadableProperties struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
- HostName *string `json:"hostName,omitempty"`
- Port *int `json:"port,omitempty"`
- SslPort *int `json:"sslPort,omitempty"`
RedisVersion *string `json:"redisVersion,omitempty"`
Sku *Sku `json:"sku,omitempty"`
RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"`
EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
TenantSettings *map[string]*string `json:"tenantSettings,omitempty"`
- ShardCount *int `json:"shardCount,omitempty"`
- VirtualNetwork *string `json:"virtualNetwork,omitempty"`
- Subnet *string `json:"subnet,omitempty"`
+ ShardCount *int32 `json:"shardCount,omitempty"`
+ SubnetID *string `json:"subnetId,omitempty"`
StaticIP *string `json:"staticIP,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ HostName *string `json:"hostName,omitempty"`
+ Port *int32 `json:"port,omitempty"`
+ SslPort *int32 `json:"sslPort,omitempty"`
}
// ReadablePropertiesWithAccessKey is properties generated only in response to
// CreateOrUpdate redis operation.
type ReadablePropertiesWithAccessKey struct {
- AccessKeys *AccessKeys `json:"accessKeys,omitempty"`
- ProvisioningState *string `json:"provisioningState,omitempty"`
- HostName *string `json:"hostName,omitempty"`
- Port *int `json:"port,omitempty"`
- SslPort *int `json:"sslPort,omitempty"`
RedisVersion *string `json:"redisVersion,omitempty"`
Sku *Sku `json:"sku,omitempty"`
RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"`
EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
TenantSettings *map[string]*string `json:"tenantSettings,omitempty"`
- ShardCount *int `json:"shardCount,omitempty"`
- VirtualNetwork *string `json:"virtualNetwork,omitempty"`
- Subnet *string `json:"subnet,omitempty"`
+ ShardCount *int32 `json:"shardCount,omitempty"`
+ SubnetID *string `json:"subnetId,omitempty"`
StaticIP *string `json:"staticIP,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ HostName *string `json:"hostName,omitempty"`
+ Port *int32 `json:"port,omitempty"`
+ SslPort *int32 `json:"sslPort,omitempty"`
+ AccessKeys *AccessKeys `json:"accessKeys,omitempty"`
+}
+
+// RebootParameters is specifies which redis node(s) to reboot.
+type RebootParameters struct {
+ RebootType RebootType `json:"rebootType,omitempty"`
+ ShardID *int32 `json:"shardId,omitempty"`
}
// RegenerateKeyParameters is specifies which redis access keys to reset.
@@ -184,14 +248,21 @@
Properties *ReadablePropertiesWithAccessKey `json:"properties,omitempty"`
}
+// ScheduleEntries is list of patch schedules for redis cache.
+type ScheduleEntries struct {
+ ScheduleEntriesProperty *[]ScheduleEntry `json:"scheduleEntries,omitempty"`
+}
+
+// ScheduleEntry is
+type ScheduleEntry struct {
+ DayOfWeek DayOfWeek `json:"dayOfWeek,omitempty"`
+ StartHourUtc *int32 `json:"startHourUtc,omitempty"`
+ MaintenanceWindow *string `json:"maintenanceWindow,omitempty"`
+}
+
// Sku is sku parameters supplied to the create redis operation.
type Sku struct {
Name SkuName `json:"name,omitempty"`
Family SkuFamily `json:"family,omitempty"`
- Capacity *int `json:"capacity,omitempty"`
-}
-
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
+ Capacity *int32 `json:"capacity,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/patchschedules.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/patchschedules.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/patchschedules.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/patchschedules.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,233 @@
+package redis
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// PatchSchedulesClient is the rEST API for Azure Redis Cache Service
+type PatchSchedulesClient struct {
+ ManagementClient
+}
+
+// NewPatchSchedulesClient creates an instance of the PatchSchedulesClient
+// client.
+func NewPatchSchedulesClient(subscriptionID string) PatchSchedulesClient {
+ return NewPatchSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPatchSchedulesClientWithBaseURI creates an instance of the
+// PatchSchedulesClient client.
+func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) PatchSchedulesClient {
+ return PatchSchedulesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or replace the patching schedule for redis cache.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is parameters to set patch schedules for redis
+// cache.
+func (client PatchSchedulesClient) CreateOrUpdate(resourceGroupName string, name string, parameters PatchSchedulesRequest) (result PatchSchedulesResponse, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client PatchSchedulesClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters PatchSchedulesRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client PatchSchedulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client PatchSchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result PatchSchedulesResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes the patching schedule for redis cache.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache.
+func (client PatchSchedulesClient) Delete(resourceGroupName string, name string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client PatchSchedulesClient) DeletePreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client PatchSchedulesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client PatchSchedulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the patching schedule for redis cache.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache.
+func (client PatchSchedulesClient) Get(resourceGroupName string, name string) (result PatchSchedulesResponse, err error) {
+ req, err := client.GetPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client PatchSchedulesClient) GetPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client PatchSchedulesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client PatchSchedulesClient) GetResponder(resp *http.Response) (result PatchSchedulesResponse, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/redis.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/redis.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/redis.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/redis.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,18 +14,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
-// Client is the .Net client wrapper for the REST API for Azure Redis Cache
-// Management Service
+// Client is the rEST API for Azure Redis Cache Service
type Client struct {
ManagementClient
}
@@ -46,21 +45,21 @@
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache. parameters is parameters supplied to the CreateOrUpdate
// redis operation.
-func (client Client) CreateOrUpdate(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (result ResourceWithAccessKey, ae error) {
+func (client Client) CreateOrUpdate(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (result ResourceWithAccessKey, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -69,29 +68,29 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client Client) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters CreateOrUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -100,7 +99,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -111,21 +110,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client Client) Delete(resourceGroupName string, name string) (result autorest.Response, ae error) {
+func (client Client) Delete(resourceGroupName string, name string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "redis/Client", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "Delete", resp, "Failure responding to request")
}
return
@@ -134,28 +133,27 @@
// DeletePreparer prepares the Delete request.
func (client Client) DeletePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client Client) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -164,7 +162,140 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Export import data into redis cache. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is parameters for redis export operation.
+func (client Client) Export(resourceGroupName string, name string, parameters ExportRDBParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ExportPreparer(resourceGroupName, name, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Export", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ExportSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Export", resp, "Failure sending request")
+ }
+
+ result, err = client.ExportResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.Client", "Export", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ExportPreparer prepares the Export request.
+func (client Client) ExportPreparer(resourceGroupName string, name string, parameters ExportRDBParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ExportSender sends the Export request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ExportSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ExportResponder handles the response to the Export request. The method always
+// closes the http.Response Body.
+func (client Client) ExportResponder(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
+}
+
+// ForceReboot reboot specified redis node(s). This operation requires write
+// permission to the cache resource. There can be potential data loss.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is specifies which redis node(s) to reboot.
+func (client Client) ForceReboot(resourceGroupName string, name string, parameters RebootParameters) (result autorest.Response, err error) {
+ req, err := client.ForceRebootPreparer(resourceGroupName, name, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ForceReboot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ForceRebootSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ForceReboot", resp, "Failure sending request")
+ }
+
+ result, err = client.ForceRebootResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.Client", "ForceReboot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ForceRebootPreparer prepares the ForceReboot request.
+func (client Client) ForceRebootPreparer(resourceGroupName string, name string, parameters RebootParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ForceRebootSender sends the ForceReboot request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ForceRebootSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ForceRebootResponder handles the response to the ForceReboot request. The method always
+// closes the http.Response Body.
+func (client Client) ForceRebootResponder(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
@@ -174,21 +305,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client Client) Get(resourceGroupName string, name string) (result ResourceType, ae error) {
+func (client Client) Get(resourceGroupName string, name string) (result ResourceType, err error) {
req, err := client.GetPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "Get", resp, "Failure responding to request")
}
return
@@ -197,28 +328,27 @@
// GetPreparer prepares the Get request.
func (client Client) GetPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client Client) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -227,29 +357,97 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// Import import data into redis cache. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. name is the name of
+// the redis cache. parameters is parameters for redis import operation.
+func (client Client) Import(resourceGroupName string, name string, parameters ImportRDBParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ImportPreparer(resourceGroupName, name, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Import", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ImportSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "redis.Client", "Import", resp, "Failure sending request")
+ }
+
+ result, err = client.ImportResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "redis.Client", "Import", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ImportPreparer prepares the Import request.
+func (client Client) ImportPreparer(resourceGroupName string, name string, parameters ImportRDBParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// ImportSender sends the Import request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ImportSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// ImportResponder handles the response to the Import request. The method always
+// closes the http.Response Body.
+func (client Client) ImportResponder(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
+}
+
// List gets all redis caches in the specified subscription.
-func (client Client) List() (result ListResult, ae error) {
+func (client Client) List() (result ListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "List", resp, "Failure responding to request")
}
return
@@ -258,26 +456,25 @@
// ListPreparer prepares the List request.
func (client Client) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client Client) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -286,7 +483,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -294,10 +491,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client Client) ListNextResults(lastResults ListResult) (result ListResult, ae error) {
+func (client Client) ListNextResults(lastResults ListResult) (result ListResult, err error) {
req, err := lastResults.ListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -306,12 +503,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "List", resp, "Failure responding to next results request request")
}
return
@@ -320,21 +517,21 @@
// ListByResourceGroup gets all redis caches in a resource group.
//
// resourceGroupName is the name of the resource group.
-func (client Client) ListByResourceGroup(resourceGroupName string) (result ListResult, ae error) {
+func (client Client) ListByResourceGroup(resourceGroupName string) (result ListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", nil, "Failure preparing request")
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", resp, "Failure sending request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", resp, "Failure responding to request")
}
return
@@ -343,27 +540,26 @@
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client Client) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
@@ -372,7 +568,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -380,10 +576,10 @@
}
// ListByResourceGroupNextResults retrieves the next set of results, if any.
-func (client Client) ListByResourceGroupNextResults(lastResults ListResult) (result ListResult, ae error) {
+func (client Client) ListByResourceGroupNextResults(lastResults ListResult) (result ListResult, err error) {
req, err := lastResults.ListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -392,12 +588,12 @@
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", resp, "Failure sending next results request request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "ListByResourceGroup", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "ListByResourceGroup", resp, "Failure responding to next results request request")
}
return
@@ -408,21 +604,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache.
-func (client Client) ListKeys(resourceGroupName string, name string) (result ListKeysResult, ae error) {
+func (client Client) ListKeys(resourceGroupName string, name string) (result ListKeysResult, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListKeys", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListKeys", nil, "Failure preparing request")
}
resp, err := client.ListKeysSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "ListKeys", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "ListKeys", resp, "Failure sending request")
}
result, err = client.ListKeysResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "ListKeys", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "ListKeys", resp, "Failure responding to request")
}
return
@@ -431,28 +627,27 @@
// ListKeysPreparer prepares the ListKeys request.
func (client Client) ListKeysPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListKeysSender sends the ListKeys request. The method will close the
// http.Response Body if it receives an error.
func (client Client) ListKeysSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListKeysResponder handles the response to the ListKeys request. The method always
@@ -461,7 +656,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -473,21 +668,21 @@
//
// resourceGroupName is the name of the resource group. name is the name of
// the redis cache. parameters is specifies which key to reset.
-func (client Client) RegenerateKey(resourceGroupName string, name string, parameters RegenerateKeyParameters) (result ListKeysResult, ae error) {
+func (client Client) RegenerateKey(resourceGroupName string, name string, parameters RegenerateKeyParameters) (result ListKeysResult, err error) {
req, err := client.RegenerateKeyPreparer(resourceGroupName, name, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "redis/Client", "RegenerateKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "RegenerateKey", nil, "Failure preparing request")
}
resp, err := client.RegenerateKeySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "redis/Client", "RegenerateKey", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "redis.Client", "RegenerateKey", resp, "Failure sending request")
}
result, err = client.RegenerateKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "redis/Client", "RegenerateKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "redis.Client", "RegenerateKey", resp, "Failure responding to request")
}
return
@@ -496,29 +691,29 @@
// RegenerateKeyPreparer prepares the RegenerateKey request.
func (client Client) RegenerateKeyPreparer(resourceGroupName string, name string, parameters RegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RegenerateKeySender sends the RegenerateKey request. The method will close the
// http.Response Body if it receives an error.
func (client Client) RegenerateKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
@@ -527,7 +722,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/redis/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/redis/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "redis", "2015-08-01")
+ return fmt.Sprintf(userAgentFormat, Version(), "redis", "2016-04-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/client.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,486 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-const (
- // APIVersion is the version of the Resources
- APIVersion = "2014-04-01-preview"
-
- // DefaultBaseURI is the default URI used for the service Resources
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// ManagementClient is the base client for Resources.
-type ManagementClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the ManagementClient client.
-func New(subscriptionID string) ManagementClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the ManagementClient client.
-func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
- return ManagementClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
-
-// CheckExistence checks whether resource exists.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client ManagementClient) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, ae error) {
- req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "CheckExistence", "Failure preparing request")
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "CheckExistence", "Failure sending request")
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "CheckExistence", "Failure responding to request")
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client ManagementClient) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusNotFound)
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate create a resource.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity. parameters is create or
-// update resource parameters.
-func (client ManagementClient) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (result GenericResource, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete delete resource and all of its resources.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client ManagementClient) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client ManagementClient) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusAccepted)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get returns a resource belonging to a resource group.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client ManagementClient) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result GenericResource, ae error) {
- req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ManagementClient) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) GetResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List get all of the resources under a subscription.
-//
-// filter is the filter to apply on the operation. top is query parameters. If
-// null is passed returns all resource groups.
-func (client ManagementClient) List(filter string, top *int) (result ResourceListResult, ae error) {
- req, err := client.ListPreparer(filter, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ManagementClient) ListPreparer(filter string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resources"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) ListResponder(resp *http.Response) (result ResourceListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 ManagementClient) ListNextResults(lastResults ResourceListResult) (result ResourceListResult, ae error) {
- req, err := lastResults.ResourceListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// MoveResources begin moving resources.To determine whether the operation has
-// finished processing the request, call GetLongRunningOperationStatus.
-//
-// sourceResourceGroupName is source resource group name. parameters is move
-// resources' parameters.
-func (client ManagementClient) MoveResources(sourceResourceGroupName string, parameters MoveInfo) (result autorest.Response, ae error) {
- req, err := client.MoveResourcesPreparer(sourceResourceGroupName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "MoveResources", "Failure preparing request")
- }
-
- resp, err := client.MoveResourcesSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/ManagementClient", "MoveResources", "Failure sending request")
- }
-
- result, err = client.MoveResourcesResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ManagementClient", "MoveResources", "Failure responding to request")
- }
-
- return
-}
-
-// MoveResourcesPreparer prepares the MoveResources request.
-func (client ManagementClient) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "sourceResourceGroupName": url.QueryEscape(sourceResourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// MoveResourcesSender sends the MoveResources request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) MoveResourcesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNoContent)
-}
-
-// MoveResourcesResponder handles the response to the MoveResources request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/deploymentoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/deploymentoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/deploymentoperations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/deploymentoperations.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,201 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// DeploymentOperationsClient is the client for the DeploymentOperations
-// methods of the Resources service.
-type DeploymentOperationsClient struct {
- ManagementClient
-}
-
-// NewDeploymentOperationsClient creates an instance of the
-// DeploymentOperationsClient client.
-func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
- return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewDeploymentOperationsClientWithBaseURI creates an instance of the
-// DeploymentOperationsClient client.
-func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
- return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get get a list of deployments operations.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment. operationID is
-// operation Id.
-func (client DeploymentOperationsClient) Get(resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, ae error) {
- req, err := client.GetPreparer(resourceGroupName, deploymentName, operationID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client DeploymentOperationsClient) GetPreparer(resourceGroupName string, deploymentName string, operationID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of deployments operations.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment. top is query
-// parameters.
-func (client DeploymentOperationsClient) List(resourceGroupName string, deploymentName string, top *int) (result DeploymentOperationsListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, deploymentName, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client DeploymentOperationsClient) ListPreparer(resourceGroupName string, deploymentName string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 DeploymentOperationsClient) ListNextResults(lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, ae error) {
- req, err := lastResults.DeploymentOperationsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentOperationsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/deployments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/deployments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/deployments.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/deployments.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,522 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// DeploymentsClient is the client for the Deployments methods of the
-// Resources service.
-type DeploymentsClient struct {
- ManagementClient
-}
-
-// 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)}
-}
-
-// Cancel cancel a currently running template deployment.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment.
-func (client DeploymentsClient) Cancel(resourceGroupName string, deploymentName string) (result autorest.Response, ae error) {
- req, err := client.CancelPreparer(resourceGroupName, deploymentName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Cancel", "Failure preparing request")
- }
-
- resp, err := client.CancelSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Cancel", "Failure sending request")
- }
-
- result, err = client.CancelResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Cancel", "Failure responding to request")
- }
-
- return
-}
-
-// CancelPreparer prepares the Cancel request.
-func (client DeploymentsClient) CancelPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/cancel"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CancelSender sends the Cancel request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// CancelResponder handles the response to the Cancel request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CheckExistence checks whether deployment exists.
-//
-// resourceGroupName is the name of the resource group to check. The name is
-// case insensitive. deploymentName is the name of the deployment.
-func (client DeploymentsClient) CheckExistence(resourceGroupName string, deploymentName string) (result autorest.Response, ae error) {
- req, err := client.CheckExistencePreparer(resourceGroupName, deploymentName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CheckExistence", "Failure preparing request")
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CheckExistence", "Failure sending request")
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CheckExistence", "Failure responding to request")
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client DeploymentsClient) CheckExistencePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusNotFound)
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate create a named template deployment using a template.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment. parameters is
-// additional parameters supplied to the operation.
-func (client DeploymentsClient) CreateOrUpdate(resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentExtended, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, deploymentName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client DeploymentsClient) CreateOrUpdatePreparer(resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// 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) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete begin deleting deployment.To determine whether the operation has
-// finished processing the request, call GetLongRunningOperationStatus.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment to be deleted.
-func (client DeploymentsClient) Delete(resourceGroupName string, deploymentName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, deploymentName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client DeploymentsClient) DeletePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// 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) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNoContent)
-}
-
-// 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(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get get a deployment.
-//
-// resourceGroupName is the name of the resource group to get. The name is
-// case insensitive. deploymentName is the name of the deployment.
-func (client DeploymentsClient) Get(resourceGroupName string, deploymentName string) (result DeploymentExtended, ae error) {
- req, err := client.GetPreparer(resourceGroupName, deploymentName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client DeploymentsClient) GetPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// 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) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List get a list of deployments.
-//
-// resourceGroupName is the name of the resource group to filter by. The name
-// is case insensitive. filter is the filter to apply on the operation. top
-// is query parameters. If null is passed returns all deployments.
-func (client DeploymentsClient) List(resourceGroupName string, filter string, top *int) (result DeploymentListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, filter, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client DeploymentsClient) ListPreparer(resourceGroupName string, filter string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// 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) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ListResponder(resp *http.Response) (result DeploymentListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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(lastResults DeploymentListResult) (result DeploymentListResult, ae error) {
- req, err := lastResults.DeploymentListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Validate validate a deployment template.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. deploymentName is the name of the deployment. parameters is
-// deployment to validate.
-func (client DeploymentsClient) Validate(resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, ae error) {
- req, err := client.ValidatePreparer(resourceGroupName, deploymentName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Validate", "Failure preparing request")
- }
-
- resp, err := client.ValidateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Validate", "Failure sending request")
- }
-
- result, err = client.ValidateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/DeploymentsClient", "Validate", "Failure responding to request")
- }
-
- return
-}
-
-// ValidatePreparer prepares the Validate request.
-func (client DeploymentsClient) ValidatePreparer(resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": url.QueryEscape(deploymentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.resources/deployments/{deploymentName}/validate"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ValidateSender sends the Validate request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusBadRequest)
-}
-
-// ValidateResponder handles the response to the Validate request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,353 @@
+// Package features implements the Azure ARM Features service API version
+// 2015-12-01.
+//
+package features
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Features
+ APIVersion = "2015-12-01"
+
+ // DefaultBaseURI is the default URI used for the service Features
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Features.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
+
+// Get get all features under the subscription.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+// featureName is previewed feature name in the resource provider.
+func (client ManagementClient) Get(resourceProviderNamespace string, featureName string) (result FeatureResult, err error) {
+ req, err := client.GetPreparer(resourceProviderNamespace, featureName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ManagementClient) GetPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "featureName": autorest.Encode("path", featureName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetResponder(resp *http.Response) (result FeatureResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of previewed features of a resource provider.
+//
+// resourceProviderNamespace is the namespace of the resource provider.
+func (client ManagementClient) List(resourceProviderNamespace string) (result FeatureOperationsListResult, err error) {
+ req, err := client.ListPreparer(resourceProviderNamespace)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ManagementClient) ListPreparer(resourceProviderNamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListResponder(resp *http.Response) (result FeatureOperationsListResult, 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 ManagementClient) ListNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, err error) {
+ req, err := lastResults.FeatureOperationsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAll gets a list of previewed features for all the providers in the
+// current subscription.
+func (client ManagementClient) ListAll() (result FeatureOperationsListResult, err error) {
+ req, err := client.ListAllPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAllPreparer prepares the ListAll request.
+func (client ManagementClient) ListAllPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/features", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAllSender sends the ListAll request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListAllSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAllResponder handles the response to the ListAll request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListAllResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAllNextResults retrieves the next set of results, if any.
+func (client ManagementClient) ListAllNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, err error) {
+ req, err := lastResults.FeatureOperationsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "ListAll", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Register registers for a previewed feature of a resource provider.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+// featureName is previewed feature name in the resource provider.
+func (client ManagementClient) Register(resourceProviderNamespace string, featureName string) (result FeatureResult, err error) {
+ req, err := client.RegisterPreparer(resourceProviderNamespace, featureName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "Register", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegisterSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.ManagementClient", "Register", resp, "Failure sending request")
+ }
+
+ result, err = client.RegisterResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.ManagementClient", "Register", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegisterPreparer prepares the Register request.
+func (client ManagementClient) RegisterPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "featureName": autorest.Encode("path", featureName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegisterSender sends the Register request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) RegisterSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegisterResponder handles the response to the Register request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) RegisterResponder(resp *http.Response) (result FeatureResult, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/features.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/features.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/features.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/features.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,334 @@
+package features
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// Client is the client for the Features methods of the Features service.
+type Client struct {
+ ManagementClient
+}
+
+// NewClient creates an instance of the Client client.
+func NewClient(subscriptionID string) Client {
+ return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewClientWithBaseURI creates an instance of the Client client.
+func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
+ return Client{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get get all features under the subscription.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+// featureName is previewed feature name in the resource provider.
+func (client Client) Get(resourceProviderNamespace string, featureName string) (result FeatureResult, err error) {
+ req, err := client.GetPreparer(resourceProviderNamespace, featureName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client Client) GetPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "featureName": autorest.Encode("path", featureName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client Client) GetResponder(resp *http.Response) (result FeatureResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of previewed features of a resource provider.
+//
+// resourceProviderNamespace is the namespace of the resource provider.
+func (client Client) List(resourceProviderNamespace string) (result FeatureOperationsListResult, err error) {
+ req, err := client.ListPreparer(resourceProviderNamespace)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client Client) ListPreparer(resourceProviderNamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client Client) ListResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client Client) ListNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, err error) {
+ req, err := lastResults.FeatureOperationsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAll gets a list of previewed features for all the providers in the
+// current subscription.
+func (client Client) ListAll() (result FeatureOperationsListResult, err error) {
+ req, err := client.ListAllPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "ListAll", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "ListAll", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "ListAll", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAllPreparer prepares the ListAll request.
+func (client Client) ListAllPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/features", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAllSender sends the ListAll request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListAllSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAllResponder handles the response to the ListAll request. The method always
+// closes the http.Response Body.
+func (client Client) ListAllResponder(resp *http.Response) (result FeatureOperationsListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAllNextResults retrieves the next set of results, if any.
+func (client Client) ListAllNextResults(lastResults FeatureOperationsListResult) (result FeatureOperationsListResult, err error) {
+ req, err := lastResults.FeatureOperationsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "ListAll", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "ListAll", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "ListAll", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Register registers for a previewed feature of a resource provider.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+// featureName is previewed feature name in the resource provider.
+func (client Client) Register(resourceProviderNamespace string, featureName string) (result FeatureResult, err error) {
+ req, err := client.RegisterPreparer(resourceProviderNamespace, featureName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "features.Client", "Register", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegisterSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "features.Client", "Register", resp, "Failure sending request")
+ }
+
+ result, err = client.RegisterResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "features.Client", "Register", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegisterPreparer prepares the Register request.
+func (client Client) RegisterPreparer(resourceProviderNamespace string, featureName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "featureName": autorest.Encode("path", featureName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features/{featureName}/register", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegisterSender sends the Register request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) RegisterSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegisterResponder handles the response to the Register request. The method always
+// closes the http.Response Body.
+func (client Client) RegisterResponder(resp *http.Response) (result FeatureResult, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,90 @@
+package features
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// DeploymentExtendedFilter is deployment filter.
+type DeploymentExtendedFilter struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// FeatureOperationsListResult is list of previewed features.
+type FeatureOperationsListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]FeatureResult `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// FeatureOperationsListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client FeatureOperationsListResult) FeatureOperationsListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// FeatureProperties is previewed feature information.
+type FeatureProperties struct {
+ State *string `json:"state,omitempty"`
+}
+
+// FeatureResult is previewed feature information.
+type FeatureResult struct {
+ autorest.Response `json:"-"`
+ Name *string `json:"name,omitempty"`
+ Properties *FeatureProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// GenericResourceFilter is resource filter.
+type GenericResourceFilter struct {
+ ResourceType *string `json:"resourceType,omitempty"`
+ Tagname *string `json:"tagname,omitempty"`
+ Tagvalue *string `json:"tagvalue,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceGroupFilter is resource group filter.
+type ResourceGroupFilter struct {
+ TagName *string `json:"tagName,omitempty"`
+ TagValue *string `json:"tagValue,omitempty"`
+}
+
+// SubResource is
+type SubResource struct {
+ ID *string `json:"id,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/features/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package features
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "features", "2015-12-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/groups.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/groups.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/groups.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/groups.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,547 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// GroupsClient is the client for the Groups methods of the Resources service.
-type GroupsClient struct {
- ManagementClient
-}
-
-// NewGroupsClient creates an instance of the GroupsClient client.
-func NewGroupsClient(subscriptionID string) GroupsClient {
- return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client.
-func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
- return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CheckExistence checks whether resource group exists.
-//
-// resourceGroupName is the name of the resource group to check. The name is
-// case insensitive.
-func (client GroupsClient) CheckExistence(resourceGroupName string) (result autorest.Response, ae error) {
- req, err := client.CheckExistencePreparer(resourceGroupName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "CheckExistence", "Failure preparing request")
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "CheckExistence", "Failure sending request")
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "CheckExistence", "Failure responding to request")
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client GroupsClient) CheckExistencePreparer(resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusNotFound)
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate create a resource group.
-//
-// resourceGroupName is the name of the resource group to be created or
-// updated. parameters is parameters supplied to the create or update
-// resource group service operation.
-func (client GroupsClient) CreateOrUpdate(resourceGroupName string, parameters ResourceGroup) (result ResourceGroup, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client GroupsClient) CreateOrUpdatePreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ResourceGroup, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete begin deleting resource group.To determine whether the operation has
-// finished processing the request, call GetLongRunningOperationStatus.
-//
-// resourceGroupName is the name of the resource group to be deleted. The name
-// is case insensitive.
-func (client GroupsClient) Delete(resourceGroupName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client GroupsClient) DeletePreparer(resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get get a resource group.
-//
-// resourceGroupName is the name of the resource group to get. The name is
-// case insensitive.
-func (client GroupsClient) Get(resourceGroupName string) (result ResourceGroup, ae error) {
- req, err := client.GetPreparer(resourceGroupName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client GroupsClient) GetPreparer(resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) GetResponder(resp *http.Response) (result ResourceGroup, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a collection of resource groups.
-//
-// filter is the filter to apply on the operation. top is query parameters. If
-// null is passed returns all resource groups.
-func (client GroupsClient) List(filter string, top *int) (result ResourceGroupListResult, ae error) {
- req, err := client.ListPreparer(filter, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client GroupsClient) ListPreparer(filter string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) ListResponder(resp *http.Response) (result ResourceGroupListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 GroupsClient) ListNextResults(lastResults ResourceGroupListResult) (result ResourceGroupListResult, ae error) {
- req, err := lastResults.ResourceGroupListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListResources get all of the resources under a subscription.
-//
-// resourceGroupName is query parameters. If null is passed returns all
-// resource groups. filter is the filter to apply on the operation. top is
-// query parameters. If null is passed returns all resource groups.
-func (client GroupsClient) ListResources(resourceGroupName string, filter string, top *int) (result ResourceListResult, ae error) {
- req, err := client.ListResourcesPreparer(resourceGroupName, filter, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure preparing request")
- }
-
- resp, err := client.ListResourcesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure sending request")
- }
-
- result, err = client.ListResourcesResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure responding to request")
- }
-
- return
-}
-
-// ListResourcesPreparer prepares the ListResources request.
-func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filter string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListResourcesSender sends the ListResources request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) ListResourcesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResourcesResponder handles the response to the ListResources request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) ListResourcesResponder(resp *http.Response) (result ResourceListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListResourcesNextResults retrieves the next set of results, if any.
-func (client GroupsClient) ListResourcesNextResults(lastResults ResourceListResult) (result ResourceListResult, ae error) {
- req, err := lastResults.ResourceListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListResourcesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure sending next results request request")
- }
-
- result, err = client.ListResourcesResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "ListResources", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Patch resource groups can be updated through a simple PATCH operation to a
-// group address. The format of the request is the same as that for creating
-// a resource groups, though if a field is unspecified current value will be
-// carried over.
-//
-// resourceGroupName is the name of the resource group to be created or
-// updated. The name is case insensitive. parameters is parameters supplied
-// to the update state resource group service operation.
-func (client GroupsClient) Patch(resourceGroupName string, parameters ResourceGroup) (result ResourceGroup, ae error) {
- req, err := client.PatchPreparer(resourceGroupName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Patch", "Failure preparing request")
- }
-
- resp, err := client.PatchSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/GroupsClient", "Patch", "Failure sending request")
- }
-
- result, err = client.PatchResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/GroupsClient", "Patch", "Failure responding to request")
- }
-
- return
-}
-
-// PatchPreparer prepares the Patch request.
-func (client GroupsClient) PatchPreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// PatchSender sends the Patch request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) PatchSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// PatchResponder handles the response to the Patch request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) PatchResponder(resp *http.Response) (result ResourceGroup, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,56 @@
+// Package locks implements the Azure ARM Locks service API version 2015-01-01.
+//
+package locks
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Locks
+ APIVersion = "2015-01-01"
+
+ // DefaultBaseURI is the default URI used for the service Locks
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Locks.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/managementlocks.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/managementlocks.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/managementlocks.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/managementlocks.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,850 @@
+package locks
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ManagementLocksClient is the client for the ManagementLocks methods of the
+// Locks service.
+type ManagementLocksClient struct {
+ ManagementClient
+}
+
+// NewManagementLocksClient creates an instance of the ManagementLocksClient
+// client.
+func NewManagementLocksClient(subscriptionID string) ManagementLocksClient {
+ return NewManagementLocksClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewManagementLocksClientWithBaseURI creates an instance of the
+// ManagementLocksClient client.
+func NewManagementLocksClientWithBaseURI(baseURI string, subscriptionID string) ManagementLocksClient {
+ return ManagementLocksClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdateAtResourceGroupLevel create or update a management lock at
+// the resource group level.
+//
+// resourceGroupName is the resource group name. lockName is the lock name.
+// parameters is the management lock parameters.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(resourceGroupName string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
+ req, err := client.CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName, lockName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAtResourceGroupLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAtResourceGroupLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAtResourceGroupLevelPreparer prepares the CreateOrUpdateAtResourceGroupLevel request.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelPreparer(resourceGroupName string, lockName string, parameters ManagementLockObject) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAtResourceGroupLevelSender sends the CreateOrUpdateAtResourceGroupLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAtResourceGroupLevelResponder handles the response to the CreateOrUpdateAtResourceGroupLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockObject, 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
+}
+
+// CreateOrUpdateAtResourceLevel create or update a management lock at the
+// resource level or any level below resource.
+//
+// resourceGroupName is the name of the resource group.
+// resourceProviderNamespace is resource identity. parentResourcePath is
+// resource identity. resourceType is resource identity. resourceName is
+// resource identity. lockName is the name of lock. parameters is create or
+// update management lock parameters.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
+ req, err := client.CreateOrUpdateAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAtResourceLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAtResourceLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAtResourceLevelPreparer prepares the CreateOrUpdateAtResourceLevel request.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockObject) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAtResourceLevelSender sends the CreateOrUpdateAtResourceLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAtResourceLevelResponder handles the response to the CreateOrUpdateAtResourceLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelResponder(resp *http.Response) (result ManagementLockObject, 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
+}
+
+// CreateOrUpdateAtSubscriptionLevel create or update a management lock at the
+// subscription level.
+//
+// lockName is the name of lock. parameters is the management lock parameters.
+func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) {
+ req, err := client.CreateOrUpdateAtSubscriptionLevelPreparer(lockName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAtSubscriptionLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAtSubscriptionLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAtSubscriptionLevelPreparer prepares the CreateOrUpdateAtSubscriptionLevel request.
+func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelPreparer(lockName string, parameters ManagementLockObject) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAtSubscriptionLevelSender sends the CreateOrUpdateAtSubscriptionLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAtSubscriptionLevelResponder handles the response to the CreateOrUpdateAtSubscriptionLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteAtResourceGroupLevel deletes the management lock of a resource group.
+//
+// resourceGroup is the resource group names. lockName is the name of lock.
+func (client ManagementLocksClient) DeleteAtResourceGroupLevel(resourceGroup string, lockName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAtResourceGroupLevelPreparer(resourceGroup, lockName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceGroupLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAtResourceGroupLevelSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceGroupLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAtResourceGroupLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceGroupLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAtResourceGroupLevelPreparer prepares the DeleteAtResourceGroupLevel request.
+func (client ManagementLocksClient) DeleteAtResourceGroupLevelPreparer(resourceGroup string, lockName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "resourceGroup": autorest.Encode("path", resourceGroup),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAtResourceGroupLevelSender sends the DeleteAtResourceGroupLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) DeleteAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAtResourceGroupLevelResponder handles the response to the DeleteAtResourceGroupLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) DeleteAtResourceGroupLevelResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteAtResourceLevel deletes the management lock of a resource or any
+// level below resource.
+//
+// resourceGroupName is the name of the resource group.
+// resourceProviderNamespace is resource identity. parentResourcePath is
+// resource identity. resourceType is resource identity. resourceName is
+// resource identity. lockName is the name of lock.
+func (client ManagementLocksClient) DeleteAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAtResourceLevelSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAtResourceLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtResourceLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAtResourceLevelPreparer prepares the DeleteAtResourceLevel request.
+func (client ManagementLocksClient) DeleteAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAtResourceLevelSender sends the DeleteAtResourceLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) DeleteAtResourceLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAtResourceLevelResponder handles the response to the DeleteAtResourceLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) DeleteAtResourceLevelResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteAtSubscriptionLevel deletes the management lock of a subscription.
+//
+// lockName is the name of lock.
+func (client ManagementLocksClient) DeleteAtSubscriptionLevel(lockName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAtSubscriptionLevelPreparer(lockName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtSubscriptionLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAtSubscriptionLevelSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtSubscriptionLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAtSubscriptionLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "DeleteAtSubscriptionLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAtSubscriptionLevelPreparer prepares the DeleteAtSubscriptionLevel request.
+func (client ManagementLocksClient) DeleteAtSubscriptionLevelPreparer(lockName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAtSubscriptionLevelSender sends the DeleteAtSubscriptionLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) DeleteAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAtSubscriptionLevelResponder handles the response to the DeleteAtSubscriptionLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) DeleteAtSubscriptionLevelResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the management lock of a scope.
+//
+// lockName is name of the management lock.
+func (client ManagementLocksClient) Get(lockName string) (result ManagementLockObject, err error) {
+ req, err := client.GetPreparer(lockName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ManagementLocksClient) GetPreparer(lockName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "lockName": autorest.Encode("path", lockName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) GetResponder(resp *http.Response) (result ManagementLockObject, 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
+}
+
+// ListAtResourceGroupLevel gets all the management locks of a resource group.
+//
+// resourceGroupName is resource group name. filter is the filter to apply on
+// the operation.
+func (client ManagementLocksClient) ListAtResourceGroupLevel(resourceGroupName string, filter string) (result ManagementLockListResult, err error) {
+ req, err := client.ListAtResourceGroupLevelPreparer(resourceGroupName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAtResourceGroupLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAtResourceGroupLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAtResourceGroupLevelPreparer prepares the ListAtResourceGroupLevel request.
+func (client ManagementLocksClient) ListAtResourceGroupLevelPreparer(resourceGroupName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAtResourceGroupLevelSender sends the ListAtResourceGroupLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) ListAtResourceGroupLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAtResourceGroupLevelResponder handles the response to the ListAtResourceGroupLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) ListAtResourceGroupLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAtResourceGroupLevelNextResults retrieves the next set of results, if any.
+func (client ManagementLocksClient) ListAtResourceGroupLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, err error) {
+ req, err := lastResults.ManagementLockListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAtResourceGroupLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAtResourceGroupLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAtResourceLevel gets all the management locks of a resource or any
+// level below resource.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity. filter is the filter to apply
+// on the operation.
+func (client ManagementLocksClient) ListAtResourceLevel(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result ManagementLockListResult, err error) {
+ req, err := client.ListAtResourceLevelPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAtResourceLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAtResourceLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAtResourceLevelPreparer prepares the ListAtResourceLevel request.
+func (client ManagementLocksClient) ListAtResourceLevelPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAtResourceLevelSender sends the ListAtResourceLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) ListAtResourceLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAtResourceLevelResponder handles the response to the ListAtResourceLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) ListAtResourceLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAtResourceLevelNextResults retrieves the next set of results, if any.
+func (client ManagementLocksClient) ListAtResourceLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, err error) {
+ req, err := lastResults.ManagementLockListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAtResourceLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAtResourceLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtResourceLevel", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListAtSubscriptionLevel gets all the management locks of a subscription.
+//
+// filter is the filter to apply on the operation.
+func (client ManagementLocksClient) ListAtSubscriptionLevel(filter string) (result ManagementLockListResult, err error) {
+ req, err := client.ListAtSubscriptionLevelPreparer(filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAtSubscriptionLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAtSubscriptionLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAtSubscriptionLevelPreparer prepares the ListAtSubscriptionLevel request.
+func (client ManagementLocksClient) ListAtSubscriptionLevelPreparer(filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAtSubscriptionLevelSender sends the ListAtSubscriptionLevel request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) ListAtSubscriptionLevelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAtSubscriptionLevelResponder handles the response to the ListAtSubscriptionLevel request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) ListAtSubscriptionLevelResponder(resp *http.Response) (result ManagementLockListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAtSubscriptionLevelNextResults retrieves the next set of results, if any.
+func (client ManagementLocksClient) ListAtSubscriptionLevelNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, err error) {
+ req, err := lastResults.ManagementLockListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAtSubscriptionLevelSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAtSubscriptionLevelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListAtSubscriptionLevel", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListNext get a list of management locks at resource level or below.
+//
+// nextLink is nextLink from the previous successful call to List operation.
+func (client ManagementLocksClient) ListNext(nextLink string) (result ManagementLockListResult, err error) {
+ req, err := client.ListNextPreparer(nextLink)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListNextSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", resp, "Failure sending request")
+ }
+
+ result, err = client.ListNextResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListNextPreparer prepares the ListNext request.
+func (client ManagementLocksClient) ListNextPreparer(nextLink string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "nextLink": nextLink,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{nextLink}", pathParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListNextSender sends the ListNext request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementLocksClient) ListNextSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListNextResponder handles the response to the ListNext request. The method always
+// closes the http.Response Body.
+func (client ManagementLocksClient) ListNextResponder(resp *http.Response) (result ManagementLockListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextNextResults retrieves the next set of results, if any.
+func (client ManagementLocksClient) ListNextNextResults(lastResults ManagementLockListResult) (result ManagementLockListResult, err error) {
+ req, err := lastResults.ManagementLockListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListNextSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListNextResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "locks.ManagementLocksClient", "ListNext", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,103 @@
+package locks
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// LockLevel enumerates the values for lock level.
+type LockLevel string
+
+const (
+ // CanNotDelete specifies the can not delete state for lock level.
+ CanNotDelete LockLevel = "CanNotDelete"
+ // NotSpecified specifies the not specified state for lock level.
+ NotSpecified LockLevel = "NotSpecified"
+ // ReadOnly specifies the read only state for lock level.
+ ReadOnly LockLevel = "ReadOnly"
+)
+
+// DeploymentExtendedFilter is deployment filter.
+type DeploymentExtendedFilter struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// GenericResourceFilter is resource filter.
+type GenericResourceFilter struct {
+ ResourceType *string `json:"resourceType,omitempty"`
+ Tagname *string `json:"tagname,omitempty"`
+ Tagvalue *string `json:"tagvalue,omitempty"`
+}
+
+// ManagementLockListResult is list of management locks.
+type ManagementLockListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ManagementLockObject `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ManagementLockListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ManagementLockListResult) ManagementLockListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ManagementLockObject is management lock information.
+type ManagementLockObject struct {
+ autorest.Response `json:"-"`
+ Properties *ManagementLockProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Name *string `json:"name,omitempty"`
+}
+
+// ManagementLockProperties is the management lock properties.
+type ManagementLockProperties struct {
+ Level LockLevel `json:"level,omitempty"`
+ Notes *string `json:"notes,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceGroupFilter is resource group filter.
+type ResourceGroupFilter struct {
+ TagName *string `json:"tagName,omitempty"`
+ TagValue *string `json:"tagValue,omitempty"`
+}
+
+// SubResource is
+type SubResource struct {
+ ID *string `json:"id,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/locks/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package locks
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "locks", "2015-01-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/models.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,433 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
- "net/http"
-)
-
-// DeploymentMode enumerates the values for deployment mode.
-type DeploymentMode string
-
-const (
- // Complete specifies the complete state for deployment mode.
- Complete DeploymentMode = "Complete"
- // Incremental specifies the incremental state for deployment mode.
- Incremental DeploymentMode = "Incremental"
-)
-
-// BasicDependency is deployment dependency information.
-type BasicDependency struct {
- ID *string `json:"id,omitempty"`
- ResourceType *string `json:"resourceType,omitempty"`
- ResourceName *string `json:"resourceName,omitempty"`
-}
-
-// Dependency is deployment dependency information.
-type Dependency struct {
- DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
- ID *string `json:"id,omitempty"`
- ResourceType *string `json:"resourceType,omitempty"`
- ResourceName *string `json:"resourceName,omitempty"`
-}
-
-// Deployment is deployment operation parameters.
-type Deployment struct {
- Properties *DeploymentProperties `json:"properties,omitempty"`
-}
-
-// DeploymentExtended is deployment information.
-type DeploymentExtended struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
-}
-
-// DeploymentExtendedFilter is deployment filter.
-type DeploymentExtendedFilter struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// DeploymentListResult is list of deployments.
-type DeploymentListResult struct {
- autorest.Response `json:"-"`
- Value *[]DeploymentExtended `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// DeploymentListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client DeploymentListResult) DeploymentListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// DeploymentOperation is deployment operation information.
-type DeploymentOperation struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- OperationID *string `json:"operationId,omitempty"`
- Properties *DeploymentOperationProperties `json:"properties,omitempty"`
-}
-
-// DeploymentOperationProperties is deployment operation properties.
-type DeploymentOperationProperties struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- StatusCode *string `json:"statusCode,omitempty"`
- StatusMessage *map[string]interface{} `json:"statusMessage,omitempty"`
- TargetResource *TargetResource `json:"targetResource,omitempty"`
-}
-
-// DeploymentOperationsListResult is list of deployment operations.
-type DeploymentOperationsListResult struct {
- autorest.Response `json:"-"`
- Value *[]DeploymentOperation `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// DeploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client DeploymentOperationsListResult) DeploymentOperationsListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// DeploymentProperties is deployment properties.
-type DeploymentProperties struct {
- Template *map[string]interface{} `json:"template,omitempty"`
- TemplateLink *TemplateLink `json:"templateLink,omitempty"`
- Parameters *map[string]interface{} `json:"parameters,omitempty"`
- ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
- Mode DeploymentMode `json:"mode,omitempty"`
-}
-
-// DeploymentPropertiesExtended is deployment properties with additional
-// details.
-type DeploymentPropertiesExtended struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
- CorrelationID *string `json:"correlationId,omitempty"`
- Timestamp *date.Time `json:"timestamp,omitempty"`
- Outputs *map[string]interface{} `json:"outputs,omitempty"`
- Providers *[]Provider `json:"providers,omitempty"`
- Dependencies *[]Dependency `json:"dependencies,omitempty"`
- Template *map[string]interface{} `json:"template,omitempty"`
- TemplateLink *TemplateLink `json:"templateLink,omitempty"`
- Parameters *map[string]interface{} `json:"parameters,omitempty"`
- ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
- Mode DeploymentMode `json:"mode,omitempty"`
-}
-
-// DeploymentValidateResult is information from validate template deployment
-// response.
-type DeploymentValidateResult struct {
- autorest.Response `json:"-"`
- Error *ResourceManagementErrorWithDetails `json:"error,omitempty"`
- Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
-}
-
-// GenericResource is resource information.
-type GenericResource struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
- Plan *Plan `json:"plan,omitempty"`
- Properties *map[string]interface{} `json:"properties,omitempty"`
-}
-
-// GenericResourceFilter is resource filter.
-type GenericResourceFilter struct {
- ResourceType *string `json:"resourceType,omitempty"`
- Tagname *string `json:"tagname,omitempty"`
- Tagvalue *string `json:"tagvalue,omitempty"`
-}
-
-// MoveInfo is parameters of move resources.
-type MoveInfo struct {
- Resources *[]string `json:"resources,omitempty"`
- TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
-}
-
-// Operation is operation
-type Operation struct {
- Name *string `json:"name,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Description *string `json:"description,omitempty"`
- Origin *string `json:"origin,omitempty"`
- Properties *map[string]interface{} `json:"properties,omitempty"`
-}
-
-// ParametersLink is entity representing the reference to the deployment
-// paramaters.
-type ParametersLink struct {
- URI *string `json:"uri,omitempty"`
- ContentVersion *string `json:"contentVersion,omitempty"`
-}
-
-// Plan is plan for the resource.
-type Plan struct {
- Name *string `json:"name,omitempty"`
- Publisher *string `json:"publisher,omitempty"`
- Product *string `json:"product,omitempty"`
- PromotionCode *string `json:"promotionCode,omitempty"`
-}
-
-// Provider is resource provider information.
-type Provider struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Namespace *string `json:"namespace,omitempty"`
- RegistrationState *string `json:"registrationState,omitempty"`
- ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
-}
-
-// ProviderListResult is list of resource providers.
-type ProviderListResult struct {
- autorest.Response `json:"-"`
- Value *[]Provider `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ProviderListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ProviderListResult) ProviderListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// ProviderOperationsMetadata is provider Operations metadata
-type ProviderOperationsMetadata struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- ResourceTypes *[]ResourceType `json:"resourceTypes,omitempty"`
- Operations *[]Operation `json:"operations,omitempty"`
-}
-
-// ProviderOperationsMetadataListResult is provider operations metadata list
-type ProviderOperationsMetadataListResult struct {
- autorest.Response `json:"-"`
- Value *[]ProviderOperationsMetadata `json:"value,omitempty"`
-}
-
-// ProviderResourceType is resource type managed by the resource provider.
-type ProviderResourceType struct {
- ResourceType *string `json:"resourceType,omitempty"`
- Locations *[]string `json:"locations,omitempty"`
- APIVersions *[]string `json:"apiVersions,omitempty"`
- Properties *map[string]*string `json:"properties,omitempty"`
-}
-
-// Resource is
-type Resource struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
-
-// ResourceGroup is resource group information.
-type ResourceGroup struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Properties *ResourceGroupProperties `json:"properties,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
-
-// ResourceGroupFilter is resource group filter.
-type ResourceGroupFilter struct {
- TagName *string `json:"tagName,omitempty"`
- TagValue *string `json:"tagValue,omitempty"`
-}
-
-// ResourceGroupListResult is list of resource groups.
-type ResourceGroupListResult struct {
- autorest.Response `json:"-"`
- Value *[]ResourceGroup `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ResourceGroupListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ResourceGroupListResult) ResourceGroupListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// ResourceGroupProperties is the resource group properties.
-type ResourceGroupProperties struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// ResourceListResult is list of resource groups.
-type ResourceListResult struct {
- autorest.Response `json:"-"`
- Value *[]GenericResource `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ResourceListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client ResourceListResult) ResourceListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// ResourceManagementError is
-type ResourceManagementError struct {
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Target *string `json:"target,omitempty"`
-}
-
-// ResourceManagementErrorWithDetails is
-type ResourceManagementErrorWithDetails struct {
- Details *[]ResourceManagementError `json:"details,omitempty"`
- Code *string `json:"code,omitempty"`
- Message *string `json:"message,omitempty"`
- Target *string `json:"target,omitempty"`
-}
-
-// ResourceProviderOperationDefinition is resource provider operation
-// information.
-type ResourceProviderOperationDefinition struct {
- Name *string `json:"name,omitempty"`
- Display *ResourceProviderOperationDisplayProperties `json:"display,omitempty"`
-}
-
-// ResourceProviderOperationDetailListResult is list of resource provider
-// operations.
-type ResourceProviderOperationDetailListResult struct {
- autorest.Response `json:"-"`
- Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"`
-}
-
-// ResourceProviderOperationDisplayProperties is resource provider operation's
-// display properties.
-type ResourceProviderOperationDisplayProperties struct {
- Publisher *string `json:"publisher,omitempty"`
- Provider *string `json:"provider,omitempty"`
- Resource *string `json:"resource,omitempty"`
- Operation *string `json:"operation,omitempty"`
- Description *string `json:"description,omitempty"`
-}
-
-// ResourceType is resource Type
-type ResourceType struct {
- Name *string `json:"name,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Operations *[]Operation `json:"operations,omitempty"`
-}
-
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
-}
-
-// TagCount is tag count.
-type TagCount struct {
- Type *string `json:"type,omitempty"`
- Value *string `json:"value,omitempty"`
-}
-
-// TagDetails is tag details.
-type TagDetails struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- TagName *string `json:"tagName,omitempty"`
- Count *TagCount `json:"count,omitempty"`
- Values *[]TagValue `json:"values,omitempty"`
-}
-
-// TagsListResult is list of subscription tags.
-type TagsListResult struct {
- autorest.Response `json:"-"`
- Value *[]TagDetails `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// TagsListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client TagsListResult) TagsListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// TagValue is tag information.
-type TagValue struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- TagValueProperty *string `json:"tagValue,omitempty"`
- Count *TagCount `json:"count,omitempty"`
-}
-
-// TargetResource is target resource.
-type TargetResource struct {
- ID *string `json:"id,omitempty"`
- ResourceName *string `json:"resourceName,omitempty"`
- ResourceType *string `json:"resourceType,omitempty"`
-}
-
-// TemplateLink is entity representing the reference to the template.
-type TemplateLink struct {
- URI *string `json:"uri,omitempty"`
- ContentVersion *string `json:"contentVersion,omitempty"`
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/assignments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/assignments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/assignments.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/assignments.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,690 @@
+package policy
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// AssignmentsClient is the client for the Assignments methods of the Policy
+// service.
+type AssignmentsClient struct {
+ ManagementClient
+}
+
+// NewAssignmentsClient creates an instance of the AssignmentsClient client.
+func NewAssignmentsClient(subscriptionID string) AssignmentsClient {
+ return NewAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAssignmentsClientWithBaseURI creates an instance of the
+// AssignmentsClient client.
+func NewAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) AssignmentsClient {
+ return AssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create policy assignment.
+//
+// scope is scope of the policy assignment. policyAssignmentName is policy
+// assignment name. parameters is policy assignment.
+func (client AssignmentsClient) Create(scope string, policyAssignmentName string, parameters Assignment) (result Assignment, err error) {
+ req, err := client.CreatePreparer(scope, policyAssignmentName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client AssignmentsClient) CreatePreparer(scope string, policyAssignmentName string, parameters Assignment) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentName": autorest.Encode("path", policyAssignmentName),
+ "scope": scope,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Assignment, 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
+}
+
+// CreateByID create policy assignment by Id.
+//
+// policyAssignmentID is policy assignment Id parameters is policy assignment.
+func (client AssignmentsClient) CreateByID(policyAssignmentID string, parameters Assignment) (result Assignment, err error) {
+ req, err := client.CreateByIDPreparer(policyAssignmentID, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateByIDPreparer prepares the CreateByID request.
+func (client AssignmentsClient) CreateByIDPreparer(policyAssignmentID string, parameters Assignment) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentId": policyAssignmentID,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{policyAssignmentId}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateByIDSender sends the CreateByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) CreateByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateByIDResponder handles the response to the CreateByID request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result Assignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete policy assignment.
+//
+// scope is scope of the policy assignment. policyAssignmentName is policy
+// assignment name.
+func (client AssignmentsClient) Delete(scope string, policyAssignmentName string) (result Assignment, err error) {
+ req, err := client.DeletePreparer(scope, policyAssignmentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AssignmentsClient) DeletePreparer(scope string, policyAssignmentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentName": autorest.Encode("path", policyAssignmentName),
+ "scope": scope,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) DeleteResponder(resp *http.Response) (result Assignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteByID delete policy assignment.
+//
+// policyAssignmentID is policy assignment Id
+func (client AssignmentsClient) DeleteByID(policyAssignmentID string) (result Assignment, err error) {
+ req, err := client.DeleteByIDPreparer(policyAssignmentID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteByIDPreparer prepares the DeleteByID request.
+func (client AssignmentsClient) DeleteByIDPreparer(policyAssignmentID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentId": policyAssignmentID,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{policyAssignmentId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteByIDSender sends the DeleteByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteByIDResponder handles the response to the DeleteByID request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) DeleteByIDResponder(resp *http.Response) (result Assignment, 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 single policy assignment.
+//
+// scope is scope of the policy assignment. policyAssignmentName is policy
+// assignment name.
+func (client AssignmentsClient) Get(scope string, policyAssignmentName string) (result Assignment, err error) {
+ req, err := client.GetPreparer(scope, policyAssignmentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AssignmentsClient) GetPreparer(scope string, policyAssignmentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentName": autorest.Encode("path", policyAssignmentName),
+ "scope": scope,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyassignments/{policyAssignmentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) GetResponder(resp *http.Response) (result Assignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetByID get single policy assignment.
+//
+// policyAssignmentID is policy assignment Id
+func (client AssignmentsClient) GetByID(policyAssignmentID string) (result Assignment, err error) {
+ req, err := client.GetByIDPreparer(policyAssignmentID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetByIDSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", resp, "Failure sending request")
+ }
+
+ result, err = client.GetByIDResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetByIDPreparer prepares the GetByID request.
+func (client AssignmentsClient) GetByIDPreparer(policyAssignmentID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyAssignmentId": policyAssignmentID,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{policyAssignmentId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetByIDSender sends the GetByID request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) GetByIDSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetByIDResponder handles the response to the GetByID request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) GetByIDResponder(resp *http.Response) (result Assignment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets all the policy assignments of a subscription.
+//
+// filter is the filter to apply on the operation.
+func (client AssignmentsClient) List(filter string) (result AssignmentListResult, err error) {
+ req, err := client.ListPreparer(filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AssignmentsClient) ListPreparer(filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyassignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) ListResponder(resp *http.Response) (result AssignmentListResult, 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 AssignmentsClient) ListNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error) {
+ req, err := lastResults.AssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForResource gets policy assignments of the resource.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is the resource provider namespace.
+// parentResourcePath is the parent resource path. resourceType is the
+// resource type. resourceName is the resource name. filter is the filter to
+// apply on the operation.
+func (client AssignmentsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResult, err error) {
+ req, err := client.ListForResourcePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourcePreparer prepares the ListForResource request.
+func (client AssignmentsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyassignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceSender sends the ListForResource request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) ListForResourceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceResponder handles the response to the ListForResource request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) ListForResourceResponder(resp *http.Response) (result AssignmentListResult, 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 AssignmentsClient) ListForResourceNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error) {
+ req, err := lastResults.AssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListForResourceGroup gets policy assignments of the resource group.
+//
+// resourceGroupName is resource group name. filter is the filter to apply on
+// the operation.
+func (client AssignmentsClient) ListForResourceGroup(resourceGroupName string, filter string) (result AssignmentListResult, err error) {
+ req, err := client.ListForResourceGroupPreparer(resourceGroupName, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListForResourceGroupPreparer prepares the ListForResourceGroup request.
+func (client AssignmentsClient) ListForResourceGroupPreparer(resourceGroupName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = filter
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client AssignmentsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always
+// closes the http.Response Body.
+func (client AssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result AssignmentListResult, 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 AssignmentsClient) ListForResourceGroupNextResults(lastResults AssignmentListResult) (result AssignmentListResult, err error) {
+ req, err := lastResults.AssignmentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListForResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListForResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,57 @@
+// Package policy implements the Azure ARM Policy service API version
+// 2015-10-01-preview.
+//
+package policy
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Policy
+ APIVersion = "2015-10-01-preview"
+
+ // DefaultBaseURI is the default URI used for the service Policy
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Policy.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/definitions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/definitions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/definitions.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/definitions.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,314 @@
+package policy
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// DefinitionsClient is the client for the Definitions methods of the Policy
+// service.
+type DefinitionsClient struct {
+ ManagementClient
+}
+
+// NewDefinitionsClient creates an instance of the DefinitionsClient client.
+func NewDefinitionsClient(subscriptionID string) DefinitionsClient {
+ return NewDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDefinitionsClientWithBaseURI creates an instance of the
+// DefinitionsClient client.
+func NewDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) DefinitionsClient {
+ return DefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or update a policy definition.
+//
+// policyDefinitionName is the policy definition name. parameters is the
+// policy definition properties.
+func (client DefinitionsClient) CreateOrUpdate(policyDefinitionName string, parameters Definition) (result Definition, err error) {
+ req, err := client.CreateOrUpdatePreparer(policyDefinitionName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DefinitionsClient) CreateOrUpdatePreparer(policyDefinitionName string, parameters Definition) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyDefinitionName": autorest.Encode("path", policyDefinitionName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client DefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client DefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result Definition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes the policy definition.
+//
+// policyDefinitionName is the policy definition name.
+func (client DefinitionsClient) Delete(policyDefinitionName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(policyDefinitionName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client DefinitionsClient) DeletePreparer(policyDefinitionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyDefinitionName": autorest.Encode("path", policyDefinitionName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client DefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client DefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the policy definition.
+//
+// policyDefinitionName is the policy definition name.
+func (client DefinitionsClient) Get(policyDefinitionName string) (result Definition, err error) {
+ req, err := client.GetPreparer(policyDefinitionName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DefinitionsClient) GetPreparer(policyDefinitionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "policyDefinitionName": autorest.Encode("path", policyDefinitionName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client DefinitionsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client DefinitionsClient) GetResponder(resp *http.Response) (result Definition, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets all the policy definitions of a subscription.
+//
+// filter is the filter to apply on the operation.
+func (client DefinitionsClient) List(filter string) (result DefinitionListResult, err error) {
+ req, err := client.ListPreparer(filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DefinitionsClient) ListPreparer(filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client DefinitionsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client DefinitionsClient) ListResponder(resp *http.Response) (result DefinitionListResult, 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 DefinitionsClient) ListNextResults(lastResults DefinitionListResult) (result DefinitionListResult, err error) {
+ req, err := lastResults.DefinitionListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,107 @@
+package policy
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// Type enumerates the values for type.
+type Type string
+
+const (
+ // BuiltIn specifies the built in state for type.
+ BuiltIn Type = "BuiltIn"
+ // Custom specifies the custom state for type.
+ Custom Type = "Custom"
+ // NotSpecified specifies the not specified state for type.
+ NotSpecified Type = "NotSpecified"
+)
+
+// Assignment is the policy definition.
+type Assignment struct {
+ autorest.Response `json:"-"`
+ Properties *AssignmentProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Name *string `json:"name,omitempty"`
+}
+
+// AssignmentListResult is list of policy assignments.
+type AssignmentListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Assignment `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AssignmentListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client AssignmentListResult) AssignmentListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// AssignmentProperties is the policy assignment properties.
+type AssignmentProperties struct {
+ DisplayName *string `json:"displayName,omitempty"`
+ PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"`
+ Scope *string `json:"scope,omitempty"`
+}
+
+// Definition is the policy definition.
+type Definition struct {
+ autorest.Response `json:"-"`
+ Properties *DefinitionProperties `json:"properties,omitempty"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+}
+
+// DefinitionListResult is list of policy definitions.
+type DefinitionListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Definition `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DefinitionListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client DefinitionListResult) DefinitionListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// DefinitionProperties is the policy definition properties.
+type DefinitionProperties struct {
+ PolicyType Type `json:"policyType,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Description *string `json:"description,omitempty"`
+ PolicyRule *map[string]interface{} `json:"policyRule,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/policy/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package policy
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "policy", "2015-10-01-preview")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationdetails.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationdetails.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationdetails.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationdetails.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,105 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// ProviderOperationDetailsClient is the client for the
-// ProviderOperationDetails methods of the Resources service.
-type ProviderOperationDetailsClient struct {
- ManagementClient
-}
-
-// NewProviderOperationDetailsClient creates an instance of the
-// ProviderOperationDetailsClient client.
-func NewProviderOperationDetailsClient(subscriptionID string) ProviderOperationDetailsClient {
- return NewProviderOperationDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewProviderOperationDetailsClientWithBaseURI creates an instance of the
-// ProviderOperationDetailsClient client.
-func NewProviderOperationDetailsClientWithBaseURI(baseURI string, subscriptionID string) ProviderOperationDetailsClient {
- return ProviderOperationDetailsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets a list of resource providers.
-//
-// resourceProviderNamespace is resource identity.
-func (client ProviderOperationDetailsClient) List(resourceProviderNamespace string, apiVersion string) (result ResourceProviderOperationDetailListResult, ae error) {
- req, err := client.ListPreparer(resourceProviderNamespace, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationDetailsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationDetailsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProviderOperationDetailsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ProviderOperationDetailsClient) ListPreparer(resourceProviderNamespace string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/{resourceProviderNamespace}/operations"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProviderOperationDetailsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ProviderOperationDetailsClient) ListResponder(resp *http.Response) (result ResourceProviderOperationDetailListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationsmetadataoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationsmetadataoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationsmetadataoperations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/provideroperationsmetadataoperations.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,171 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// ProviderOperationsMetadataOperationsClient is the client for the
-// ProviderOperationsMetadataOperations methods of the Resources service.
-type ProviderOperationsMetadataOperationsClient struct {
- ManagementClient
-}
-
-// NewProviderOperationsMetadataOperationsClient creates an instance of the
-// ProviderOperationsMetadataOperationsClient client.
-func NewProviderOperationsMetadataOperationsClient(subscriptionID string) ProviderOperationsMetadataOperationsClient {
- return NewProviderOperationsMetadataOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewProviderOperationsMetadataOperationsClientWithBaseURI creates an
-// instance of the ProviderOperationsMetadataOperationsClient client.
-func NewProviderOperationsMetadataOperationsClientWithBaseURI(baseURI string, subscriptionID string) ProviderOperationsMetadataOperationsClient {
- return ProviderOperationsMetadataOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets provider operations metadata
-//
-// resourceProviderNamespace is namespace of the resource provider.
-func (client ProviderOperationsMetadataOperationsClient) Get(resourceProviderNamespace string, apiVersion string, expand string) (result ProviderOperationsMetadata, ae error) {
- req, err := client.GetPreparer(resourceProviderNamespace, apiVersion, expand)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ProviderOperationsMetadataOperationsClient) GetPreparer(resourceProviderNamespace string, apiVersion string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = expand
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProviderOperationsMetadataOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ProviderOperationsMetadataOperationsClient) GetResponder(resp *http.Response) (result ProviderOperationsMetadata, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets provider operations metadata list
-//
-func (client ProviderOperationsMetadataOperationsClient) List(apiVersion string, expand string) (result ProviderOperationsMetadataListResult, ae error) {
- req, err := client.ListPreparer(apiVersion, expand)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProviderOperationsMetadataOperationsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ProviderOperationsMetadataOperationsClient) ListPreparer(apiVersion string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = expand
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Authorization/providerOperations"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProviderOperationsMetadataOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ProviderOperationsMetadataOperationsClient) ListResponder(resp *http.Response) (result ProviderOperationsMetadataListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/providers.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/providers.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/providers.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/providers.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,316 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// ProvidersClient is the client for the Providers methods of the Resources
-// service.
-type ProvidersClient struct {
- ManagementClient
-}
-
-// NewProvidersClient creates an instance of the ProvidersClient client.
-func NewProvidersClient(subscriptionID string) ProvidersClient {
- return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient
-// client.
-func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
- return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a resource provider.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-func (client ProvidersClient) Get(resourceProviderNamespace string) (result Provider, ae error) {
- req, err := client.GetPreparer(resourceProviderNamespace)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProvidersClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ProvidersClient) GetPreparer(resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of resource providers.
-//
-// top is query parameters. If null is passed returns all deployments.
-func (client ProvidersClient) List(top *int) (result ProviderListResult, ae error) {
- req, err := client.ListPreparer(top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ProvidersClient) ListPreparer(top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 ProvidersClient) ListNextResults(lastResults ProviderListResult) (result ProviderListResult, ae error) {
- req, err := lastResults.ProviderListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProvidersClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// Register registers provider to be used with a subscription.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-func (client ProvidersClient) Register(resourceProviderNamespace string) (result Provider, ae error) {
- req, err := client.RegisterPreparer(resourceProviderNamespace)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Register", "Failure preparing request")
- }
-
- resp, err := client.RegisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Register", "Failure sending request")
- }
-
- result, err = client.RegisterResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProvidersClient", "Register", "Failure responding to request")
- }
-
- return
-}
-
-// RegisterPreparer prepares the Register request.
-func (client ProvidersClient) RegisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// RegisterSender sends the Register request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// RegisterResponder handles the response to the Register request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Unregister unregisters provider from a subscription.
-//
-// resourceProviderNamespace is namespace of the resource provider.
-func (client ProvidersClient) Unregister(resourceProviderNamespace string) (result Provider, ae error) {
- req, err := client.UnregisterPreparer(resourceProviderNamespace)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Unregister", "Failure preparing request")
- }
-
- resp, err := client.UnregisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/ProvidersClient", "Unregister", "Failure sending request")
- }
-
- result, err = client.UnregisterResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/ProvidersClient", "Unregister", "Failure responding to request")
- }
-
- return
-}
-
-// UnregisterPreparer prepares the Unregister request.
-func (client ProvidersClient) UnregisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// UnregisterSender sends the Unregister request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// UnregisterResponder handles the response to the Unregister request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,492 @@
+// Package resources implements the Azure ARM Resources service API version
+// 2016-02-01.
+//
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Resources
+ APIVersion = "2016-02-01"
+
+ // DefaultBaseURI is the default URI used for the service Resources
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Resources.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
+
+// CheckExistence checks whether resource exists.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client ManagementClient) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
+ req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CheckExistence", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckExistenceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CheckExistence", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckExistenceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "CheckExistence", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckExistencePreparer prepares the CheckExistence request.
+func (client ManagementClient) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsHead(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckExistenceSender sends the CheckExistence request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckExistenceResponder handles the response to the CheckExistence request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create a resource.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity. parameters is create or
+// update resource parameters.
+func (client ManagementClient) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete resource and all of its resources.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client ManagementClient) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ManagementClient) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get returns a resource belonging to a resource group.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client ManagementClient) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ManagementClient) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetResponder(resp *http.Response) (result GenericResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get all of the resources under a subscription.
+//
+// filter is the filter to apply on the operation. top is query parameters. If
+// null is passed returns all resource groups.
+func (client ManagementClient) List(filter string, top *int32) (result ResourceListResult, err error) {
+ req, err := client.ListPreparer(filter, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ManagementClient) ListPreparer(filter string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListResponder(resp *http.Response) (result ResourceListResult, 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 ManagementClient) ListNextResults(lastResults ResourceListResult) (result ResourceListResult, err error) {
+ req, err := lastResults.ResourceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// MoveResources move resources from one resource group to another. The
+// resources being moved should all be in the same resource group. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// sourceResourceGroupName is source resource group name. parameters is move
+// resources' parameters.
+func (client ManagementClient) MoveResources(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.MoveResourcesPreparer(sourceResourceGroupName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "MoveResources", nil, "Failure preparing request")
+ }
+
+ resp, err := client.MoveResourcesSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "MoveResources", resp, "Failure sending request")
+ }
+
+ result, err = client.MoveResourcesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ManagementClient", "MoveResources", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// MoveResourcesPreparer prepares the MoveResources request.
+func (client ManagementClient) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// MoveResourcesSender sends the MoveResources request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) MoveResourcesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// MoveResourcesResponder handles the response to the MoveResources request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deploymentoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deploymentoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deploymentoperations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deploymentoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,199 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// DeploymentOperationsClient is the client for the DeploymentOperations
+// methods of the Resources service.
+type DeploymentOperationsClient struct {
+ ManagementClient
+}
+
+// NewDeploymentOperationsClient creates an instance of the
+// DeploymentOperationsClient client.
+func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
+ return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDeploymentOperationsClientWithBaseURI creates an instance of the
+// DeploymentOperationsClient client.
+func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
+ return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get get a list of deployments operations.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment. operationID is
+// operation Id.
+func (client DeploymentOperationsClient) Get(resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) {
+ req, err := client.GetPreparer(resourceGroupName, deploymentName, operationID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DeploymentOperationsClient) GetPreparer(resourceGroupName string, deploymentName string, operationID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of deployments operations.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment. top is query
+// parameters.
+func (client DeploymentOperationsClient) List(resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, deploymentName, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DeploymentOperationsClient) ListPreparer(resourceGroupName string, deploymentName string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, 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 DeploymentOperationsClient) ListNextResults(lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, err error) {
+ req, err := lastResults.DeploymentOperationsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,587 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// DeploymentsClient is the client for the Deployments methods of the
+// Resources service.
+type DeploymentsClient struct {
+ ManagementClient
+}
+
+// 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)}
+}
+
+// Cancel cancel a currently running template deployment.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment.
+func (client DeploymentsClient) Cancel(resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
+ req, err := client.CancelPreparer(resourceGroupName, deploymentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CancelSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", resp, "Failure sending request")
+ }
+
+ result, err = client.CancelResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CancelPreparer prepares the Cancel request.
+func (client DeploymentsClient) CancelPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CancelSender sends the Cancel request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CancelResponder handles the response to the Cancel request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CheckExistence checks whether deployment exists.
+//
+// resourceGroupName is the name of the resource group to check. The name is
+// case insensitive. deploymentName is the name of the deployment.
+func (client DeploymentsClient) CheckExistence(resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
+ req, err := client.CheckExistencePreparer(resourceGroupName, deploymentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckExistenceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckExistenceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckExistencePreparer prepares the CheckExistence request.
+func (client DeploymentsClient) CheckExistencePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsHead(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckExistenceSender sends the CheckExistence request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckExistenceResponder handles the response to the CheckExistence request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create a named template deployment using a template. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment. parameters is
+// additional parameters supplied to the operation.
+func (client DeploymentsClient) CreateOrUpdate(resourceGroupName string, deploymentName string, parameters Deployment, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, deploymentName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DeploymentsClient) CreateOrUpdatePreparer(resourceGroupName string, deploymentName string, parameters Deployment, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// 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) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Delete delete deployment. This method may poll for completion. Polling can
+// be canceled by passing the cancel channel argument. The channel will be
+// used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment to be deleted.
+func (client DeploymentsClient) Delete(resourceGroupName string, deploymentName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, deploymentName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client DeploymentsClient) DeletePreparer(resourceGroupName string, deploymentName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// 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) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// 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.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ExportTemplate exports a deployment template.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment.
+func (client DeploymentsClient) ExportTemplate(resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) {
+ req, err := client.ExportTemplatePreparer(resourceGroupName, deploymentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ExportTemplateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure sending request")
+ }
+
+ result, err = client.ExportTemplateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ExportTemplatePreparer prepares the ExportTemplate request.
+func (client DeploymentsClient) ExportTemplatePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ExportTemplateSender sends the ExportTemplate request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, 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 deployment.
+//
+// resourceGroupName is the name of the resource group to get. The name is
+// case insensitive. deploymentName is the name of the deployment.
+func (client DeploymentsClient) Get(resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) {
+ req, err := client.GetPreparer(resourceGroupName, deploymentName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DeploymentsClient) GetPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// 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) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get a list of deployments.
+//
+// resourceGroupName is the name of the resource group to filter by. The name
+// is case insensitive. filter is the filter to apply on the operation. top
+// is query parameters. If null is passed returns all deployments.
+func (client DeploymentsClient) List(resourceGroupName string, filter string, top *int32) (result DeploymentListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, filter, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DeploymentsClient) ListPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// 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) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) ListResponder(resp *http.Response) (result DeploymentListResult, 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(lastResults DeploymentListResult) (result DeploymentListResult, err error) {
+ req, err := lastResults.DeploymentListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Validate validate a deployment template.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. deploymentName is the name of the deployment. parameters is
+// deployment to validate.
+func (client DeploymentsClient) Validate(resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) {
+ req, err := client.ValidatePreparer(resourceGroupName, deploymentName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ValidateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", resp, "Failure sending request")
+ }
+
+ result, err = client.ValidateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ValidatePreparer prepares the Validate request.
+func (client DeploymentsClient) ValidatePreparer(resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "deploymentName": autorest.Encode("path", deploymentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ValidateSender sends the Validate request. The method will close the
+// http.Response Body if it receives an error.
+func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ValidateResponder handles the response to the Validate request. The method always
+// closes the http.Response Body.
+func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/groups.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/groups.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/groups.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/groups.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,610 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// GroupsClient is the client for the Groups methods of the Resources service.
+type GroupsClient struct {
+ ManagementClient
+}
+
+// NewGroupsClient creates an instance of the GroupsClient client.
+func NewGroupsClient(subscriptionID string) GroupsClient {
+ return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client.
+func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
+ return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckExistence checks whether resource group exists.
+//
+// resourceGroupName is the name of the resource group to check. The name is
+// case insensitive.
+func (client GroupsClient) CheckExistence(resourceGroupName string) (result autorest.Response, err error) {
+ req, err := client.CheckExistencePreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckExistenceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckExistenceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckExistencePreparer prepares the CheckExistence request.
+func (client GroupsClient) CheckExistencePreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsHead(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckExistenceSender sends the CheckExistence request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckExistenceResponder handles the response to the CheckExistence request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create a resource group.
+//
+// resourceGroupName is the name of the resource group to be created or
+// updated. parameters is parameters supplied to the create or update
+// resource group service operation.
+func (client GroupsClient) CreateOrUpdate(resourceGroupName string, parameters ResourceGroup) (result ResourceGroup, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client GroupsClient) CreateOrUpdatePreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ResourceGroup, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete resource group. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group to be deleted. The name
+// is case insensitive.
+func (client GroupsClient) Delete(resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client GroupsClient) DeletePreparer(resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ExportTemplate captures the specified resource group as a template.
+//
+// resourceGroupName is the name of the resource group to be created or
+// updated. parameters is parameters supplied to the export template resource
+// group operation.
+func (client GroupsClient) ExportTemplate(resourceGroupName string, parameters ExportTemplateRequest) (result ResourceGroupExportResult, err error) {
+ req, err := client.ExportTemplatePreparer(resourceGroupName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ExportTemplateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure sending request")
+ }
+
+ result, err = client.ExportTemplateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ExportTemplatePreparer prepares the ExportTemplate request.
+func (client GroupsClient) ExportTemplatePreparer(resourceGroupName string, parameters ExportTemplateRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ExportTemplateSender sends the ExportTemplate request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result ResourceGroupExportResult, 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 resource group.
+//
+// resourceGroupName is the name of the resource group to get. The name is
+// case insensitive.
+func (client GroupsClient) Get(resourceGroupName string) (result ResourceGroup, err error) {
+ req, err := client.GetPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client GroupsClient) GetPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) GetResponder(resp *http.Response) (result ResourceGroup, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a collection of resource groups.
+//
+// filter is the filter to apply on the operation. top is query parameters. If
+// null is passed returns all resource groups.
+func (client GroupsClient) List(filter string, top *int32) (result ResourceGroupListResult, err error) {
+ req, err := client.ListPreparer(filter, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client GroupsClient) ListPreparer(filter string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) ListResponder(resp *http.Response) (result ResourceGroupListResult, 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 GroupsClient) ListNextResults(lastResults ResourceGroupListResult) (result ResourceGroupListResult, err error) {
+ req, err := lastResults.ResourceGroupListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListResources get all of the resources under a subscription.
+//
+// resourceGroupName is query parameters. If null is passed returns all
+// resource groups. filter is the filter to apply on the operation. top is
+// query parameters. If null is passed returns all resource groups.
+func (client GroupsClient) ListResources(resourceGroupName string, filter string, top *int32) (result ResourceListResult, err error) {
+ req, err := client.ListResourcesPreparer(resourceGroupName, filter, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListResourcesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResourcesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListResourcesPreparer prepares the ListResources request.
+func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListResourcesSender sends the ListResources request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) ListResourcesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResourcesResponder handles the response to the ListResources request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) ListResourcesResponder(resp *http.Response) (result ResourceListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListResourcesNextResults retrieves the next set of results, if any.
+func (client GroupsClient) ListResourcesNextResults(lastResults ResourceListResult) (result ResourceListResult, err error) {
+ req, err := lastResults.ResourceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListResourcesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResourcesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Patch resource groups can be updated through a simple PATCH operation to a
+// group address. The format of the request is the same as that for creating
+// a resource groups, though if a field is unspecified current value will be
+// carried over.
+//
+// resourceGroupName is the name of the resource group to be created or
+// updated. The name is case insensitive. parameters is parameters supplied
+// to the update state resource group service operation.
+func (client GroupsClient) Patch(resourceGroupName string, parameters ResourceGroup) (result ResourceGroup, err error) {
+ req, err := client.PatchPreparer(resourceGroupName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", nil, "Failure preparing request")
+ }
+
+ resp, err := client.PatchSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", resp, "Failure sending request")
+ }
+
+ result, err = client.PatchResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Patch", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// PatchPreparer prepares the Patch request.
+func (client GroupsClient) PatchPreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// PatchSender sends the Patch request. The method will close the
+// http.Response Body if it receives an error.
+func (client GroupsClient) PatchSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// PatchResponder handles the response to the Patch request. The method always
+// closes the http.Response Body.
+func (client GroupsClient) PatchResponder(resp *http.Response) (result ResourceGroup, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,444 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// DeploymentMode enumerates the values for deployment mode.
+type DeploymentMode string
+
+const (
+ // Complete specifies the complete state for deployment mode.
+ Complete DeploymentMode = "Complete"
+ // Incremental specifies the incremental state for deployment mode.
+ Incremental DeploymentMode = "Incremental"
+)
+
+// ResourceIdentityType enumerates the values for resource identity type.
+type ResourceIdentityType string
+
+const (
+ // SystemAssigned specifies the system assigned state for resource
+ // identity type.
+ SystemAssigned ResourceIdentityType = "SystemAssigned"
+)
+
+// BasicDependency is deployment dependency information.
+type BasicDependency struct {
+ ID *string `json:"id,omitempty"`
+ ResourceType *string `json:"resourceType,omitempty"`
+ ResourceName *string `json:"resourceName,omitempty"`
+}
+
+// DebugSetting is
+type DebugSetting struct {
+ DetailLevel *string `json:"detailLevel,omitempty"`
+}
+
+// Dependency is deployment dependency information.
+type Dependency struct {
+ DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
+ ID *string `json:"id,omitempty"`
+ ResourceType *string `json:"resourceType,omitempty"`
+ ResourceName *string `json:"resourceName,omitempty"`
+}
+
+// Deployment is deployment operation parameters.
+type Deployment struct {
+ Properties *DeploymentProperties `json:"properties,omitempty"`
+}
+
+// DeploymentExportResult is
+type DeploymentExportResult struct {
+ autorest.Response `json:"-"`
+ Template *map[string]interface{} `json:"template,omitempty"`
+}
+
+// DeploymentExtended is deployment information.
+type DeploymentExtended struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
+}
+
+// DeploymentExtendedFilter is deployment filter.
+type DeploymentExtendedFilter struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// DeploymentListResult is list of deployments.
+type DeploymentListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]DeploymentExtended `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DeploymentListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client DeploymentListResult) DeploymentListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// DeploymentOperation is deployment operation information.
+type DeploymentOperation struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ OperationID *string `json:"operationId,omitempty"`
+ Properties *DeploymentOperationProperties `json:"properties,omitempty"`
+}
+
+// DeploymentOperationProperties is deployment operation properties.
+type DeploymentOperationProperties struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ Timestamp *date.Time `json:"timestamp,omitempty"`
+ ServiceRequestID *string `json:"serviceRequestId,omitempty"`
+ StatusCode *string `json:"statusCode,omitempty"`
+ StatusMessage *map[string]interface{} `json:"statusMessage,omitempty"`
+ TargetResource *TargetResource `json:"targetResource,omitempty"`
+ Request *HTTPMessage `json:"request,omitempty"`
+ Response *HTTPMessage `json:"response,omitempty"`
+}
+
+// DeploymentOperationsListResult is list of deployment operations.
+type DeploymentOperationsListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]DeploymentOperation `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DeploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client DeploymentOperationsListResult) DeploymentOperationsListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// DeploymentProperties is deployment properties.
+type DeploymentProperties struct {
+ Template *map[string]interface{} `json:"template,omitempty"`
+ TemplateLink *TemplateLink `json:"templateLink,omitempty"`
+ Parameters *map[string]interface{} `json:"parameters,omitempty"`
+ ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
+ Mode DeploymentMode `json:"mode,omitempty"`
+ DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
+}
+
+// DeploymentPropertiesExtended is deployment properties with additional
+// details.
+type DeploymentPropertiesExtended struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ CorrelationID *string `json:"correlationId,omitempty"`
+ Timestamp *date.Time `json:"timestamp,omitempty"`
+ Outputs *map[string]interface{} `json:"outputs,omitempty"`
+ Providers *[]Provider `json:"providers,omitempty"`
+ Dependencies *[]Dependency `json:"dependencies,omitempty"`
+ Template *map[string]interface{} `json:"template,omitempty"`
+ TemplateLink *TemplateLink `json:"templateLink,omitempty"`
+ Parameters *map[string]interface{} `json:"parameters,omitempty"`
+ ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
+ Mode DeploymentMode `json:"mode,omitempty"`
+ DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
+}
+
+// DeploymentValidateResult is information from validate template deployment
+// response.
+type DeploymentValidateResult struct {
+ autorest.Response `json:"-"`
+ Error *ResourceManagementErrorWithDetails `json:"error,omitempty"`
+ Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
+}
+
+// ExportTemplateRequest is export resource group template request parameters.
+type ExportTemplateRequest struct {
+ Resources *[]string `json:"resources,omitempty"`
+ Options *string `json:"options,omitempty"`
+}
+
+// GenericResource is resource information.
+type GenericResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Plan *Plan `json:"plan,omitempty"`
+ Properties *map[string]interface{} `json:"properties,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ ManagedBy *string `json:"managedBy,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ Identity *Identity `json:"identity,omitempty"`
+}
+
+// GenericResourceFilter is resource filter.
+type GenericResourceFilter struct {
+ ResourceType *string `json:"resourceType,omitempty"`
+ Tagname *string `json:"tagname,omitempty"`
+ Tagvalue *string `json:"tagvalue,omitempty"`
+ Expand *string `json:"expand,omitempty"`
+}
+
+// HTTPMessage is
+type HTTPMessage struct {
+ Content *map[string]interface{} `json:"content,omitempty"`
+}
+
+// Identity is identity for the resource.
+type Identity struct {
+ PrincipalID *string `json:"principalId,omitempty"`
+ TenantID *string `json:"tenantId,omitempty"`
+ Type ResourceIdentityType `json:"type,omitempty"`
+}
+
+// MoveInfo is parameters of move resources.
+type MoveInfo struct {
+ Resources *[]string `json:"resources,omitempty"`
+ TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
+}
+
+// ParametersLink is entity representing the reference to the deployment
+// paramaters.
+type ParametersLink struct {
+ URI *string `json:"uri,omitempty"`
+ ContentVersion *string `json:"contentVersion,omitempty"`
+}
+
+// Plan is plan for the resource.
+type Plan struct {
+ Name *string `json:"name,omitempty"`
+ Publisher *string `json:"publisher,omitempty"`
+ Product *string `json:"product,omitempty"`
+ PromotionCode *string `json:"promotionCode,omitempty"`
+}
+
+// Provider is resource provider information.
+type Provider struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Namespace *string `json:"namespace,omitempty"`
+ RegistrationState *string `json:"registrationState,omitempty"`
+ ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
+}
+
+// ProviderListResult is list of resource providers.
+type ProviderListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Provider `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ProviderListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ProviderListResult) ProviderListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ProviderResourceType is resource type managed by the resource provider.
+type ProviderResourceType struct {
+ ResourceType *string `json:"resourceType,omitempty"`
+ Locations *[]string `json:"locations,omitempty"`
+ APIVersions *[]string `json:"apiVersions,omitempty"`
+ Properties *map[string]*string `json:"properties,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceGroup is resource group information.
+type ResourceGroup struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Properties *ResourceGroupProperties `json:"properties,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceGroupExportResult is
+type ResourceGroupExportResult struct {
+ autorest.Response `json:"-"`
+ Template *map[string]interface{} `json:"template,omitempty"`
+ Error *ResourceManagementErrorWithDetails `json:"error,omitempty"`
+}
+
+// ResourceGroupFilter is resource group filter.
+type ResourceGroupFilter struct {
+ TagName *string `json:"tagName,omitempty"`
+ TagValue *string `json:"tagValue,omitempty"`
+}
+
+// ResourceGroupListResult is list of resource groups.
+type ResourceGroupListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]ResourceGroup `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResourceGroupListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResourceGroupListResult) ResourceGroupListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResourceGroupProperties is the resource group properties.
+type ResourceGroupProperties struct {
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// ResourceListResult is list of resource groups.
+type ResourceListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]GenericResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ResourceListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client ResourceListResult) ResourceListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// ResourceManagementErrorWithDetails is
+type ResourceManagementErrorWithDetails struct {
+ Code *string `json:"code,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Target *string `json:"target,omitempty"`
+ Details *[]ResourceManagementErrorWithDetails `json:"details,omitempty"`
+}
+
+// ResourceProviderOperationDisplayProperties is resource provider operation's
+// display properties.
+type ResourceProviderOperationDisplayProperties struct {
+ Publisher *string `json:"publisher,omitempty"`
+ Provider *string `json:"provider,omitempty"`
+ Resource *string `json:"resource,omitempty"`
+ Operation *string `json:"operation,omitempty"`
+ Description *string `json:"description,omitempty"`
+}
+
+// Sku is sku for the resource.
+type Sku struct {
+ Name *string `json:"name,omitempty"`
+ Tier *string `json:"tier,omitempty"`
+ Size *string `json:"size,omitempty"`
+ Family *string `json:"family,omitempty"`
+ Model *string `json:"model,omitempty"`
+ Capacity *int32 `json:"capacity,omitempty"`
+}
+
+// SubResource is
+type SubResource struct {
+ ID *string `json:"id,omitempty"`
+}
+
+// TagCount is tag count.
+type TagCount struct {
+ Type *string `json:"type,omitempty"`
+ Value *string `json:"value,omitempty"`
+}
+
+// TagDetails is tag details.
+type TagDetails struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ TagName *string `json:"tagName,omitempty"`
+ Count *TagCount `json:"count,omitempty"`
+ Values *[]TagValue `json:"values,omitempty"`
+}
+
+// TagsListResult is list of subscription tags.
+type TagsListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]TagDetails `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// TagsListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client TagsListResult) TagsListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// TagValue is tag information.
+type TagValue struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ TagValueProperty *string `json:"tagValue,omitempty"`
+ Count *TagCount `json:"count,omitempty"`
+}
+
+// TargetResource is target resource.
+type TargetResource struct {
+ ID *string `json:"id,omitempty"`
+ ResourceName *string `json:"resourceName,omitempty"`
+ ResourceType *string `json:"resourceType,omitempty"`
+}
+
+// TemplateLink is entity representing the reference to the template.
+type TemplateLink struct {
+ URI *string `json:"uri,omitempty"`
+ ContentVersion *string `json:"contentVersion,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/providers.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/providers.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/providers.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/providers.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,312 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ProvidersClient is the client for the Providers methods of the Resources
+// service.
+type ProvidersClient struct {
+ ManagementClient
+}
+
+// NewProvidersClient creates an instance of the ProvidersClient client.
+func NewProvidersClient(subscriptionID string) ProvidersClient {
+ return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient
+// client.
+func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
+ return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get gets a resource provider.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+func (client ProvidersClient) Get(resourceProviderNamespace string) (result Provider, err error) {
+ req, err := client.GetPreparer(resourceProviderNamespace)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ProvidersClient) GetPreparer(resourceProviderNamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of resource providers.
+//
+// top is query parameters. If null is passed returns all deployments.
+func (client ProvidersClient) List(top *int32) (result ProviderListResult, err error) {
+ req, err := client.ListPreparer(top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ProvidersClient) ListPreparer(top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, 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 ProvidersClient) ListNextResults(lastResults ProviderListResult) (result ProviderListResult, err error) {
+ req, err := lastResults.ProviderListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// Register registers provider to be used with a subscription.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+func (client ProvidersClient) Register(resourceProviderNamespace string) (result Provider, err error) {
+ req, err := client.RegisterPreparer(resourceProviderNamespace)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegisterSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", resp, "Failure sending request")
+ }
+
+ result, err = client.RegisterResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegisterPreparer prepares the Register request.
+func (client ProvidersClient) RegisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegisterSender sends the Register request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegisterResponder handles the response to the Register request. The method always
+// closes the http.Response Body.
+func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Unregister unregisters provider from a subscription.
+//
+// resourceProviderNamespace is namespace of the resource provider.
+func (client ProvidersClient) Unregister(resourceProviderNamespace string) (result Provider, err error) {
+ req, err := client.UnregisterPreparer(resourceProviderNamespace)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UnregisterSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", resp, "Failure sending request")
+ }
+
+ result, err = client.UnregisterResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UnregisterPreparer prepares the Unregister request.
+func (client ProvidersClient) UnregisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UnregisterSender sends the Unregister request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UnregisterResponder handles the response to the Unregister request. The method always
+// closes the http.Response Body.
+func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resources.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resources.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resources.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resources.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,473 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// Client is the client for the Resources methods of the Resources service.
+type Client struct {
+ ManagementClient
+}
+
+// NewClient creates an instance of the Client client.
+func NewClient(subscriptionID string) Client {
+ return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewClientWithBaseURI creates an instance of the Client client.
+func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
+ return Client{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckExistence checks whether resource exists.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client Client) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
+ req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckExistenceSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckExistenceResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckExistencePreparer prepares the CheckExistence request.
+func (client Client) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsHead(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckExistenceSender sends the CheckExistence request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckExistenceResponder handles the response to the CheckExistence request. The method always
+// closes the http.Response Body.
+func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create a resource.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity. parameters is create or
+// update resource parameters.
+func (client Client) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client Client) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete resource and all of its resources.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client Client) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.Client", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client Client) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get returns a resource belonging to a resource group.
+//
+// resourceGroupName is the name of the resource group. The name is case
+// insensitive. resourceProviderNamespace is resource identity.
+// parentResourcePath is resource identity. resourceType is resource
+// identity. resourceName is resource identity.
+func (client Client) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.Client", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client Client) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "parentResourcePath": parentResourcePath,
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "resourceName": autorest.Encode("path", resourceName),
+ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
+ "resourceType": resourceType,
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get all of the resources under a subscription.
+//
+// filter is the filter to apply on the operation. top is query parameters. If
+// null is passed returns all resource groups.
+func (client Client) List(filter string, top *int32) (result ResourceListResult, err error) {
+ req, err := client.ListPreparer(filter, top)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client Client) ListPreparer(filter string, top *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if top != nil {
+ queryParameters["$top"] = autorest.Encode("query", *top)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client Client) ListResponder(resp *http.Response) (result ResourceListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client Client) ListNextResults(lastResults ResourceListResult) (result ResourceListResult, err error) {
+ req, err := lastResults.ResourceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// MoveResources move resources from one resource group to another. The
+// resources being moved should all be in the same resource group. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
+//
+// sourceResourceGroupName is source resource group name. parameters is move
+// resources' parameters.
+func (client Client) MoveResources(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.MoveResourcesPreparer(sourceResourceGroupName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.Client", "MoveResources", nil, "Failure preparing request")
+ }
+
+ resp, err := client.MoveResourcesSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.Client", "MoveResources", resp, "Failure sending request")
+ }
+
+ result, err = client.MoveResourcesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.Client", "MoveResources", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// MoveResourcesPreparer prepares the MoveResources request.
+func (client Client) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// MoveResourcesSender sends the MoveResources request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) MoveResourcesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// MoveResourcesResponder handles the response to the MoveResources request. The method always
+// closes the http.Response Body.
+func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/tags.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/tags.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/tags.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/tags.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,366 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// TagsClient is the client for the Tags methods of the Resources service.
+type TagsClient struct {
+ ManagementClient
+}
+
+// NewTagsClient creates an instance of the TagsClient client.
+func NewTagsClient(subscriptionID string) TagsClient {
+ return NewTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewTagsClientWithBaseURI creates an instance of the TagsClient client.
+func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
+ return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create a subscription resource tag.
+//
+// tagName is the name of the tag.
+func (client TagsClient) CreateOrUpdate(tagName string) (result TagDetails, err error) {
+ req, err := client.CreateOrUpdatePreparer(tagName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client TagsClient) CreateOrUpdatePreparer(tagName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "tagName": autorest.Encode("path", tagName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, 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
+}
+
+// CreateOrUpdateValue create a subscription resource tag value.
+//
+// tagName is the name of the tag. tagValue is the value of the tag.
+func (client TagsClient) CreateOrUpdateValue(tagName string, tagValue string) (result TagValue, err error) {
+ req, err := client.CreateOrUpdateValuePreparer(tagName, tagValue)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateValueSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateValueResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateValuePreparer prepares the CreateOrUpdateValue request.
+func (client TagsClient) CreateOrUpdateValuePreparer(tagName string, tagValue string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "tagName": autorest.Encode("path", tagName),
+ "tagValue": autorest.Encode("path", tagValue),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateValueSender sends the CreateOrUpdateValue request. The method will close the
+// http.Response Body if it receives an error.
+func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateValueResponder handles the response to the CreateOrUpdateValue request. The method always
+// closes the http.Response Body.
+func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete a subscription resource tag.
+//
+// tagName is the name of the tag.
+func (client TagsClient) Delete(tagName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(tagName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client TagsClient) DeletePreparer(tagName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "tagName": autorest.Encode("path", tagName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client TagsClient) 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
+}
+
+// DeleteValue delete a subscription resource tag value.
+//
+// tagName is the name of the tag. tagValue is the value of the tag.
+func (client TagsClient) DeleteValue(tagName string, tagValue string) (result autorest.Response, err error) {
+ req, err := client.DeleteValuePreparer(tagName, tagValue)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteValueSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteValueResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteValuePreparer prepares the DeleteValue request.
+func (client TagsClient) DeleteValuePreparer(tagName string, tagValue string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "tagName": autorest.Encode("path", tagName),
+ "tagValue": autorest.Encode("path", tagValue),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteValueSender sends the DeleteValue request. The method will close the
+// http.Response Body if it receives an error.
+func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteValueResponder handles the response to the DeleteValue request. The method always
+// closes the http.Response Body.
+func (client TagsClient) DeleteValueResponder(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
+}
+
+// List get a list of subscription resource tags.
+func (client TagsClient) List() (result TagsListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client TagsClient) ListPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, 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 TagsClient) ListNextResults(lastResults TagsListResult) (result TagsListResult, err error) {
+ req, err := lastResults.TagsListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package resources
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "resources", "2016-02-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/resources.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,472 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// Client is the client for the Resources methods of the Resources service.
-type Client struct {
- ManagementClient
-}
-
-// NewClient creates an instance of the Client client.
-func NewClient(subscriptionID string) Client {
- return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewClientWithBaseURI creates an instance of the Client client.
-func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
- return Client{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CheckExistence checks whether resource exists.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client Client) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, ae error) {
- req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "CheckExistence", "Failure preparing request")
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/Client", "CheckExistence", "Failure sending request")
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "CheckExistence", "Failure responding to request")
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client Client) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusNotFound)
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate create a resource.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity. parameters is create or
-// update resource parameters.
-func (client Client) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (result GenericResource, ae error) {
- req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/Client", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client Client) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusCreated, http.StatusOK)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete delete resource and all of its resources.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client Client) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/Client", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client Client) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent, http.StatusAccepted)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get returns a resource belonging to a resource group.
-//
-// resourceGroupName is the name of the resource group. The name is case
-// insensitive. resourceProviderNamespace is resource identity.
-// parentResourcePath is resource identity. resourceType is resource
-// identity. resourceName is resource identity.
-func (client Client) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result GenericResource, ae error) {
- req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/Client", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client Client) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "resourceName": url.QueryEscape(resourceName),
- "resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List get all of the resources under a subscription.
-//
-// filter is the filter to apply on the operation. top is query parameters. If
-// null is passed returns all resource groups.
-func (client Client) List(filter string, top *int) (result ResourceListResult, ae error) {
- req, err := client.ListPreparer(filter, top)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/Client", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client Client) ListPreparer(filter string, top *int) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = filter
- }
- if top != nil {
- queryParameters["$top"] = top
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resources"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client Client) ListResponder(resp *http.Response) (result ResourceListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client Client) ListNextResults(lastResults ResourceListResult) (result ResourceListResult, ae error) {
- req, err := lastResults.ResourceListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/Client", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// MoveResources begin moving resources.To determine whether the operation has
-// finished processing the request, call GetLongRunningOperationStatus.
-//
-// sourceResourceGroupName is source resource group name. parameters is move
-// resources' parameters.
-func (client Client) MoveResources(sourceResourceGroupName string, parameters MoveInfo) (result autorest.Response, ae error) {
- req, err := client.MoveResourcesPreparer(sourceResourceGroupName, parameters)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/Client", "MoveResources", "Failure preparing request")
- }
-
- resp, err := client.MoveResourcesSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/Client", "MoveResources", "Failure sending request")
- }
-
- result, err = client.MoveResourcesResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/Client", "MoveResources", "Failure responding to request")
- }
-
- return
-}
-
-// MoveResourcesPreparer prepares the MoveResources request.
-func (client Client) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "sourceResourceGroupName": url.QueryEscape(sourceResourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"),
- autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// MoveResourcesSender sends the MoveResources request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) MoveResourcesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNoContent)
-}
-
-// MoveResourcesResponder handles the response to the MoveResources request. The method always
-// closes the http.Response Body.
-func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,255 @@
+// Package subscriptions implements the Azure ARM Subscriptions service API
+// version 2015-11-01.
+//
+package subscriptions
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+const (
+ // APIVersion is the version of the Subscriptions
+ APIVersion = "2015-11-01"
+
+ // DefaultBaseURI is the default URI used for the service Subscriptions
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Subscriptions.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+}
+
+// New creates an instance of the ManagementClient client.
+func New() ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ }
+}
+
+// Get gets details about particular subscription.
+//
+// subscriptionID is id of the subscription.
+func (client ManagementClient) Get(subscriptionID string) (result Subscription, err error) {
+ req, err := client.GetPreparer(subscriptionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ManagementClient) GetPreparer(subscriptionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", subscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) GetResponder(resp *http.Response) (result Subscription, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of the subscriptionIds.
+func (client ManagementClient) List() (result SubscriptionListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ManagementClient) ListPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/subscriptions"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListResponder(resp *http.Response) (result SubscriptionListResult, 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 ManagementClient) ListNextResults(lastResults SubscriptionListResult) (result SubscriptionListResult, err error) {
+ req, err := lastResults.SubscriptionListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListLocations gets a list of the subscription locations.
+//
+// subscriptionID is id of the subscription
+func (client ManagementClient) ListLocations(subscriptionID string) (result LocationListResult, err error) {
+ req, err := client.ListLocationsPreparer(subscriptionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "ListLocations", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListLocationsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "ListLocations", resp, "Failure sending request")
+ }
+
+ result, err = client.ListLocationsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.ManagementClient", "ListLocations", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListLocationsPreparer prepares the ListLocations request.
+func (client ManagementClient) ListLocationsPreparer(subscriptionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", subscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/locations", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListLocationsSender sends the ListLocations request. The method will close the
+// http.Response Body if it receives an error.
+func (client ManagementClient) ListLocationsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListLocationsResponder handles the response to the ListLocations request. The method always
+// closes the http.Response Body.
+func (client ManagementClient) ListLocationsResponder(resp *http.Response) (result LocationListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,101 @@
+package subscriptions
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// Location is location information.
+type Location struct {
+ ID *string `json:"id,omitempty"`
+ SubscriptionID *string `json:"subscriptionId,omitempty"`
+ Name *string `json:"name,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Latitude *string `json:"latitude,omitempty"`
+ Longitude *string `json:"longitude,omitempty"`
+}
+
+// LocationListResult is location list operation response.
+type LocationListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Location `json:"value,omitempty"`
+}
+
+// Subscription is subscription information.
+type Subscription struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ SubscriptionID *string `json:"subscriptionId,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ State *string `json:"state,omitempty"`
+ SubscriptionPolicies *SubscriptionPolicies `json:"subscriptionPolicies,omitempty"`
+}
+
+// SubscriptionListResult is subscription list operation response.
+type SubscriptionListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Subscription `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// SubscriptionListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client SubscriptionListResult) SubscriptionListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// SubscriptionPolicies is subscription policies.
+type SubscriptionPolicies struct {
+ LocationPlacementID *string `json:"locationPlacementId,omitempty"`
+ QuotaID *string `json:"quotaId,omitempty"`
+}
+
+// TenantIDDescription is tenant Id information
+type TenantIDDescription struct {
+ ID *string `json:"id,omitempty"`
+ TenantID *string `json:"tenantId,omitempty"`
+}
+
+// TenantListResult is tenant Ids information.
+type TenantListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]TenantIDDescription `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// TenantListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client TenantListResult) TenantListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/subscriptions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/subscriptions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/subscriptions.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/subscriptions.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,239 @@
+package subscriptions
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// Client is the client for the Subscriptions methods of the Subscriptions
+// service.
+type Client struct {
+ ManagementClient
+}
+
+// NewClient creates an instance of the Client client.
+func NewClient() Client {
+ return NewClientWithBaseURI(DefaultBaseURI)
+}
+
+// NewClientWithBaseURI creates an instance of the Client client.
+func NewClientWithBaseURI(baseURI string) Client {
+ return Client{NewWithBaseURI(baseURI)}
+}
+
+// Get gets details about particular subscription.
+//
+// subscriptionID is id of the subscription.
+func (client Client) Get(subscriptionID string) (result Subscription, err error) {
+ req, err := client.GetPreparer(subscriptionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.Client", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client Client) GetPreparer(subscriptionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", subscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client Client) GetResponder(resp *http.Response) (result Subscription, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List gets a list of the subscriptionIds.
+func (client Client) List() (result SubscriptionListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client Client) ListPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/subscriptions"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client Client) ListResponder(resp *http.Response) (result SubscriptionListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client Client) ListNextResults(lastResults SubscriptionListResult) (result SubscriptionListResult, err error) {
+ req, err := lastResults.SubscriptionListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListLocations gets a list of the subscription locations.
+//
+// subscriptionID is id of the subscription
+func (client Client) ListLocations(subscriptionID string) (result LocationListResult, err error) {
+ req, err := client.ListLocationsPreparer(subscriptionID)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListLocationsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", resp, "Failure sending request")
+ }
+
+ result, err = client.ListLocationsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.Client", "ListLocations", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListLocationsPreparer prepares the ListLocations request.
+func (client Client) ListLocationsPreparer(subscriptionID string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", subscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/locations", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListLocationsSender sends the ListLocations request. The method will close the
+// http.Response Body if it receives an error.
+func (client Client) ListLocationsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListLocationsResponder handles the response to the ListLocations request. The method always
+// closes the http.Response Body.
+func (client Client) ListLocationsResponder(resp *http.Response) (result LocationListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/tenants.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/tenants.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/tenants.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/tenants.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,119 @@
+package subscriptions
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// TenantsClient is the client for the Tenants methods of the Subscriptions
+// service.
+type TenantsClient struct {
+ ManagementClient
+}
+
+// NewTenantsClient creates an instance of the TenantsClient client.
+func NewTenantsClient() TenantsClient {
+ return NewTenantsClientWithBaseURI(DefaultBaseURI)
+}
+
+// NewTenantsClientWithBaseURI creates an instance of the TenantsClient client.
+func NewTenantsClientWithBaseURI(baseURI string) TenantsClient {
+ return TenantsClient{NewWithBaseURI(baseURI)}
+}
+
+// List gets a list of the tenantIds.
+func (client TenantsClient) List() (result TenantListResult, err error) {
+ req, err := client.ListPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure sending request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client TenantsClient) ListPreparer() (*http.Request, error) {
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/tenants"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client TenantsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client TenantsClient) ListResponder(resp *http.Response) (result TenantListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListNextResults retrieves the next set of results, if any.
+func (client TenantsClient) ListNextResults(lastResults TenantListResult) (result TenantListResult, err error) {
+ req, err := lastResults.TenantListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package subscriptions
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "subscriptions", "2015-11-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/tags.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/tags.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/tags.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/tags.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,371 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// TagsClient is the client for the Tags methods of the Resources service.
-type TagsClient struct {
- ManagementClient
-}
-
-// NewTagsClient creates an instance of the TagsClient client.
-func NewTagsClient(subscriptionID string) TagsClient {
- return NewTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewTagsClientWithBaseURI creates an instance of the TagsClient client.
-func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
- return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate create a subscription resource tag.
-//
-// tagName is the name of the tag.
-func (client TagsClient) CreateOrUpdate(tagName string) (result TagDetails, ae error) {
- req, err := client.CreateOrUpdatePreparer(tagName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdate", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdate", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdate", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client TagsClient) CreateOrUpdatePreparer(tagName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "tagName": url.QueryEscape(tagName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateValue create a subscription resource tag value.
-//
-// tagName is the name of the tag. tagValue is the value of the tag.
-func (client TagsClient) CreateOrUpdateValue(tagName string, tagValue string) (result TagValue, ae error) {
- req, err := client.CreateOrUpdateValuePreparer(tagName, tagValue)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdateValue", "Failure preparing request")
- }
-
- resp, err := client.CreateOrUpdateValueSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdateValue", "Failure sending request")
- }
-
- result, err = client.CreateOrUpdateValueResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "CreateOrUpdateValue", "Failure responding to request")
- }
-
- return
-}
-
-// CreateOrUpdateValuePreparer prepares the CreateOrUpdateValue request.
-func (client TagsClient) CreateOrUpdateValuePreparer(tagName string, tagValue string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "tagName": url.QueryEscape(tagName),
- "tagValue": url.QueryEscape(tagValue),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// CreateOrUpdateValueSender sends the CreateOrUpdateValue request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
-}
-
-// CreateOrUpdateValueResponder handles the response to the CreateOrUpdateValue request. The method always
-// closes the http.Response Body.
-func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete delete a subscription resource tag.
-//
-// tagName is the name of the tag.
-func (client TagsClient) Delete(tagName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(tagName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "Delete", "Failure preparing request")
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "Delete", "Failure sending request")
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "Delete", "Failure responding to request")
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TagsClient) DeletePreparer(tagName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "tagName": url.QueryEscape(tagName),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteValue delete a subscription resource tag value.
-//
-// tagName is the name of the tag. tagValue is the value of the tag.
-func (client TagsClient) DeleteValue(tagName string, tagValue string) (result autorest.Response, ae error) {
- req, err := client.DeleteValuePreparer(tagName, tagValue)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "DeleteValue", "Failure preparing request")
- }
-
- resp, err := client.DeleteValueSender(req)
- if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "DeleteValue", "Failure sending request")
- }
-
- result, err = client.DeleteValueResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "DeleteValue", "Failure responding to request")
- }
-
- return
-}
-
-// DeleteValuePreparer prepares the DeleteValue request.
-func (client TagsClient) DeleteValuePreparer(tagName string, tagValue string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "tagName": url.QueryEscape(tagName),
- "tagValue": url.QueryEscape(tagValue),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// DeleteValueSender sends the DeleteValue request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
-}
-
-// DeleteValueResponder handles the response to the DeleteValue request. The method always
-// closes the http.Response Body.
-func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// List get a list of subscription resource tags.
-func (client TagsClient) List() (result TagsListResult, ae error) {
- req, err := client.ListPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TagsClient) ListPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/tagNames"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 TagsClient) ListNextResults(lastResults TagsListResult) (result TagsListResult, ae error) {
- req, err := lastResults.TagsListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "resources/TagsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/resources/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/resources/version.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,43 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "fmt"
-)
-
-const (
- major = "0"
- minor = "3"
- patch = "0"
- // Always begin a "tag" with a dash (as per http://semver.org)
- tag = "-beta"
- semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
-)
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "resources", "2014-04-01-preview")
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,6 @@
+// Package scheduler implements the Azure ARM Scheduler service API version
+// 2016-03-01.
+//
package scheduler
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,17 +17,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Scheduler
- APIVersion = "2014-08-01-preview"
+ APIVersion = "2016-03-01"
// DefaultBaseURI is the default URI used for the service Scheduler
DefaultBaseURI = "https://management.azure.com"
@@ -34,6 +37,7 @@
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +51,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobcollections.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobcollections.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobcollections.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobcollections.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// JobCollectionsClient is the client for the JobCollections methods of the
@@ -47,21 +47,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobCollection is the job collection definition.
-func (client JobCollectionsClient) CreateOrUpdate(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, ae error) {
+func (client JobCollectionsClient) CreateOrUpdate(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, jobCollectionName, jobCollection)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -70,29 +70,29 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client JobCollectionsClient) CreateOrUpdatePreparer(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithJSON(jobCollection),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -101,62 +101,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// Delete deletes a job collection.
+// Delete deletes a job collection. This method may poll for completion.
+// Polling can be canceled by passing the cancel channel argument. The
+// channel will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name.
-func (client JobCollectionsClient) Delete(resourceGroupName string, jobCollectionName string) (result autorest.Response, ae error) {
- req, err := client.DeletePreparer(resourceGroupName, jobCollectionName)
+func (client JobCollectionsClient) Delete(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
-func (client JobCollectionsClient) DeletePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
+func (client JobCollectionsClient) DeletePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -165,61 +168,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Disable disables all of the jobs in the job collection.
+// Disable disables all of the jobs in the job collection. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name.
-func (client JobCollectionsClient) Disable(resourceGroupName string, jobCollectionName string) (result autorest.Response, ae error) {
- req, err := client.DisablePreparer(resourceGroupName, jobCollectionName)
+func (client JobCollectionsClient) Disable(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DisablePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Disable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Disable", nil, "Failure preparing request")
}
resp, err := client.DisableSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Disable", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Disable", resp, "Failure sending request")
}
result, err = client.DisableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Disable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Disable", resp, "Failure responding to request")
}
return
}
// DisablePreparer prepares the Disable request.
-func (client JobCollectionsClient) DisablePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
+func (client JobCollectionsClient) DisablePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DisableSender sends the Disable request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) DisableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DisableResponder handles the response to the Disable request. The method always
@@ -228,61 +235,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
-// Enable enables all of the jobs in the job collection.
+// Enable enables all of the jobs in the job collection. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name.
-func (client JobCollectionsClient) Enable(resourceGroupName string, jobCollectionName string) (result autorest.Response, ae error) {
- req, err := client.EnablePreparer(resourceGroupName, jobCollectionName)
+func (client JobCollectionsClient) Enable(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.EnablePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Enable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Enable", nil, "Failure preparing request")
}
resp, err := client.EnableSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Enable", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Enable", resp, "Failure sending request")
}
result, err = client.EnableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Enable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Enable", resp, "Failure responding to request")
}
return
}
// EnablePreparer prepares the Enable request.
-func (client JobCollectionsClient) EnablePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
+func (client JobCollectionsClient) EnablePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// EnableSender sends the Enable request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) EnableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// EnableResponder handles the response to the Enable request. The method always
@@ -291,7 +302,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
@@ -301,21 +312,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name.
-func (client JobCollectionsClient) Get(resourceGroupName string, jobCollectionName string) (result JobCollectionDefinition, ae error) {
+func (client JobCollectionsClient) Get(resourceGroupName string, jobCollectionName string) (result JobCollectionDefinition, err error) {
req, err := client.GetPreparer(resourceGroupName, jobCollectionName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Get", resp, "Failure responding to request")
}
return
@@ -324,28 +335,27 @@
// GetPreparer prepares the Get request.
func (client JobCollectionsClient) GetPreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -354,7 +364,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -364,21 +374,21 @@
// ListByResourceGroup gets all job collections under specified resource group.
//
// resourceGroupName is the resource group name.
-func (client JobCollectionsClient) ListByResourceGroup(resourceGroupName string) (result JobCollectionListResult, ae error) {
+func (client JobCollectionsClient) ListByResourceGroup(resourceGroupName string) (result JobCollectionListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", nil, "Failure preparing request")
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", resp, "Failure sending request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
@@ -387,27 +397,26 @@
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client JobCollectionsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
@@ -416,7 +425,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -424,10 +433,10 @@
}
// ListByResourceGroupNextResults retrieves the next set of results, if any.
-func (client JobCollectionsClient) ListByResourceGroupNextResults(lastResults JobCollectionListResult) (result JobCollectionListResult, ae error) {
+func (client JobCollectionsClient) ListByResourceGroupNextResults(lastResults JobCollectionListResult) (result JobCollectionListResult, err error) {
req, err := lastResults.JobCollectionListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -436,33 +445,33 @@
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", resp, "Failure sending next results request request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListByResourceGroup", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
}
return
}
// ListBySubscription gets all job collections under specified subscription.
-func (client JobCollectionsClient) ListBySubscription() (result JobCollectionListResult, ae error) {
+func (client JobCollectionsClient) ListBySubscription() (result JobCollectionListResult, err error) {
req, err := client.ListBySubscriptionPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", nil, "Failure preparing request")
}
resp, err := client.ListBySubscriptionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", resp, "Failure sending request")
}
result, err = client.ListBySubscriptionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", resp, "Failure responding to request")
}
return
@@ -471,26 +480,25 @@
// ListBySubscriptionPreparer prepares the ListBySubscription request.
func (client JobCollectionsClient) ListBySubscriptionPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
@@ -499,7 +507,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -507,10 +515,10 @@
}
// ListBySubscriptionNextResults retrieves the next set of results, if any.
-func (client JobCollectionsClient) ListBySubscriptionNextResults(lastResults JobCollectionListResult) (result JobCollectionListResult, ae error) {
+func (client JobCollectionsClient) ListBySubscriptionNextResults(lastResults JobCollectionListResult) (result JobCollectionListResult, err error) {
req, err := lastResults.JobCollectionListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -519,12 +527,12 @@
resp, err := client.ListBySubscriptionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", resp, "Failure sending next results request request")
}
result, err = client.ListBySubscriptionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "ListBySubscription", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "ListBySubscription", resp, "Failure responding to next results request request")
}
return
@@ -534,21 +542,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobCollection is the job collection definition.
-func (client JobCollectionsClient) Patch(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, ae error) {
+func (client JobCollectionsClient) Patch(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, err error) {
req, err := client.PatchPreparer(resourceGroupName, jobCollectionName, jobCollection)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Patch", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Patch", nil, "Failure preparing request")
}
resp, err := client.PatchSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Patch", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Patch", resp, "Failure sending request")
}
result, err = client.PatchResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobCollectionsClient", "Patch", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Patch", resp, "Failure responding to request")
}
return
@@ -557,29 +565,29 @@
// PatchPreparer prepares the Patch request.
func (client JobCollectionsClient) PatchPreparer(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithJSON(jobCollection),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// PatchSender sends the Patch request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) PatchSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// PatchResponder handles the response to the Patch request. The method always
@@ -588,7 +596,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobs.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobs.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobs.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/jobs.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// JobsClient is the client for the Jobs methods of the Scheduler service.
@@ -43,21 +43,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name. job is the job definition.
-func (client JobsClient) CreateOrUpdate(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, ae error) {
+func (client JobsClient) CreateOrUpdate(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, jobCollectionName, jobName, job)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -66,30 +66,30 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client JobsClient) CreateOrUpdatePreparer(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithJSON(job),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -98,7 +98,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -109,21 +109,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name.
-func (client JobsClient) Delete(resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, ae error) {
+func (client JobsClient) Delete(resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, jobCollectionName, jobName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "Delete", resp, "Failure responding to request")
}
return
@@ -132,29 +132,28 @@
// DeletePreparer prepares the Delete request.
func (client JobsClient) DeletePreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -163,7 +162,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@@ -173,21 +172,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name.
-func (client JobsClient) Get(resourceGroupName string, jobCollectionName string, jobName string) (result JobDefinition, ae error) {
+func (client JobsClient) Get(resourceGroupName string, jobCollectionName string, jobName string) (result JobDefinition, err error) {
req, err := client.GetPreparer(resourceGroupName, jobCollectionName, jobName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Get", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Get", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "Get", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "Get", resp, "Failure responding to request")
}
return
@@ -196,29 +195,28 @@
// GetPreparer prepares the Get request.
func (client JobsClient) GetPreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
@@ -227,7 +225,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -239,58 +237,61 @@
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. top is the number of jobs to request, in the of range
// [1..100]. skip is the (0-based) index of the job history list from which
-// to begin requesting entries.
-func (client JobsClient) List(resourceGroupName string, jobCollectionName string, top *int, skip *int) (result JobListResult, ae error) {
- req, err := client.ListPreparer(resourceGroupName, jobCollectionName, top, skip)
+// to begin requesting entries. filter is the filter to apply on the job
+// state.
+func (client JobsClient) List(resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (result JobListResult, err error) {
+ req, err := client.ListPreparer(resourceGroupName, jobCollectionName, top, skip, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
-func (client JobsClient) ListPreparer(resourceGroupName string, jobCollectionName string, top *int, skip *int) (*http.Request, error) {
+func (client JobsClient) ListPreparer(resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if top != nil {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", *top)
}
if skip != nil {
- queryParameters["$skip"] = skip
+ queryParameters["$skip"] = autorest.Encode("query", *skip)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -299,7 +300,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -307,10 +308,10 @@
}
// ListNextResults retrieves the next set of results, if any.
-func (client JobsClient) ListNextResults(lastResults JobListResult) (result JobListResult, ae error) {
+func (client JobsClient) ListNextResults(lastResults JobListResult) (result JobListResult, err error) {
req, err := lastResults.JobListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -319,12 +320,12 @@
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "List", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "List", resp, "Failure responding to next results request request")
}
return
@@ -335,59 +336,62 @@
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name. top is the number of job history
// to request, in the of range [1..100]. skip is the (0-based) index of the
-// job history list from which to begin requesting entries.
-func (client JobsClient) ListJobHistory(resourceGroupName string, jobCollectionName string, jobName string, top *int, skip *int) (result JobHistoryListResult, ae error) {
- req, err := client.ListJobHistoryPreparer(resourceGroupName, jobCollectionName, jobName, top, skip)
+// job history list from which to begin requesting entries. filter is the
+// filter to apply on the job state.
+func (client JobsClient) ListJobHistory(resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (result JobHistoryListResult, err error) {
+ req, err := client.ListJobHistoryPreparer(resourceGroupName, jobCollectionName, jobName, top, skip, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", nil, "Failure preparing request")
}
resp, err := client.ListJobHistorySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", resp, "Failure sending request")
}
result, err = client.ListJobHistoryResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", resp, "Failure responding to request")
}
return
}
// ListJobHistoryPreparer prepares the ListJobHistory request.
-func (client JobsClient) ListJobHistoryPreparer(resourceGroupName string, jobCollectionName string, jobName string, top *int, skip *int) (*http.Request, error) {
+func (client JobsClient) ListJobHistoryPreparer(resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if top != nil {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", *top)
}
if skip != nil {
- queryParameters["$skip"] = skip
+ queryParameters["$skip"] = autorest.Encode("query", *skip)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListJobHistorySender sends the ListJobHistory request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) ListJobHistorySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListJobHistoryResponder handles the response to the ListJobHistory request. The method always
@@ -396,7 +400,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -404,10 +408,10 @@
}
// ListJobHistoryNextResults retrieves the next set of results, if any.
-func (client JobsClient) ListJobHistoryNextResults(lastResults JobHistoryListResult) (result JobHistoryListResult, ae error) {
+func (client JobsClient) ListJobHistoryNextResults(lastResults JobHistoryListResult) (result JobHistoryListResult, err error) {
req, err := lastResults.JobHistoryListResultPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -416,12 +420,12 @@
resp, err := client.ListJobHistorySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", resp, "Failure sending next results request request")
}
result, err = client.ListJobHistoryResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "ListJobHistory", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "ListJobHistory", resp, "Failure responding to next results request request")
}
return
@@ -431,21 +435,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name. job is the job definition.
-func (client JobsClient) Patch(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, ae error) {
+func (client JobsClient) Patch(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, err error) {
req, err := client.PatchPreparer(resourceGroupName, jobCollectionName, jobName, job)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Patch", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Patch", nil, "Failure preparing request")
}
resp, err := client.PatchSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Patch", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Patch", resp, "Failure sending request")
}
result, err = client.PatchResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "Patch", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "Patch", resp, "Failure responding to request")
}
return
@@ -454,30 +458,30 @@
// PatchPreparer prepares the Patch request.
func (client JobsClient) PatchPreparer(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithJSON(job),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// PatchSender sends the Patch request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) PatchSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// PatchResponder handles the response to the Patch request. The method always
@@ -486,7 +490,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -497,21 +501,21 @@
//
// resourceGroupName is the resource group name. jobCollectionName is the job
// collection name. jobName is the job name.
-func (client JobsClient) Run(resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, ae error) {
+func (client JobsClient) Run(resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, err error) {
req, err := client.RunPreparer(resourceGroupName, jobCollectionName, jobName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Run", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Run", nil, "Failure preparing request")
}
resp, err := client.RunSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "scheduler/JobsClient", "Run", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "scheduler.JobsClient", "Run", resp, "Failure sending request")
}
result, err = client.RunResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "scheduler/JobsClient", "Run", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "scheduler.JobsClient", "Run", resp, "Failure responding to request")
}
return
@@ -520,29 +524,28 @@
// RunPreparer prepares the Run request.
func (client JobsClient) RunPreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "jobCollectionName": url.QueryEscape(jobCollectionName),
- "jobName": url.QueryEscape(jobName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "jobCollectionName": autorest.Encode("path", jobCollectionName),
+ "jobName": autorest.Encode("path", jobName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RunSender sends the Run request. The method will close the
// http.Response Body if it receives an error.
func (client JobsClient) RunSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RunResponder handles the response to the Run request. The method always
@@ -551,7 +554,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
"net/http"
)
@@ -98,11 +98,6 @@
type JobExecutionStatus string
const (
- // CallbackNotFound specifies the callback not found state for job
- // execution status.
- CallbackNotFound JobExecutionStatus = "CallbackNotFound"
- // Cancelled specifies the cancelled state for job execution status.
- Cancelled JobExecutionStatus = "Cancelled"
// Completed specifies the completed state for job execution status.
Completed JobExecutionStatus = "Completed"
// Failed specifies the failed state for job execution status.
@@ -226,8 +221,10 @@
const (
// Free specifies the free state for sku definition.
Free SkuDefinition = "Free"
- // Premium specifies the premium state for sku definition.
- Premium SkuDefinition = "Premium"
+ // P10Premium specifies the p10 premium state for sku definition.
+ P10Premium SkuDefinition = "P10Premium"
+ // P20Premium specifies the p20 premium state for sku definition.
+ P20Premium SkuDefinition = "P20Premium"
// Standard specifies the standard state for sku definition.
Standard SkuDefinition = "Standard"
)
@@ -256,11 +253,11 @@
// HTTPRequest is
type HTTPRequest struct {
- HTTPAuthentication *HTTPAuthentication `json:"httpAuthentication,omitempty"`
- URI *string `json:"uri,omitempty"`
- Method *string `json:"method,omitempty"`
- Body *string `json:"body,omitempty"`
- Headers *map[string]*string `json:"headers,omitempty"`
+ Authentication *HTTPAuthentication `json:"authentication,omitempty"`
+ URI *string `json:"uri,omitempty"`
+ Method *string `json:"method,omitempty"`
+ Body *string `json:"body,omitempty"`
+ Headers *map[string]*string `json:"headers,omitempty"`
}
// JobAction is
@@ -313,8 +310,8 @@
// JobCollectionQuota is
type JobCollectionQuota struct {
- MaxJobCount *int `json:"maxJobCount,omitempty"`
- MaxJobOccurrence *int `json:"maxJobOccurrence,omitempty"`
+ MaxJobCount *int32 `json:"maxJobCount,omitempty"`
+ MaxJobOccurrence *int32 `json:"maxJobOccurrence,omitempty"`
MaxRecurrence *JobMaxRecurrence `json:"maxRecurrence,omitempty"`
}
@@ -353,8 +350,13 @@
ActionName JobHistoryActionName `json:"actionName,omitempty"`
Status JobExecutionStatus `json:"status,omitempty"`
Message *string `json:"message,omitempty"`
- RetryCount *int `json:"retryCount,omitempty"`
- RepeatCount *int `json:"repeatCount,omitempty"`
+ RetryCount *int32 `json:"retryCount,omitempty"`
+ RepeatCount *int32 `json:"repeatCount,omitempty"`
+}
+
+// JobHistoryFilter is
+type JobHistoryFilter struct {
+ Status JobExecutionStatus `json:"status,omitempty"`
}
// JobHistoryListResult is
@@ -398,7 +400,7 @@
// JobMaxRecurrence is
type JobMaxRecurrence struct {
Frequency RecurrenceFrequency `json:"frequency,omitempty"`
- Interval *int `json:"interval,omitempty"`
+ Interval *int32 `json:"interval,omitempty"`
}
// JobProperties is
@@ -413,8 +415,8 @@
// JobRecurrence is
type JobRecurrence struct {
Frequency RecurrenceFrequency `json:"frequency,omitempty"`
- Interval *int `json:"interval,omitempty"`
- Count *int `json:"count,omitempty"`
+ Interval *int32 `json:"interval,omitempty"`
+ Count *int32 `json:"count,omitempty"`
EndTime *date.Time `json:"endTime,omitempty"`
Schedule *JobRecurrenceSchedule `json:"schedule,omitempty"`
}
@@ -422,23 +424,28 @@
// JobRecurrenceSchedule is
type JobRecurrenceSchedule struct {
WeekDays *[]DayOfWeek `json:"weekDays,omitempty"`
- Hours *[]int `json:"hours,omitempty"`
- Minutes *[]int `json:"minutes,omitempty"`
- MonthDays *[]int `json:"monthDays,omitempty"`
+ Hours *[]int32 `json:"hours,omitempty"`
+ Minutes *[]int32 `json:"minutes,omitempty"`
+ MonthDays *[]int32 `json:"monthDays,omitempty"`
MonthlyOccurrences *[]JobRecurrenceScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"`
}
// JobRecurrenceScheduleMonthlyOccurrence is
type JobRecurrenceScheduleMonthlyOccurrence struct {
Day JobScheduleDay `json:"day,omitempty"`
- Occurrence *int `json:"Occurrence,omitempty"`
+ Occurrence *int32 `json:"Occurrence,omitempty"`
+}
+
+// JobStateFilter is
+type JobStateFilter struct {
+ State JobState `json:"state,omitempty"`
}
// JobStatus is
type JobStatus struct {
- ExecutionCount *int `json:"executionCount,omitempty"`
- FailureCount *int `json:"failureCount,omitempty"`
- FaultedCount *int `json:"faultedCount,omitempty"`
+ ExecutionCount *int32 `json:"executionCount,omitempty"`
+ FailureCount *int32 `json:"failureCount,omitempty"`
+ FaultedCount *int32 `json:"faultedCount,omitempty"`
LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"`
NextExecutionTime *date.Time `json:"nextExecutionTime,omitempty"`
}
@@ -456,7 +463,7 @@
type RetryPolicy struct {
RetryType RetryType `json:"retryType,omitempty"`
RetryInterval *string `json:"retryInterval,omitempty"`
- RetryCount *int `json:"retryCount,omitempty"`
+ RetryCount *int32 `json:"retryCount,omitempty"`
}
// ServiceBusAuthentication is
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/scheduler/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "scheduler", "2014-08-01-preview")
+ return fmt.Sprintf(userAgentFormat, Version(), "scheduler", "2016-03-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/adminkeys.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/adminkeys.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/adminkeys.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/adminkeys.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// AdminKeysClient is the client that can be used to manage Azure Search
@@ -47,21 +47,21 @@
// resourceGroupName is the name of the resource group within the current
// subscription. serviceName is the name of the Search service for which to
// list admin keys.
-func (client AdminKeysClient) List(resourceGroupName string, serviceName string) (result AdminKeyResult, ae error) {
+func (client AdminKeysClient) List(resourceGroupName string, serviceName string) (result AdminKeyResult, err error) {
req, err := client.ListPreparer(resourceGroupName, serviceName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "search.AdminKeysClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "search.AdminKeysClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "search/AdminKeysClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "search.AdminKeysClient", "List", resp, "Failure responding to request")
}
return
@@ -70,28 +70,27 @@
// ListPreparer prepares the List request.
func (client AdminKeysClient) ListPreparer(resourceGroupName string, serviceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "serviceName": url.QueryEscape(serviceName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listAdminKeys"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listAdminKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client AdminKeysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -100,7 +99,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,7 @@
+// Package search implements the Azure ARM Search service API version
+// 2015-02-28.
+//
+// Client that can be used to manage Azure Search services and API keys.
package search
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,12 +18,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
@@ -30,11 +34,11 @@
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the client that can be used to manage Azure Search
-// services and API keys.
+// ManagementClient is the base client for Search.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -48,6 +52,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,12 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
// ProvisioningState enumerates the values for provisioning state.
@@ -119,9 +119,9 @@
// ServiceProperties is defines properties of an Azure Search service that can
// be modified.
type ServiceProperties struct {
- Sku *Sku `json:"sku,omitempty"`
- ReplicaCount *int `json:"replicaCount,omitempty"`
- PartitionCount *int `json:"partitionCount,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ ReplicaCount *int32 `json:"replicaCount,omitempty"`
+ PartitionCount *int32 `json:"partitionCount,omitempty"`
}
// ServiceReadableProperties is defines all the properties of an Azure Search
@@ -131,13 +131,14 @@
StatusDetails *string `json:"statusDetails,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
Sku *Sku `json:"sku,omitempty"`
- ReplicaCount *int `json:"replicaCount,omitempty"`
- PartitionCount *int `json:"partitionCount,omitempty"`
+ ReplicaCount *int32 `json:"replicaCount,omitempty"`
+ PartitionCount *int32 `json:"partitionCount,omitempty"`
}
// ServiceResource is describes an Azure Search service and its current state.
type ServiceResource struct {
autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/querykeys.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/querykeys.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/querykeys.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/querykeys.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// QueryKeysClient is the client that can be used to manage Azure Search
@@ -46,21 +46,21 @@
// resourceGroupName is the name of the resource group within the current
// subscription. serviceName is the name of the Search service for which to
// list query keys.
-func (client QueryKeysClient) List(resourceGroupName string, serviceName string) (result ListQueryKeysResult, ae error) {
+func (client QueryKeysClient) List(resourceGroupName string, serviceName string) (result ListQueryKeysResult, err error) {
req, err := client.ListPreparer(resourceGroupName, serviceName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "search/QueryKeysClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "search.QueryKeysClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "search/QueryKeysClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "search.QueryKeysClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "search/QueryKeysClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "search.QueryKeysClient", "List", resp, "Failure responding to request")
}
return
@@ -69,28 +69,27 @@
// ListPreparer prepares the List request.
func (client QueryKeysClient) ListPreparer(resourceGroupName string, serviceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "serviceName": url.QueryEscape(serviceName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listQueryKeys"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listQueryKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client QueryKeysClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -99,7 +98,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/services.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/services.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/services.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/services.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// ServicesClient is the client that can be used to manage Azure Search
@@ -49,21 +49,21 @@
// subscription. serviceName is the name of the Search service to create or
// update. parameters is the properties to set or update on the Search
// service.
-func (client ServicesClient) CreateOrUpdate(resourceGroupName string, serviceName string, parameters ServiceCreateOrUpdateParameters) (result ServiceResource, ae error) {
+func (client ServicesClient) CreateOrUpdate(resourceGroupName string, serviceName string, parameters ServiceCreateOrUpdateParameters) (result ServiceResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, serviceName, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "CreateOrUpdate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "CreateOrUpdate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "search/ServicesClient", "CreateOrUpdate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "search.ServicesClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
@@ -72,29 +72,29 @@
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ServicesClient) CreateOrUpdatePreparer(resourceGroupName string, serviceName string, parameters ServiceCreateOrUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "serviceName": url.QueryEscape(serviceName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusCreated)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
@@ -103,7 +103,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -115,21 +115,21 @@
//
// resourceGroupName is the name of the resource group within the current
// subscription. serviceName is the name of the Search service to delete.
-func (client ServicesClient) Delete(resourceGroupName string, serviceName string) (result autorest.Response, ae error) {
+func (client ServicesClient) Delete(resourceGroupName string, serviceName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, serviceName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "search/ServicesClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "search.ServicesClient", "Delete", resp, "Failure responding to request")
}
return
@@ -138,28 +138,27 @@
// DeletePreparer prepares the Delete request.
func (client ServicesClient) DeletePreparer(resourceGroupName string, serviceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "serviceName": url.QueryEscape(serviceName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serviceName": autorest.Encode("path", serviceName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound, http.StatusNoContent)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -168,7 +167,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -178,21 +177,21 @@
//
// resourceGroupName is the name of the resource group within the current
// subscription.
-func (client ServicesClient) List(resourceGroupName string) (result ServiceListResult, ae error) {
+func (client ServicesClient) List(resourceGroupName string) (result ServiceListResult, err error) {
req, err := client.ListPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "search/ServicesClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "search.ServicesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "search/ServicesClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "search.ServicesClient", "List", resp, "Failure responding to request")
}
return
@@ -201,27 +200,26 @@
// ListPreparer prepares the List request.
func (client ServicesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// 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) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -230,7 +228,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/search/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/search/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,13 +23,13 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,58 @@
+// Package servicebus implements the Azure ARM Servicebus service API version
+// 2014-09-01.
+//
+// Azure Service Bus client
+package servicebus
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Servicebus
+ APIVersion = "2014-09-01"
+
+ // DefaultBaseURI is the default URI used for the service Servicebus
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Servicebus.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,248 @@
+package servicebus
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "net/http"
+)
+
+// AccessRights enumerates the values for access rights.
+type AccessRights string
+
+const (
+ // Listen specifies the listen state for access rights.
+ Listen AccessRights = "Listen"
+ // Manage specifies the manage state for access rights.
+ Manage AccessRights = "Manage"
+ // Send specifies the send state for access rights.
+ Send AccessRights = "Send"
+)
+
+// Kind enumerates the values for kind.
+type Kind string
+
+const (
+ // EventHub specifies the event hub state for kind.
+ EventHub Kind = "EventHub"
+ // Messaging specifies the messaging state for kind.
+ Messaging Kind = "Messaging"
+)
+
+// Name enumerates the values for name.
+type Name string
+
+const (
+ // Basic specifies the basic state for name.
+ Basic Name = "Basic"
+ // Premium specifies the premium state for name.
+ Premium Name = "Premium"
+ // Standard specifies the standard state for name.
+ Standard Name = "Standard"
+)
+
+// NamespaceType enumerates the values for namespace type.
+type NamespaceType string
+
+const (
+ // NamespaceTypeEventHub specifies the namespace type event hub state for
+ // namespace type.
+ NamespaceTypeEventHub NamespaceType = "EventHub"
+ // NamespaceTypeMessaging specifies the namespace type messaging state for
+ // namespace type.
+ NamespaceTypeMessaging NamespaceType = "Messaging"
+ // NamespaceTypeNotificationHub specifies the namespace type notification
+ // hub state for namespace type.
+ NamespaceTypeNotificationHub NamespaceType = "NotificationHub"
+)
+
+// Policykey enumerates the values for policykey.
+type Policykey string
+
+const (
+ // PrimaryKey specifies the primary key state for policykey.
+ PrimaryKey Policykey = "PrimaryKey"
+ // SecondayKey specifies the seconday key state for policykey.
+ SecondayKey Policykey = "SecondayKey"
+)
+
+// Tier enumerates the values for tier.
+type Tier string
+
+const (
+ // TierBasic specifies the tier basic state for tier.
+ TierBasic Tier = "Basic"
+ // TierPremium specifies the tier premium state for tier.
+ TierPremium Tier = "Premium"
+ // TierStandard specifies the tier standard state for tier.
+ TierStandard Tier = "Standard"
+)
+
+// ARMSku is sku of the Namespace.
+type ARMSku struct {
+ Name Name `json:"Name,omitempty"`
+ Tier Tier `json:"Tier,omitempty"`
+ Capacity *int32 `json:"Capacity,omitempty"`
+}
+
+// CheckAvailabilityParameters is parameters supplied to the Check Name
+// Availability for Namespace and ServiceBus.
+type CheckAvailabilityParameters struct {
+ Name *string `json:"name,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ IsAvailiable *bool `json:"isAvailiable,omitempty"`
+}
+
+// CheckAvailabilityResource is description of a CheckAvailibility resource.
+type CheckAvailabilityResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ IsAvailiable *bool `json:"isAvailiable,omitempty"`
+}
+
+// NamespaceCreateOrUpdateParameters is parameters supplied to the
+// CreateOrUpdate Namespace operation.
+type NamespaceCreateOrUpdateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *NamespaceProperties `json:"properties,omitempty"`
+}
+
+// NamespaceListResult is the response of the List Namespace operation.
+type NamespaceListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]NamespaceResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// NamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// NamespaceProperties is properties of the Namespace.
+type NamespaceProperties struct {
+ Name *string `json:"name,omitempty"`
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ Region *string `json:"region,omitempty"`
+ Status *string `json:"status,omitempty"`
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+ ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"`
+ SubscriptionID *string `json:"subscriptionId,omitempty"`
+ Critical *bool `json:"critical,omitempty"`
+ NamespaceType NamespaceType `json:"namespaceType,omitempty"`
+}
+
+// NamespaceResource is description of a Namespace resource.
+type NamespaceResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Kind Kind `json:"kind,omitempty"`
+ Sku *ARMSku `json:"sku,omitempty"`
+ Properties *NamespaceProperties `json:"properties,omitempty"`
+}
+
+// RegenerateKeysParameters is parameters supplied to the Regenerate Namespace
+// Auth Rule.
+type RegenerateKeysParameters struct {
+ Policykey Policykey `json:"Policykey,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ResourceListKeys is namespace/ServiceBus Connection String
+type ResourceListKeys struct {
+ autorest.Response `json:"-"`
+ PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"`
+ SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"`
+ PrimaryKey *string `json:"primaryKey,omitempty"`
+ SecondaryKey *string `json:"secondaryKey,omitempty"`
+ KeyName *string `json:"keyName,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters
+// supplied to the CreateOrUpdate Namespace AuthorizationRules.
+type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
+ Location *string `json:"location,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleListResult is the response of the List
+// Namespace operation.
+type SharedAccessAuthorizationRuleListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]SharedAccessAuthorizationRuleResource `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
+// nil if no more results exist.
+func (client SharedAccessAuthorizationRuleListResult) SharedAccessAuthorizationRuleListResultPreparer() (*http.Request, error) {
+ if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(client.NextLink)))
+}
+
+// SharedAccessAuthorizationRuleProperties is sharedAccessAuthorizationRule
+// properties.
+type SharedAccessAuthorizationRuleProperties struct {
+ Rights *[]AccessRights `json:"rights,omitempty"`
+}
+
+// SharedAccessAuthorizationRuleResource is description of a Namespace
+// AuthorizationRules.
+type SharedAccessAuthorizationRuleResource struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/namespaces.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/namespaces.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/namespaces.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/namespaces.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,892 @@
+package servicebus
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// NamespacesClient is the azure Service Bus client
+type NamespacesClient struct {
+ ManagementClient
+}
+
+// NewNamespacesClient creates an instance of the NamespacesClient client.
+func NewNamespacesClient(subscriptionID string) NamespacesClient {
+ return NewNamespacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewNamespacesClientWithBaseURI creates an instance of the NamespacesClient
+// client.
+func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) NamespacesClient {
+ return NamespacesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckAvailability checks the availability of the given service namespace
+// across all Windows Azure subscriptions. This is useful because the domain
+// name is created based on the service namespace name.
+//
+// parameters is the namespace name.
+func (client NamespacesClient) CheckAvailability(parameters CheckAvailabilityParameters) (result CheckAvailabilityResource, err error) {
+ req, err := client.CheckAvailabilityPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CheckAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CheckAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CheckAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckAvailabilityPreparer prepares the CheckAvailability request.
+func (client NamespacesClient) CheckAvailabilityPreparer(parameters CheckAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/checkNamespaceAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckAvailabilitySender sends the CheckAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CheckAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CheckAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateOrUpdate creates/Updates a service namespace. Once created, this
+// namespace's resource manifest is immutable. This operation is idempotent.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. parameters is parameters supplied to create a Namespace
+// Resource.
+func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, namespaceName, parameters, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client NamespacesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdateAuthorizationRule creates an authorization rule for a
+// namespace
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is aauthorization Rule Name.
+// parameters is the shared access authorization rule.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.CreateOrUpdateAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateAuthorizationRuleSender sends the CreateOrUpdateAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes an existing namespace. This operation also removes all
+// associated resources under the namespace. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client NamespacesClient) Delete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, namespaceName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client NamespacesClient) DeletePreparer(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) 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
+}
+
+// DeleteAuthorizationRule deletes a namespace authorization rule
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is authorization Rule Name.
+func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) {
+ req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "DeleteAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "DeleteAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "DeleteAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteAuthorizationRulePreparer prepares the DeleteAuthorizationRule request.
+func (client NamespacesClient) DeleteAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteAuthorizationRuleSender sends the DeleteAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) DeleteAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteAuthorizationRuleResponder handles the response to the DeleteAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) DeleteAuthorizationRuleResponder(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 the description for the specified namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name.
+func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result NamespaceResource, err error) {
+ req, err := client.GetPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client NamespacesClient) GetPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) GetResponder(resp *http.Response) (result NamespaceResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAuthorizationRule gets an authorization rule for a namespace by name.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name authorizationRuleName is authorization rule name.
+func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
+ req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "GetAuthorizationRule", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAuthorizationRuleSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "GetAuthorizationRule", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAuthorizationRuleResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "GetAuthorizationRule", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAuthorizationRulePreparer prepares the GetAuthorizationRule request.
+func (client NamespacesClient) GetAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAuthorizationRuleSender sends the GetAuthorizationRule request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) GetAuthorizationRuleSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAuthorizationRules gets the authorization rules for a namespace.
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name
+func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAuthorizationRulesPreparer prepares the ListAuthorizationRules request.
+func (client NamespacesClient) ListAuthorizationRulesPreparer(resourceGroupName string, namespaceName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAuthorizationRulesSender sends the ListAuthorizationRules request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListAuthorizationRulesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
+func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
+ req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListAuthorizationRulesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListAuthorizationRulesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListByResourceGroup lists the available namespaces within a resourceGroup.
+//
+// resourceGroupName is the name of the resource group. If resourceGroupName
+// value is null the method lists all the namespaces within subscription
+func (client NamespacesClient) ListByResourceGroup(resourceGroupName string) (result NamespaceListResult, err error) {
+ req, err := client.ListByResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client NamespacesClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListByResourceGroupResponder(resp *http.Response) (result NamespaceListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroupNextResults retrieves the next set of results, if any.
+func (client NamespacesClient) ListByResourceGroupNextResults(lastResults NamespaceListResult) (result NamespaceListResult, err error) {
+ req, err := lastResults.NamespaceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListBySubscription lists all the available namespaces within the
+// subscription irrespective of the resourceGroups.
+func (client NamespacesClient) ListBySubscription() (result NamespaceListResult, err error) {
+ req, err := client.ListBySubscriptionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure sending request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client NamespacesClient) ListBySubscriptionPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListBySubscriptionResponder(resp *http.Response) (result NamespaceListResult, 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 NamespacesClient) ListBySubscriptionNextResults(lastResults NamespaceListResult) (result NamespaceListResult, err error) {
+ req, err := lastResults.NamespaceListResultPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", nil, "Failure preparing next results request request")
+ }
+ if req == nil {
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure sending next results request request")
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure responding to next results request request")
+ }
+
+ return
+}
+
+// ListKeys gets the Primary and Secondary ConnectionStrings to the namespace
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is the connection string of the
+// namespace for the specified authorizationRule.
+func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result ResourceListKeys, err error) {
+ req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.ListKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListKeysPreparer prepares the ListKeys request.
+func (client NamespacesClient) ListKeysPreparer(resourceGroupName string, namespaceName string, authorizationRuleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListKeysSender sends the ListKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) ListKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListKeysResponder handles the response to the ListKeys request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RegenerateKeys gets the Primary and Secondary ConnectionStrings to the
+// namespace
+//
+// resourceGroupName is the name of the resource group. namespaceName is the
+// namespace name. authorizationRuleName is the connection string of the
+// namespace for the specified authorizationRule. parameters is parameters
+// supplied to regenerate Auth Rule.
+func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
+ req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "RegenerateKeys", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RegenerateKeysSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "RegenerateKeys", resp, "Failure sending request")
+ }
+
+ result, err = client.RegenerateKeysResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "RegenerateKeys", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RegenerateKeysPreparer prepares the RegenerateKeys request.
+func (client NamespacesClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "authorizationRuleName": autorest.Encode("path", authorizationRuleName),
+ "namespaceName": autorest.Encode("path", namespaceName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RegenerateKeysSender sends the RegenerateKeys request. The method will close the
+// http.Response Body if it receives an error.
+func (client NamespacesClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always
+// closes the http.Response Body.
+func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (result ResourceListKeys, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/servicebus/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package servicebus
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "servicebus", "2014-09-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,61 @@
+// Package sql implements the Azure ARM Sql service API version
+// 2015-05-01-preview.
+//
+// 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 users to create, retrieve, update, and delete
+// Databases, Servers and related resources.
+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 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Sql
+ APIVersion = "2015-05-01-preview"
+
+ // DefaultBaseURI is the default URI used for the service Sql
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Sql.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,81 @@
+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 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// EmailAccountAdmins enumerates the values for email account admins.
+type EmailAccountAdmins string
+
+const (
+ // Disabled specifies the disabled state for email account admins.
+ Disabled EmailAccountAdmins = "Disabled"
+ // Enabled specifies the enabled state for email account admins.
+ Enabled EmailAccountAdmins = "Enabled"
+)
+
+// State enumerates the values for state.
+type State string
+
+const (
+ // StateDisabled specifies the state disabled state for state.
+ StateDisabled State = "Disabled"
+ // StateEnabled specifies the state enabled state for state.
+ StateEnabled State = "Enabled"
+ // StateNew specifies the state new state for state.
+ StateNew State = "New"
+)
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// ServerSecurityAlertPolicy is represents an Azure SQL Server Security Alert
+// Policy.
+type ServerSecurityAlertPolicy struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *ServerSecurityAlertPolicyProperties `json:"properties,omitempty"`
+}
+
+// ServerSecurityAlertPolicyCreateOrUpdateParameters is create or update
+// server security alert policy parameters.
+type ServerSecurityAlertPolicyCreateOrUpdateParameters struct {
+ Properties *ServerSecurityAlertPolicyProperties `json:"properties,omitempty"`
+}
+
+// ServerSecurityAlertPolicyProperties is represents the properties of an
+// Azure SQL Security alert policy.
+type ServerSecurityAlertPolicyProperties struct {
+ State State `json:"state,omitempty"`
+ DisabledAlerts *string `json:"disabledAlerts,omitempty"`
+ EmailAddresses *string `json:"emailAddresses,omitempty"`
+ EmailAccountAdmins EmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/securityalertpolicy.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/securityalertpolicy.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/securityalertpolicy.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/securityalertpolicy.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,180 @@
+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 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// SecurityAlertPolicyClient 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 users to
+// create, retrieve, update, and delete Databases, Servers and related
+// resources.
+type SecurityAlertPolicyClient struct {
+ ManagementClient
+}
+
+// NewSecurityAlertPolicyClient creates an instance of the
+// SecurityAlertPolicyClient client.
+func NewSecurityAlertPolicyClient(subscriptionID string) SecurityAlertPolicyClient {
+ return NewSecurityAlertPolicyClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSecurityAlertPolicyClientWithBaseURI creates an instance of the
+// SecurityAlertPolicyClient client.
+func NewSecurityAlertPolicyClientWithBaseURI(baseURI string, subscriptionID string) SecurityAlertPolicyClient {
+ return SecurityAlertPolicyClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an Azure SQL Server security alert
+// policy. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
+//
+// parameters is the required parameters for creating or updating a Azure SQL
+// Server security alert policy. resourceGroupName is the name of the
+// Resource Group to which the server belongs. serverName is the name of the
+// Azure SQL Server.
+func (client SecurityAlertPolicyClient) CreateOrUpdate(parameters ServerSecurityAlertPolicyCreateOrUpdateParameters, resourceGroupName string, serverName string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdatePreparer(parameters, resourceGroupName, serverName, cancel)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client SecurityAlertPolicyClient) CreateOrUpdatePreparer(parameters ServerSecurityAlertPolicyCreateOrUpdateParameters, resourceGroupName string, serverName string, cancel <-chan struct{}) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "serverName": autorest.Encode("path", serverName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client SecurityAlertPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client SecurityAlertPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get returns an Azure SQL Server security alert policy.
+//
+// resourceGroupName is the name of the Resource Group to which the server
+// belongs. serverName is the name of the Azure SQL Server.
+func (client SecurityAlertPolicyClient) Get(resourceGroupName string, serverName string) (result ServerSecurityAlertPolicy, err error) {
+ req, err := client.GetPreparer(resourceGroupName, serverName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "sql.SecurityAlertPolicyClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SecurityAlertPolicyClient) GetPreparer(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),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SecurityAlertPolicyClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SecurityAlertPolicyClient) GetResponder(resp *http.Response) (result ServerSecurityAlertPolicy, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/sql/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/sql/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+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 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "sql", "2015-05-01-preview")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// AccountsClient is the the Storage Management Client.
@@ -45,21 +45,21 @@
// accountName is 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) CheckNameAvailability(accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, ae error) {
+func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) {
req, err := client.CheckNameAvailabilityPreparer(accountName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "CheckNameAvailability", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "CheckNameAvailability", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure sending request")
}
result, err = client.CheckNameAvailabilityResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "CheckNameAvailability", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure responding to request")
}
return
@@ -68,27 +68,27 @@
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", pathParameters),
autorest.WithJSON(accountName),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
@@ -97,7 +97,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -105,74 +105,78 @@
}
// Create asynchronously creates a new storage account with the specified
-// parameters. Existing accounts cannot be updated with this API and should
-// instead use the Update Storage Account API. If an account is already
-// created and subsequent PUT request is issued with exact same set of
-// properties, then HTTP 200 would be returned.
+// parameters. If an account is already created and subsequent create request
+// is issued with different properties, the account properties will be
+// updated. If an account is already created and subsequent create or update
+// request is issued with exact same set of properties, the request will
+// succeed. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the storage account within the
// specified resource group. Storage account names must be between 3 and 24
// characters in length and use numbers and lower-case letters only.
// parameters is the parameters to provide for the created account.
-func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters) (result Account, ae error) {
- req, err := client.CreatePreparer(resourceGroupName, accountName, parameters)
+func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreatePreparer(resourceGroupName, accountName, parameters, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Create", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request")
}
resp, err := client.CreateSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Create", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", resp, "Failure sending request")
}
result, err = client.CreateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "Create", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", resp, "Failure responding to request")
}
return
}
// CreatePreparer prepares the Create request.
-func (client AccountsClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) {
+func (client AccountsClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) CreateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
-func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, err error) {
+func (client AccountsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -182,21 +186,21 @@
// subscription. accountName is 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) Delete(resourceGroupName string, accountName string) (result autorest.Response, ae error) {
+func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, accountName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Delete", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Delete", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "Delete", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure responding to request")
}
return
@@ -205,28 +209,27 @@
// DeletePreparer prepares the Delete request.
func (client AccountsClient) DeletePreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
+ return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
@@ -235,7 +238,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@@ -249,21 +252,21 @@
// subscription. accountName is 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) GetProperties(resourceGroupName string, accountName string) (result Account, ae error) {
+func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) {
req, err := client.GetPropertiesPreparer(resourceGroupName, accountName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "GetProperties", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request")
}
resp, err := client.GetPropertiesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "GetProperties", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure sending request")
}
result, err = client.GetPropertiesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "GetProperties", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure responding to request")
}
return
@@ -272,28 +275,27 @@
// GetPropertiesPreparer prepares the GetProperties request.
func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetPropertiesSender sends the GetProperties request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetPropertiesResponder handles the response to the GetProperties request. The method always
@@ -302,7 +304,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -311,21 +313,21 @@
// List lists all the storage accounts available under the subscription. Note
// that storage keys are not returned; use the ListKeys operation for this.
-func (client AccountsClient) List() (result AccountListResult, ae error) {
+func (client AccountsClient) List() (result AccountListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure responding to request")
}
return
@@ -334,26 +336,25 @@
// ListPreparer prepares the List request.
func (client AccountsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -362,7 +363,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -375,21 +376,21 @@
//
// resourceGroupName is the name of the resource group within the user's
// subscription.
-func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, ae error) {
+func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "ListByResourceGroup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "ListByResourceGroup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure sending request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "ListByResourceGroup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
@@ -398,27 +399,26 @@
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
@@ -427,7 +427,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -438,21 +438,21 @@
//
// resourceGroupName is the name of the resource group. accountName is the
// name of the storage account.
-func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountKeys, ae error) {
+func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeysResult, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, accountName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "ListKeys", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request")
}
resp, err := client.ListKeysSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "ListKeys", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure sending request")
}
result, err = client.ListKeysResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "ListKeys", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure responding to request")
}
return
@@ -461,37 +461,36 @@
// ListKeysPreparer prepares the ListKeys request.
func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListKeysSender sends the ListKeys request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListKeysResponder handles the response to the ListKeys request. The method always
// closes the http.Response Body.
-func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) {
+func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountListKeysResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -506,21 +505,21 @@
// characters in length and use numbers and lower-case letters only.
// regenerateKey is specifies name of the key which should be regenerated.
// key1 or key2 for the default keys
-func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountKeys, ae error) {
+func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) {
req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, regenerateKey)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "RegenerateKey", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request")
}
resp, err := client.RegenerateKeySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "RegenerateKey", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure sending request")
}
result, err = client.RegenerateKeyResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "RegenerateKey", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure responding to request")
}
return
@@ -529,78 +528,75 @@
// RegenerateKeyPreparer prepares the RegenerateKey request.
func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", pathParameters),
autorest.WithJSON(regenerateKey),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RegenerateKeySender sends the RegenerateKey request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
// closes the http.Response Body.
-func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountKeys, err error) {
+func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountListKeysResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// Update updates the account type or tags for a storage account. It can also
-// be used to add a custom domain (note that custom domains cannot be added
-// via the Create operation). Only one custom domain is supported per storage
-// account. In order to replace a custom domain, the old value must be
-// cleared before a new value may be set. To clear a custom domain, simply
-// update the custom domain with empty string. Then call update again with
-// the new cutsom domain name. The update API can only be used to update one
-// of tags, accountType, or customDomain per call. To update multiple of
-// these properties, call the API multiple times with one change per call.
-// This call does not change the storage keys for the account. If you want to
-// change storage account keys, use the RegenerateKey operation. The location
-// and name of the storage account cannot be changed after creation.
+// Update the update operation can be used to update the account type,
+// encryption, or tags for a storage account. It can also be used to map the
+// account to a custom domain. Only one custom domain is supported per
+// storage account and. replacement/change of custom domain is not supported.
+// In order to replace an old custom domain, the old value must be
+// cleared/unregistered before a new value may be set. Update of multiple
+// properties is supported. This call does not change the storage keys for
+// the account. If you want to change storage account keys, use the
+// regenerate keys operation. The location and name of the storage account
+// cannot be changed after creation.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the storage account within the
// specified resource group. Storage account names must be between 3 and 24
// characters in length and use numbers and lower-case letters only.
-// parameters is the parameters to update on the account. Note that only one
-// property can be changed at a time using this API.
-func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, ae error) {
+// parameters is the parameters to provide for the updated account.
+func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Update", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", nil, "Failure preparing request")
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/AccountsClient", "Update", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure sending request")
}
result, err = client.UpdateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/AccountsClient", "Update", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure responding to request")
}
return
@@ -609,29 +605,29 @@
// UpdatePreparer prepares the Update request.
func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "accountName": url.QueryEscape(accountName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateResponder handles the response to the Update request. The method always
@@ -640,7 +636,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,7 @@
+// Package storage implements the Azure ARM Storage service API version
+// 2016-01-01.
+//
+// The Storage Management Client.
package storage
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,26 +18,27 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
// APIVersion is the version of the Storage
- APIVersion = "2015-06-15"
+ APIVersion = "2016-01-01"
// DefaultBaseURI is the default URI used for the service Storage
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the the Storage Management Client.
+// ManagementClient is the base client for Storage.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -47,6 +52,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,13 +14,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+)
+
+// AccessTier enumerates the values for access tier.
+type AccessTier string
+
+const (
+ // Cool specifies the cool state for access tier.
+ Cool AccessTier = "Cool"
+ // Hot specifies the hot state for access tier.
+ Hot AccessTier = "Hot"
)
// AccountStatus enumerates the values for account status.
@@ -33,20 +43,24 @@
Unavailable AccountStatus = "Unavailable"
)
-// AccountType enumerates the values for account type.
-type AccountType string
+// KeyPermission enumerates the values for key permission.
+type KeyPermission string
const (
- // PremiumLRS specifies the premium lrs state for account type.
- PremiumLRS AccountType = "Premium_LRS"
- // StandardGRS specifies the standard grs state for account type.
- StandardGRS AccountType = "Standard_GRS"
- // StandardLRS specifies the standard lrs state for account type.
- StandardLRS AccountType = "Standard_LRS"
- // StandardRAGRS specifies the standard ragrs state for account type.
- StandardRAGRS AccountType = "Standard_RAGRS"
- // StandardZRS specifies the standard zrs state for account type.
- StandardZRS AccountType = "Standard_ZRS"
+ // FULL specifies the full state for key permission.
+ FULL KeyPermission = "FULL"
+ // READ specifies the read state for key permission.
+ READ KeyPermission = "READ"
+)
+
+// Kind enumerates the values for kind.
+type Kind string
+
+const (
+ // BlobStorage specifies the blob storage state for kind.
+ BlobStorage Kind = "BlobStorage"
+ // Storage specifies the storage state for kind.
+ Storage Kind = "Storage"
)
// ProvisioningState enumerates the values for provisioning state.
@@ -71,6 +85,32 @@
AlreadyExists Reason = "AlreadyExists"
)
+// SkuName enumerates the values for sku name.
+type SkuName string
+
+const (
+ // PremiumLRS specifies the premium lrs state for sku name.
+ PremiumLRS SkuName = "Premium_LRS"
+ // StandardGRS specifies the standard grs state for sku name.
+ StandardGRS SkuName = "Standard_GRS"
+ // StandardLRS specifies the standard lrs state for sku name.
+ StandardLRS SkuName = "Standard_LRS"
+ // StandardRAGRS specifies the standard ragrs state for sku name.
+ StandardRAGRS SkuName = "Standard_RAGRS"
+ // StandardZRS specifies the standard zrs state for sku name.
+ StandardZRS SkuName = "Standard_ZRS"
+)
+
+// SkuTier enumerates the values for sku tier.
+type SkuTier string
+
+const (
+ // Premium specifies the premium state for sku tier.
+ Premium SkuTier = "Premium"
+ // Standard specifies the standard state for sku tier.
+ Standard SkuTier = "Standard"
+)
+
// UsageUnit enumerates the values for usage unit.
type UsageUnit string
@@ -97,6 +137,8 @@
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ Kind Kind `json:"kind,omitempty"`
Properties *AccountProperties `json:"properties,omitempty"`
}
@@ -108,19 +150,24 @@
// AccountCreateParameters is the parameters to provide for the account.
type AccountCreateParameters struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
+ Kind Kind `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *AccountPropertiesCreateParameters `json:"properties,omitempty"`
}
-// AccountKeys is the access keys for the storage account.
-type AccountKeys struct {
+// AccountKey is an access key for the storage account.
+type AccountKey struct {
+ KeyName *string `json:"keyName,omitempty"`
+ Value *string `json:"value,omitempty"`
+ Permissions KeyPermission `json:"permissions,omitempty"`
+}
+
+// AccountListKeysResult is the ListKeys operation response.
+type AccountListKeysResult struct {
autorest.Response `json:"-"`
- Key1 *string `json:"key1,omitempty"`
- Key2 *string `json:"key2,omitempty"`
+ Keys *[]AccountKey `json:"keys,omitempty"`
}
// AccountListResult is the list storage accounts operation response.
@@ -132,7 +179,6 @@
// AccountProperties is
type AccountProperties struct {
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
- AccountType AccountType `json:"accountType,omitempty"`
PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"`
PrimaryLocation *string `json:"primaryLocation,omitempty"`
StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"`
@@ -142,17 +188,22 @@
CreationTime *date.Time `json:"creationTime,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"`
+ Encryption *Encryption `json:"encryption,omitempty"`
+ AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountPropertiesCreateParameters is
type AccountPropertiesCreateParameters struct {
- AccountType AccountType `json:"accountType,omitempty"`
+ CustomDomain *CustomDomain `json:"customDomain,omitempty"`
+ Encryption *Encryption `json:"encryption,omitempty"`
+ AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountPropertiesUpdateParameters is
type AccountPropertiesUpdateParameters struct {
- AccountType AccountType `json:"accountType,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
+ Encryption *Encryption `json:"encryption,omitempty"`
+ AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountRegenerateKeyParameters is
@@ -160,12 +211,9 @@
KeyName *string `json:"keyName,omitempty"`
}
-// AccountUpdateParameters is the parameters to update on the account.
+// AccountUpdateParameters is the parameters to provide for the account.
type AccountUpdateParameters struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
+ Sku *Sku `json:"sku,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *AccountPropertiesUpdateParameters `json:"properties,omitempty"`
}
@@ -185,6 +233,23 @@
UseSubDomain *bool `json:"useSubDomain,omitempty"`
}
+// Encryption is the encryption settings on the account.
+type Encryption struct {
+ Services *EncryptionServices `json:"services,omitempty"`
+ KeySource *string `json:"keySource,omitempty"`
+}
+
+// EncryptionService is an encrypted service.
+type EncryptionService struct {
+ Enabled *bool `json:"enabled,omitempty"`
+ LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"`
+}
+
+// EncryptionServices is the encrypted services.
+type EncryptionServices struct {
+ Blob *EncryptionService `json:"blob,omitempty"`
+}
+
// Endpoints is the URIs that are used to perform a retrieval of a public
// blob, queue or table object.
type Endpoints struct {
@@ -203,16 +268,17 @@
Tags *map[string]*string `json:"tags,omitempty"`
}
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
+// Sku is the SKU of the storage account.
+type Sku struct {
+ Name SkuName `json:"name,omitempty"`
+ Tier SkuTier `json:"tier,omitempty"`
}
// Usage is describes Storage Resource Usage.
type Usage struct {
Unit UsageUnit `json:"unit,omitempty"`
- CurrentValue *int `json:"currentValue,omitempty"`
- Limit *int `json:"limit,omitempty"`
+ CurrentValue *int32 `json:"currentValue,omitempty"`
+ Limit *int32 `json:"limit,omitempty"`
Name *UsageName `json:"name,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/usageoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/usageoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/usageoperations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/usageoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// UsageOperationsClient is the the Storage Management Client.
@@ -43,50 +43,48 @@
// List gets the current usage count and the limit for the resources under the
// subscription.
-//
-func (client UsageOperationsClient) List(apiVersion string) (result UsageListResult, ae error) {
- req, err := client.ListPreparer(apiVersion)
+func (client UsageOperationsClient) List() (result UsageListResult, err error) {
+ req, err := client.ListPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "storage/UsageOperationsClient", "List", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "storage/UsageOperationsClient", "List", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "storage/UsageOperationsClient", "List", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
-func (client UsageOperationsClient) ListPreparer(apiVersion string) (*http.Request, error) {
+func (client UsageOperationsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client UsageOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
@@ -95,7 +93,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/storage/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/storage/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,18 +23,18 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "storage", "2015-06-15")
+ return fmt.Sprintf(userAgentFormat, Version(), "storage", "2016-01-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/client.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,259 +0,0 @@
-package subscriptions
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-const (
- // APIVersion is the version of the Subscriptions
- APIVersion = "2014-04-01-preview"
-
- // DefaultBaseURI is the default URI used for the service Subscriptions
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// ManagementClient is the base client for Subscriptions.
-type ManagementClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the ManagementClient client.
-func New(subscriptionID string) ManagementClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the ManagementClient client.
-func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
- return ManagementClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
-
-// Get gets details about particular subscription.
-//
-// subscriptionID is id of the subscription.
-func (client ManagementClient) Get(subscriptionID string) (result Subscription, ae error) {
- req, err := client.GetPreparer(subscriptionID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ManagementClient) GetPreparer(subscriptionID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(subscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) GetResponder(resp *http.Response) (result Subscription, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of the subscriptionIds.
-func (client ManagementClient) List() (result SubscriptionListResult, ae error) {
- req, err := client.ListPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ManagementClient) ListPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) ListResponder(resp *http.Response) (result SubscriptionListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.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 ManagementClient) ListNextResults(lastResults SubscriptionListResult) (result SubscriptionListResult, ae error) {
- req, err := lastResults.SubscriptionListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListLocations gets a list of the subscription locations.
-//
-// subscriptionID is id of the subscription
-func (client ManagementClient) ListLocations(subscriptionID string) (result LocationListResult, ae error) {
- req, err := client.ListLocationsPreparer(subscriptionID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "ListLocations", "Failure preparing request")
- }
-
- resp, err := client.ListLocationsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "ListLocations", "Failure sending request")
- }
-
- result, err = client.ListLocationsResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/ManagementClient", "ListLocations", "Failure responding to request")
- }
-
- return
-}
-
-// ListLocationsPreparer prepares the ListLocations request.
-func (client ManagementClient) ListLocationsPreparer(subscriptionID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(subscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/locations"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListLocationsSender sends the ListLocations request. The method will close the
-// http.Response Body if it receives an error.
-func (client ManagementClient) ListLocationsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListLocationsResponder handles the response to the ListLocations request. The method always
-// closes the http.Response Body.
-func (client ManagementClient) ListLocationsResponder(resp *http.Response) (result LocationListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/models.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,126 +0,0 @@
-package subscriptions
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
- "net/http"
-)
-
-// DeploymentExtendedFilter is deployment filter.
-type DeploymentExtendedFilter struct {
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// GenericResourceFilter is resource filter.
-type GenericResourceFilter struct {
- ResourceType *string `json:"resourceType,omitempty"`
- Tagname *string `json:"tagname,omitempty"`
- Tagvalue *string `json:"tagvalue,omitempty"`
-}
-
-// Location is location information.
-type Location struct {
- ID *string `json:"id,omitempty"`
- SubscriptionID *string `json:"subscriptionId,omitempty"`
- Name *string `json:"name,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- Latitude *string `json:"latitude,omitempty"`
- Longitude *string `json:"longitude,omitempty"`
-}
-
-// LocationListResult is location list operation response.
-type LocationListResult struct {
- autorest.Response `json:"-"`
- Value *[]Location `json:"value,omitempty"`
-}
-
-// Resource is
-type Resource struct {
- ID *string `json:"id,omitempty"`
- Name *string `json:"name,omitempty"`
- Type *string `json:"type,omitempty"`
- Location *string `json:"location,omitempty"`
- Tags *map[string]*string `json:"tags,omitempty"`
-}
-
-// ResourceGroupFilter is resource group filter.
-type ResourceGroupFilter struct {
- TagName *string `json:"tagName,omitempty"`
- TagValue *string `json:"tagValue,omitempty"`
-}
-
-// SubResource is
-type SubResource struct {
- ID *string `json:"id,omitempty"`
-}
-
-// Subscription is subscription information.
-type Subscription struct {
- autorest.Response `json:"-"`
- ID *string `json:"id,omitempty"`
- SubscriptionID *string `json:"subscriptionId,omitempty"`
- DisplayName *string `json:"displayName,omitempty"`
- State *string `json:"state,omitempty"`
-}
-
-// SubscriptionListResult is subscription list operation response.
-type SubscriptionListResult struct {
- autorest.Response `json:"-"`
- Value *[]Subscription `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// SubscriptionListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client SubscriptionListResult) SubscriptionListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
-
-// TenantIDDescription is tenant Id information
-type TenantIDDescription struct {
- ID *string `json:"id,omitempty"`
- TenantID *string `json:"tenantId,omitempty"`
-}
-
-// TenantListResult is tenant Ids information.
-type TenantListResult struct {
- autorest.Response `json:"-"`
- Value *[]TenantIDDescription `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// TenantListResultPreparer prepares a request to retrieve the next set of results. It returns
-// nil if no more results exist.
-func (client TenantListResult) TenantListResultPreparer() (*http.Request, error) {
- if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
- return nil, nil
- }
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(client.NextLink)))
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/subscriptions.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/subscriptions.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/subscriptions.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/subscriptions.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,246 +0,0 @@
-package subscriptions
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// Client is the client for the Subscriptions methods of the Subscriptions
-// service.
-type Client struct {
- ManagementClient
-}
-
-// NewClient creates an instance of the Client client.
-func NewClient(subscriptionID string) Client {
- return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewClientWithBaseURI creates an instance of the Client client.
-func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
- return Client{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets details about particular subscription.
-//
-// subscriptionID is id of the subscription.
-func (client Client) Get(subscriptionID string) (result Subscription, ae error) {
- req, err := client.GetPreparer(subscriptionID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "Get", "Failure preparing request")
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "Get", "Failure sending request")
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/Client", "Get", "Failure responding to request")
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client Client) GetPreparer(subscriptionID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(subscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client Client) GetResponder(resp *http.Response) (result Subscription, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of the subscriptionIds.
-func (client Client) List() (result SubscriptionListResult, ae error) {
- req, err := client.ListPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client Client) ListPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client Client) ListResponder(resp *http.Response) (result SubscriptionListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client Client) ListNextResults(lastResults SubscriptionListResult) (result SubscriptionListResult, ae error) {
- req, err := lastResults.SubscriptionListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/Client", "List", "Failure responding to next results request request")
- }
-
- return
-}
-
-// ListLocations gets a list of the subscription locations.
-//
-// subscriptionID is id of the subscription
-func (client Client) ListLocations(subscriptionID string) (result LocationListResult, ae error) {
- req, err := client.ListLocationsPreparer(subscriptionID)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "ListLocations", "Failure preparing request")
- }
-
- resp, err := client.ListLocationsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/Client", "ListLocations", "Failure sending request")
- }
-
- result, err = client.ListLocationsResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/Client", "ListLocations", "Failure responding to request")
- }
-
- return
-}
-
-// ListLocationsPreparer prepares the ListLocations request.
-func (client Client) ListLocationsPreparer(subscriptionID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(subscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/locations"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListLocationsSender sends the ListLocations request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListLocationsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListLocationsResponder handles the response to the ListLocations request. The method always
-// closes the http.Response Body.
-func (client Client) ListLocationsResponder(resp *http.Response) (result LocationListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/tenants.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/tenants.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/tenants.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/tenants.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,124 +0,0 @@
-package subscriptions
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "net/http"
- "net/url"
-)
-
-// TenantsClient is the client for the Tenants methods of the Subscriptions
-// service.
-type TenantsClient struct {
- ManagementClient
-}
-
-// NewTenantsClient creates an instance of the TenantsClient client.
-func NewTenantsClient(subscriptionID string) TenantsClient {
- return NewTenantsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewTenantsClientWithBaseURI creates an instance of the TenantsClient client.
-func NewTenantsClientWithBaseURI(baseURI string, subscriptionID string) TenantsClient {
- return TenantsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets a list of the tenantIds.
-func (client TenantsClient) List() (result TenantListResult, ae error) {
- req, err := client.ListPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure preparing request")
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure sending request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure responding to request")
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TenantsClient) ListPreparer() (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/tenants"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TenantsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TenantsClient) ListResponder(resp *http.Response) (result TenantListResult, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListNextResults retrieves the next set of results, if any.
-func (client TenantsClient) ListNextResults(lastResults TenantListResult) (result TenantListResult, ae error) {
- req, err := lastResults.TenantListResultPreparer()
- if err != nil {
- return result, autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure preparing next results request request")
- }
- if req == nil {
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure sending next results request request")
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "subscriptions/TenantsClient", "List", "Failure responding to next results request request")
- }
-
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/subscriptions/version.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,43 +0,0 @@
-package subscriptions
-
-// Copyright (c) Microsoft and contributors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-
-import (
- "fmt"
-)
-
-const (
- major = "0"
- minor = "3"
- patch = "0"
- // Always begin a "tag" with a dash (as per http://semver.org)
- tag = "-beta"
- semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
-)
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "subscriptions", "2014-04-01-preview")
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/client.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,57 @@
+// Package trafficmanager implements the Azure ARM Trafficmanager service API
+// version 2015-11-01.
+//
+package trafficmanager
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // APIVersion is the version of the Trafficmanager
+ APIVersion = "2015-11-01"
+
+ // DefaultBaseURI is the default URI used for the service Trafficmanager
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// ManagementClient is the base client for Trafficmanager.
+type ManagementClient struct {
+ autorest.Client
+ BaseURI string
+ APIVersion string
+ SubscriptionID string
+}
+
+// New creates an instance of the ManagementClient client.
+func New(subscriptionID string) ManagementClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the ManagementClient client.
+func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ SubscriptionID: subscriptionID,
+ }
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/endpoints.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/endpoints.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/endpoints.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/endpoints.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,318 @@
+package trafficmanager
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// EndpointsClient is the client for the Endpoints methods of the
+// Trafficmanager service.
+type EndpointsClient struct {
+ ManagementClient
+}
+
+// NewEndpointsClient creates an instance of the EndpointsClient client.
+func NewEndpointsClient(subscriptionID string) EndpointsClient {
+ return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient
+// client.
+func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
+ return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or update a Traffic Manager endpoint.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager endpoint to be created or updated. profileName is the name of the
+// Traffic Manager profile. endpointType is the type of the Traffic Manager
+// endpoint to be created or updated. endpointName is the name of the Traffic
+// Manager endpoint to be created or updated. parameters is the Traffic
+// Manager endpoint parameters supplied to the CreateOrUpdate operation.
+func (client EndpointsClient) CreateOrUpdate(resourceGroupName string, profileName string, endpointType string, endpointName string, parameters Endpoint) (result Endpoint, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, profileName, endpointType, endpointName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client EndpointsClient) CreateOrUpdatePreparer(resourceGroupName string, profileName string, endpointType string, endpointName string, parameters Endpoint) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "endpointType": autorest.Encode("path", endpointType),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result Endpoint, 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 Traffic Manager endpoint.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager endpoint to be deleted. profileName is the name of the Traffic
+// Manager profile. endpointType is the type of the Traffic Manager endpoint
+// to be deleted. endpointName is the name of the Traffic Manager endpoint to
+// be deleted.
+func (client EndpointsClient) Delete(resourceGroupName string, profileName string, endpointType string, endpointName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, profileName, endpointType, endpointName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client EndpointsClient) DeletePreparer(resourceGroupName string, profileName string, endpointType string, endpointName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "endpointType": autorest.Encode("path", endpointType),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets a Traffic Manager endpoint.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager endpoint. profileName is the name of the Traffic Manager profile.
+// endpointType is the type of the Traffic Manager endpoint. endpointName is
+// the name of the Traffic Manager endpoint.
+func (client EndpointsClient) Get(resourceGroupName string, profileName string, endpointType string, endpointName string) (result Endpoint, err error) {
+ req, err := client.GetPreparer(resourceGroupName, profileName, endpointType, endpointName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client EndpointsClient) GetPreparer(resourceGroupName string, profileName string, endpointType string, endpointName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "endpointType": autorest.Encode("path", endpointType),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update a Traffic Manager endpoint.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager endpoint to be updated. profileName is the name of the Traffic
+// Manager profile. endpointType is the type of the Traffic Manager endpoint
+// to be updated. endpointName is the name of the Traffic Manager endpoint to
+// be updated. parameters is the Traffic Manager endpoint parameters supplied
+// to the Update operation.
+func (client EndpointsClient) Update(resourceGroupName string, profileName string, endpointType string, endpointName string, parameters Endpoint) (result Endpoint, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, profileName, endpointType, endpointName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.EndpointsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client EndpointsClient) UpdatePreparer(resourceGroupName string, profileName string, endpointType string, endpointName string, parameters Endpoint) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "endpointName": autorest.Encode("path", endpointName),
+ "endpointType": autorest.Encode("path", endpointType),
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client EndpointsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client EndpointsClient) UpdateResponder(resp *http.Response) (result Endpoint, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/models.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,120 @@
+package trafficmanager
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// CheckTrafficManagerRelativeDNSNameAvailabilityParameters is parameters
+// supplied to check Traffic Manager name operation.
+type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct {
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+}
+
+// DNSConfig is class containing DNS settings in a Traffic Manager profile.
+type DNSConfig struct {
+ RelativeName *string `json:"relativeName,omitempty"`
+ Fqdn *string `json:"fqdn,omitempty"`
+ TTL *int64 `json:"ttl,omitempty"`
+}
+
+// Endpoint is class respresenting a Traffic Manager endpoint.
+type Endpoint struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Properties *EndpointProperties `json:"properties,omitempty"`
+}
+
+// EndpointProperties is class respresenting a Traffic Manager endpoint
+// properties.
+type EndpointProperties struct {
+ TargetResourceID *string `json:"targetResourceId,omitempty"`
+ Target *string `json:"target,omitempty"`
+ EndpointStatus *string `json:"endpointStatus,omitempty"`
+ Weight *int64 `json:"weight,omitempty"`
+ Priority *int64 `json:"priority,omitempty"`
+ EndpointLocation *string `json:"endpointLocation,omitempty"`
+ EndpointMonitorStatus *string `json:"endpointMonitorStatus,omitempty"`
+ MinChildEndpoints *int64 `json:"minChildEndpoints,omitempty"`
+}
+
+// MonitorConfig is class containing endpoint monitoring settings in a Traffic
+// Manager profile.
+type MonitorConfig struct {
+ ProfileMonitorStatus *string `json:"profileMonitorStatus,omitempty"`
+ Protocol *string `json:"protocol,omitempty"`
+ Port *int64 `json:"port,omitempty"`
+ Path *string `json:"path,omitempty"`
+}
+
+// NameAvailability is class representing a Traffic Manager Name Availability
+// response.
+type NameAvailability struct {
+ autorest.Response `json:"-"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ NameAvailable *bool `json:"nameAvailable,omitempty"`
+ Reason *string `json:"reason,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// Profile is class representing a Traffic Manager profile.
+type Profile struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *ProfileProperties `json:"properties,omitempty"`
+}
+
+// ProfileListResult is the list Traffic Manager profiles operation response.
+type ProfileListResult struct {
+ autorest.Response `json:"-"`
+ Value *[]Profile `json:"value,omitempty"`
+}
+
+// ProfileProperties is class representing the Traffic Manager profile
+// properties.
+type ProfileProperties struct {
+ ProfileStatus *string `json:"profileStatus,omitempty"`
+ TrafficRoutingMethod *string `json:"trafficRoutingMethod,omitempty"`
+ DNSConfig *DNSConfig `json:"dnsConfig,omitempty"`
+ MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
+ Endpoints *[]Endpoint `json:"endpoints,omitempty"`
+}
+
+// Resource is
+type Resource struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+}
+
+// SubResource is
+type SubResource struct {
+ ID *string `json:"id,omitempty"`
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/profiles.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/profiles.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/profiles.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/profiles.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,487 @@
+package trafficmanager
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// ProfilesClient is the client for the Profiles methods of the Trafficmanager
+// service.
+type ProfilesClient struct {
+ ManagementClient
+}
+
+// NewProfilesClient creates an instance of the ProfilesClient client.
+func NewProfilesClient(subscriptionID string) ProfilesClient {
+ return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient
+// client.
+func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient {
+ return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckTrafficManagerRelativeDNSNameAvailability checks the availability of a
+// Traffic Manager Relative DNS name.
+//
+// parameters is the Traffic Manager name parameters supplied to the
+// CheckTrafficManagerNameAvailability operation.
+func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailability(parameters CheckTrafficManagerRelativeDNSNameAvailabilityParameters) (result NameAvailability, err error) {
+ req, err := client.CheckTrafficManagerRelativeDNSNameAvailabilityPreparer(parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CheckTrafficManagerRelativeDNSNameAvailability", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CheckTrafficManagerRelativeDNSNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CheckTrafficManagerRelativeDNSNameAvailability", resp, "Failure sending request")
+ }
+
+ result, err = client.CheckTrafficManagerRelativeDNSNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CheckTrafficManagerRelativeDNSNameAvailability", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CheckTrafficManagerRelativeDNSNameAvailabilityPreparer prepares the CheckTrafficManagerRelativeDNSNameAvailability request.
+func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailabilityPreparer(parameters CheckTrafficManagerRelativeDNSNameAvailabilityParameters) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/providers/Microsoft.Network/checkTrafficManagerNameAvailability", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CheckTrafficManagerRelativeDNSNameAvailabilitySender sends the CheckTrafficManagerRelativeDNSNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CheckTrafficManagerRelativeDNSNameAvailabilityResponder handles the response to the CheckTrafficManagerRelativeDNSNameAvailability request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailabilityResponder(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 or update a Traffic Manager profile.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager profile. profileName is the name of the Traffic Manager profile.
+// parameters is the Traffic Manager profile parameters supplied to the
+// CreateOrUpdate operation.
+func (client ProfilesClient) CreateOrUpdate(resourceGroupName string, profileName string, parameters Profile) (result Profile, err error) {
+ req, err := client.CreateOrUpdatePreparer(resourceGroupName, profileName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CreateOrUpdate", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ProfilesClient) CreateOrUpdatePreparer(resourceGroupName string, profileName string, parameters Profile) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a Traffic Manager profile.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager profile to be deleted. profileName is the name of the Traffic
+// Manager profile to be deleted.
+func (client ProfilesClient) Delete(resourceGroupName string, profileName string) (result autorest.Response, err error) {
+ req, err := client.DeletePreparer(resourceGroupName, profileName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Delete", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Delete", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ProfilesClient) DeletePreparer(resourceGroupName string, profileName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets a Traffic Manager profile.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager profile. profileName is the name of the Traffic Manager profile.
+func (client ProfilesClient) Get(resourceGroupName string, profileName string) (result Profile, err error) {
+ req, err := client.GetPreparer(resourceGroupName, profileName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Get", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Get", resp, "Failure sending request")
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ProfilesClient) GetPreparer(resourceGroupName string, profileName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAll lists all Traffic Manager profiles within a subscription.
+func (client ProfilesClient) ListAll() (result ProfileListResult, err error) {
+ req, err := client.ListAllPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAll", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAllSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAll", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAllResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAll", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAllPreparer prepares the ListAll request.
+func (client ProfilesClient) ListAllPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAllSender sends the ListAll request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) ListAllSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAllResponder handles the response to the ListAll request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) ListAllResponder(resp *http.Response) (result ProfileListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListAllInResourceGroup lists all Traffic Manager profiles within a resource
+// group.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager profiles to be listed.
+func (client ProfilesClient) ListAllInResourceGroup(resourceGroupName string) (result ProfileListResult, err error) {
+ req, err := client.ListAllInResourceGroupPreparer(resourceGroupName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAllInResourceGroup", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ListAllInResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAllInResourceGroup", resp, "Failure sending request")
+ }
+
+ result, err = client.ListAllInResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "ListAllInResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListAllInResourceGroupPreparer prepares the ListAllInResourceGroup request.
+func (client ProfilesClient) ListAllInResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ListAllInResourceGroupSender sends the ListAllInResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) ListAllInResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ListAllInResourceGroupResponder handles the response to the ListAllInResourceGroup request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) ListAllInResourceGroupResponder(resp *http.Response) (result ProfileListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update a Traffic Manager profile.
+//
+// resourceGroupName is the name of the resource group containing the Traffic
+// Manager profile. profileName is the name of the Traffic Manager profile.
+// parameters is the Traffic Manager profile parameters supplied to the
+// Update operation.
+func (client ProfilesClient) Update(resourceGroupName string, profileName string, parameters Profile) (result Profile, err error) {
+ req, err := client.UpdatePreparer(resourceGroupName, profileName, parameters)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Update", nil, "Failure preparing request")
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Update", resp, "Failure sending request")
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "trafficmanager.ProfilesClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client ProfilesClient) UpdatePreparer(resourceGroupName string, profileName string, parameters Profile) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "profileName": autorest.Encode("path", profileName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client ProfilesClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client ProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/version.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/trafficmanager/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,43 @@
+package trafficmanager
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "fmt"
+)
+
+const (
+ major = "3"
+ minor = "1"
+ patch = "0"
+ // Always begin a "tag" with a dash (as per http://semver.org)
+ tag = "-beta"
+ semVerFormat = "%s.%s.%s%s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
+)
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return fmt.Sprintf(userAgentFormat, Version(), "trafficmanager", "2015-11-01")
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/certificateorders.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/certificateorders.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/certificateorders.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/certificateorders.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// CertificateOrdersClient is the use these APIs to manage Azure Websites
@@ -53,21 +53,21 @@
// resourceGroupName is azure resource group name certificateOrderName is
// certificate name name is certificate name keyVaultCertificate is key Vault
// secret csm Id
-func (client CertificateOrdersClient) CreateOrUpdateCertificate(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (result CertificateOrderCertificate, ae error) {
+func (client CertificateOrdersClient) CreateOrUpdateCertificate(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (result CertificateOrderCertificate, err error) {
req, err := client.CreateOrUpdateCertificatePreparer(resourceGroupName, certificateOrderName, name, keyVaultCertificate)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificate", resp, "Failure responding to request")
}
return
@@ -76,30 +76,30 @@
// CreateOrUpdateCertificatePreparer prepares the CreateOrUpdateCertificate request.
func (client CertificateOrdersClient) CreateOrUpdateCertificatePreparer(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "certificateOrderName": url.QueryEscape(certificateOrderName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "certificateOrderName": autorest.Encode("path", certificateOrderName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters),
autorest.WithJSON(keyVaultCertificate),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateCertificateSender sends the CreateOrUpdateCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) CreateOrUpdateCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateCertificateResponder handles the response to the CreateOrUpdateCertificate request. The method always
@@ -108,7 +108,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -121,21 +121,21 @@
// resourceGroupName is azure resource group name name is certificate name
// certificateDistinguishedName is distinguished name to be used for
// purchasing certificate
-func (client CertificateOrdersClient) CreateOrUpdateCertificateOrder(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (result CertificateOrder, ae error) {
+func (client CertificateOrdersClient) CreateOrUpdateCertificateOrder(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (result CertificateOrder, err error) {
req, err := client.CreateOrUpdateCertificateOrderPreparer(resourceGroupName, name, certificateDistinguishedName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificateOrder", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificateOrder", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateCertificateOrderSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificateOrder", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificateOrder", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateCertificateOrderResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "CreateOrUpdateCertificateOrder", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "CreateOrUpdateCertificateOrder", resp, "Failure responding to request")
}
return
@@ -144,29 +144,29 @@
// CreateOrUpdateCertificateOrderPreparer prepares the CreateOrUpdateCertificateOrder request.
func (client CertificateOrdersClient) CreateOrUpdateCertificateOrderPreparer(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}", pathParameters),
autorest.WithJSON(certificateDistinguishedName),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateCertificateOrderSender sends the CreateOrUpdateCertificateOrder request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) CreateOrUpdateCertificateOrderSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateCertificateOrderResponder handles the response to the CreateOrUpdateCertificateOrder request. The method always
@@ -175,7 +175,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -186,21 +186,21 @@
//
// resourceGroupName is azure resource group name certificateOrderName is
// certificate name name is certificate name
-func (client CertificateOrdersClient) DeleteCertificate(resourceGroupName string, certificateOrderName string, name string) (result ObjectSet, ae error) {
+func (client CertificateOrdersClient) DeleteCertificate(resourceGroupName string, certificateOrderName string, name string) (result SetObject, err error) {
req, err := client.DeleteCertificatePreparer(resourceGroupName, certificateOrderName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificate", nil, "Failure preparing request")
}
resp, err := client.DeleteCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificate", resp, "Failure sending request")
}
result, err = client.DeleteCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificate", resp, "Failure responding to request")
}
return
@@ -209,38 +209,37 @@
// DeleteCertificatePreparer prepares the DeleteCertificate request.
func (client CertificateOrdersClient) DeleteCertificatePreparer(resourceGroupName string, certificateOrderName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "certificateOrderName": url.QueryEscape(certificateOrderName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "certificateOrderName": autorest.Encode("path", certificateOrderName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteCertificateSender sends the DeleteCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) DeleteCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteCertificateResponder handles the response to the DeleteCertificate request. The method always
// closes the http.Response Body.
-func (client CertificateOrdersClient) DeleteCertificateResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client CertificateOrdersClient) DeleteCertificateResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -250,21 +249,21 @@
// DeleteCertificateOrder sends the delete certificate order request.
//
// resourceGroupName is azure resource group name name is certificate name
-func (client CertificateOrdersClient) DeleteCertificateOrder(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client CertificateOrdersClient) DeleteCertificateOrder(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteCertificateOrderPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificateOrder", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificateOrder", nil, "Failure preparing request")
}
resp, err := client.DeleteCertificateOrderSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificateOrder", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificateOrder", resp, "Failure sending request")
}
result, err = client.DeleteCertificateOrderResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "DeleteCertificateOrder", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "DeleteCertificateOrder", resp, "Failure responding to request")
}
return
@@ -273,37 +272,36 @@
// DeleteCertificateOrderPreparer prepares the DeleteCertificateOrder request.
func (client CertificateOrdersClient) DeleteCertificateOrderPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteCertificateOrderSender sends the DeleteCertificateOrder request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) DeleteCertificateOrderSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteCertificateOrderResponder handles the response to the DeleteCertificateOrder request. The method always
// closes the http.Response Body.
-func (client CertificateOrdersClient) DeleteCertificateOrderResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client CertificateOrdersClient) DeleteCertificateOrderResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -314,21 +312,21 @@
//
// resourceGroupName is azure resource group name certificateOrderName is
// certificate name name is certificate name
-func (client CertificateOrdersClient) GetCertificate(resourceGroupName string, certificateOrderName string, name string) (result CertificateOrderCertificate, ae error) {
+func (client CertificateOrdersClient) GetCertificate(resourceGroupName string, certificateOrderName string, name string) (result CertificateOrderCertificate, err error) {
req, err := client.GetCertificatePreparer(resourceGroupName, certificateOrderName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificate", nil, "Failure preparing request")
}
resp, err := client.GetCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificate", resp, "Failure sending request")
}
result, err = client.GetCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificate", resp, "Failure responding to request")
}
return
@@ -337,29 +335,28 @@
// GetCertificatePreparer prepares the GetCertificate request.
func (client CertificateOrdersClient) GetCertificatePreparer(resourceGroupName string, certificateOrderName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "certificateOrderName": url.QueryEscape(certificateOrderName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "certificateOrderName": autorest.Encode("path", certificateOrderName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificateSender sends the GetCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) GetCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificateResponder handles the response to the GetCertificate request. The method always
@@ -368,7 +365,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -378,21 +375,21 @@
// GetCertificateOrder sends the get certificate order request.
//
// resourceGroupName is azure resource group name name is certificate name
-func (client CertificateOrdersClient) GetCertificateOrder(resourceGroupName string, name string) (result CertificateOrder, ae error) {
+func (client CertificateOrdersClient) GetCertificateOrder(resourceGroupName string, name string) (result CertificateOrder, err error) {
req, err := client.GetCertificateOrderPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrder", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrder", nil, "Failure preparing request")
}
resp, err := client.GetCertificateOrderSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrder", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrder", resp, "Failure sending request")
}
result, err = client.GetCertificateOrderResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrder", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrder", resp, "Failure responding to request")
}
return
@@ -401,28 +398,27 @@
// GetCertificateOrderPreparer prepares the GetCertificateOrder request.
func (client CertificateOrdersClient) GetCertificateOrderPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificateOrderSender sends the GetCertificateOrder request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) GetCertificateOrderSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificateOrderResponder handles the response to the GetCertificateOrder request. The method always
@@ -431,7 +427,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -441,21 +437,21 @@
// GetCertificateOrders sends the get certificate orders request.
//
// resourceGroupName is azure resource group name
-func (client CertificateOrdersClient) GetCertificateOrders(resourceGroupName string) (result CertificateOrderCollection, ae error) {
+func (client CertificateOrdersClient) GetCertificateOrders(resourceGroupName string) (result CertificateOrderCollection, err error) {
req, err := client.GetCertificateOrdersPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrders", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrders", nil, "Failure preparing request")
}
resp, err := client.GetCertificateOrdersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrders", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrders", resp, "Failure sending request")
}
result, err = client.GetCertificateOrdersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificateOrders", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificateOrders", resp, "Failure responding to request")
}
return
@@ -464,27 +460,26 @@
// GetCertificateOrdersPreparer prepares the GetCertificateOrders request.
func (client CertificateOrdersClient) GetCertificateOrdersPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificateOrdersSender sends the GetCertificateOrders request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) GetCertificateOrdersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificateOrdersResponder handles the response to the GetCertificateOrders request. The method always
@@ -493,7 +488,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -504,21 +499,21 @@
//
// resourceGroupName is azure resource group name certificateOrderName is
// certificate name
-func (client CertificateOrdersClient) GetCertificates(resourceGroupName string, certificateOrderName string) (result CertificateOrderCertificateCollection, ae error) {
+func (client CertificateOrdersClient) GetCertificates(resourceGroupName string, certificateOrderName string) (result CertificateOrderCertificateCollection, err error) {
req, err := client.GetCertificatesPreparer(resourceGroupName, certificateOrderName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificates", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificates", nil, "Failure preparing request")
}
resp, err := client.GetCertificatesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificates", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificates", resp, "Failure sending request")
}
result, err = client.GetCertificatesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "GetCertificates", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "GetCertificates", resp, "Failure responding to request")
}
return
@@ -527,28 +522,27 @@
// GetCertificatesPreparer prepares the GetCertificates request.
func (client CertificateOrdersClient) GetCertificatesPreparer(resourceGroupName string, certificateOrderName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "certificateOrderName": url.QueryEscape(certificateOrderName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "certificateOrderName": autorest.Encode("path", certificateOrderName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificatesSender sends the GetCertificates request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) GetCertificatesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificatesResponder handles the response to the GetCertificates request. The method always
@@ -557,33 +551,353 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// ReissueCertificateOrder sends the reissue certificate order request.
+//
+// resourceGroupName is azure resource group name name is certificate name
+// reissueCertificateOrderRequest is reissue parameters
+func (client CertificateOrdersClient) ReissueCertificateOrder(resourceGroupName string, name string, reissueCertificateOrderRequest ReissueCertificateOrderRequest) (result SetObject, err error) {
+ req, err := client.ReissueCertificateOrderPreparer(resourceGroupName, name, reissueCertificateOrderRequest)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ReissueCertificateOrder", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ReissueCertificateOrderSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ReissueCertificateOrder", resp, "Failure sending request")
+ }
+
+ result, err = client.ReissueCertificateOrderResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ReissueCertificateOrder", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ReissueCertificateOrderPreparer prepares the ReissueCertificateOrder request.
+func (client CertificateOrdersClient) ReissueCertificateOrderPreparer(resourceGroupName string, name string, reissueCertificateOrderRequest ReissueCertificateOrderRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/reissue", pathParameters),
+ autorest.WithJSON(reissueCertificateOrderRequest),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ReissueCertificateOrderSender sends the ReissueCertificateOrder request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) ReissueCertificateOrderSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ReissueCertificateOrderResponder handles the response to the ReissueCertificateOrder request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) ReissueCertificateOrderResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RenewCertificateOrder sends the renew certificate order request.
+//
+// resourceGroupName is azure resource group name name is certificate name
+// renewCertificateOrderRequest is renew parameters
+func (client CertificateOrdersClient) RenewCertificateOrder(resourceGroupName string, name string, renewCertificateOrderRequest RenewCertificateOrderRequest) (result SetObject, err error) {
+ req, err := client.RenewCertificateOrderPreparer(resourceGroupName, name, renewCertificateOrderRequest)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RenewCertificateOrder", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RenewCertificateOrderSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RenewCertificateOrder", resp, "Failure sending request")
+ }
+
+ result, err = client.RenewCertificateOrderResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RenewCertificateOrder", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RenewCertificateOrderPreparer prepares the RenewCertificateOrder request.
+func (client CertificateOrdersClient) RenewCertificateOrderPreparer(resourceGroupName string, name string, renewCertificateOrderRequest RenewCertificateOrderRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/renew", pathParameters),
+ autorest.WithJSON(renewCertificateOrderRequest),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RenewCertificateOrderSender sends the RenewCertificateOrder request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) RenewCertificateOrderSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RenewCertificateOrderResponder handles the response to the RenewCertificateOrder request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) RenewCertificateOrderResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ResendCertificateEmail sends the resend certificate email request.
+//
+// resourceGroupName is azure resource group name name is certificate order
+// name
+func (client CertificateOrdersClient) ResendCertificateEmail(resourceGroupName string, name string) (result SetObject, err error) {
+ req, err := client.ResendCertificateEmailPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ResendCertificateEmail", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ResendCertificateEmailSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ResendCertificateEmail", resp, "Failure sending request")
+ }
+
+ result, err = client.ResendCertificateEmailResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "ResendCertificateEmail", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ResendCertificateEmailPreparer prepares the ResendCertificateEmail request.
+func (client CertificateOrdersClient) ResendCertificateEmailPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/resendEmail", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ResendCertificateEmailSender sends the ResendCertificateEmail request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) ResendCertificateEmailSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ResendCertificateEmailResponder handles the response to the ResendCertificateEmail request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) ResendCertificateEmailResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RetrieveCertificateActions sends the retrieve certificate actions request.
+//
+// resourceGroupName is azure resource group name name is certificate order
+// name
+func (client CertificateOrdersClient) RetrieveCertificateActions(resourceGroupName string, name string) (result ListCertificateOrderAction, err error) {
+ req, err := client.RetrieveCertificateActionsPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateActions", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RetrieveCertificateActionsSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateActions", resp, "Failure sending request")
+ }
+
+ result, err = client.RetrieveCertificateActionsResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateActions", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RetrieveCertificateActionsPreparer prepares the RetrieveCertificateActions request.
+func (client CertificateOrdersClient) RetrieveCertificateActionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RetrieveCertificateActionsSender sends the RetrieveCertificateActions request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) RetrieveCertificateActionsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RetrieveCertificateActionsResponder handles the response to the RetrieveCertificateActions request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) RetrieveCertificateActionsResponder(resp *http.Response) (result ListCertificateOrderAction, 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
+}
+
+// RetrieveCertificateEmailHistory sends the retrieve certificate email
+// history request.
+//
+// resourceGroupName is azure resource group name name is certificate order
+// name
+func (client CertificateOrdersClient) RetrieveCertificateEmailHistory(resourceGroupName string, name string) (result ListCertificateEmail, err error) {
+ req, err := client.RetrieveCertificateEmailHistoryPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateEmailHistory", nil, "Failure preparing request")
+ }
+
+ resp, err := client.RetrieveCertificateEmailHistorySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateEmailHistory", resp, "Failure sending request")
+ }
+
+ result, err = client.RetrieveCertificateEmailHistoryResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "RetrieveCertificateEmailHistory", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// RetrieveCertificateEmailHistoryPreparer prepares the RetrieveCertificateEmailHistory request.
+func (client CertificateOrdersClient) RetrieveCertificateEmailHistoryPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// RetrieveCertificateEmailHistorySender sends the RetrieveCertificateEmailHistory request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) RetrieveCertificateEmailHistorySender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// RetrieveCertificateEmailHistoryResponder handles the response to the RetrieveCertificateEmailHistory request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) RetrieveCertificateEmailHistoryResponder(resp *http.Response) (result ListCertificateEmail, 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
+}
+
// UpdateCertificate sends the update certificate request.
//
// resourceGroupName is azure resource group name certificateOrderName is
// certificate name name is certificate name keyVaultCertificate is key Vault
// secret csm Id
-func (client CertificateOrdersClient) UpdateCertificate(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (result CertificateOrderCertificate, ae error) {
+func (client CertificateOrdersClient) UpdateCertificate(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (result CertificateOrderCertificate, err error) {
req, err := client.UpdateCertificatePreparer(resourceGroupName, certificateOrderName, name, keyVaultCertificate)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificate", nil, "Failure preparing request")
}
resp, err := client.UpdateCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificate", resp, "Failure sending request")
}
result, err = client.UpdateCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificate", resp, "Failure responding to request")
}
return
@@ -592,30 +906,30 @@
// UpdateCertificatePreparer prepares the UpdateCertificate request.
func (client CertificateOrdersClient) UpdateCertificatePreparer(resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate CertificateOrderCertificate) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "certificateOrderName": url.QueryEscape(certificateOrderName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "certificateOrderName": autorest.Encode("path", certificateOrderName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters),
autorest.WithJSON(keyVaultCertificate),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateCertificateSender sends the UpdateCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) UpdateCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateCertificateResponder handles the response to the UpdateCertificate request. The method always
@@ -624,7 +938,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -636,21 +950,21 @@
// resourceGroupName is azure resource group name name is certificate name
// certificateDistinguishedName is distinguished name to be used for
// purchasing certificate
-func (client CertificateOrdersClient) UpdateCertificateOrder(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (result CertificateOrder, ae error) {
+func (client CertificateOrdersClient) UpdateCertificateOrder(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (result CertificateOrder, err error) {
req, err := client.UpdateCertificateOrderPreparer(resourceGroupName, name, certificateDistinguishedName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificateOrder", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificateOrder", nil, "Failure preparing request")
}
resp, err := client.UpdateCertificateOrderSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificateOrder", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificateOrder", resp, "Failure sending request")
}
result, err = client.UpdateCertificateOrderResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificateOrdersClient", "UpdateCertificateOrder", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "UpdateCertificateOrder", resp, "Failure responding to request")
}
return
@@ -659,29 +973,29 @@
// UpdateCertificateOrderPreparer prepares the UpdateCertificateOrder request.
func (client CertificateOrdersClient) UpdateCertificateOrderPreparer(resourceGroupName string, name string, certificateDistinguishedName CertificateOrder) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}", pathParameters),
autorest.WithJSON(certificateDistinguishedName),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateCertificateOrderSender sends the UpdateCertificateOrder request. The method will close the
// http.Response Body if it receives an error.
func (client CertificateOrdersClient) UpdateCertificateOrderSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateCertificateOrderResponder handles the response to the UpdateCertificateOrder request. The method always
@@ -690,9 +1004,72 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
+}
+
+// VerifyDomainOwnership sends the verify domain ownership request.
+//
+// resourceGroupName is azure resource group name name is certificate order
+// name
+func (client CertificateOrdersClient) VerifyDomainOwnership(resourceGroupName string, name string) (result SetObject, err error) {
+ req, err := client.VerifyDomainOwnershipPreparer(resourceGroupName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "VerifyDomainOwnership", nil, "Failure preparing request")
+ }
+
+ resp, err := client.VerifyDomainOwnershipSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "VerifyDomainOwnership", resp, "Failure sending request")
+ }
+
+ result, err = client.VerifyDomainOwnershipResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.CertificateOrdersClient", "VerifyDomainOwnership", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// VerifyDomainOwnershipPreparer prepares the VerifyDomainOwnership request.
+func (client CertificateOrdersClient) VerifyDomainOwnershipPreparer(resourceGroupName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/verifyDomainOwnership", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// VerifyDomainOwnershipSender sends the VerifyDomainOwnership request. The method will close the
+// http.Response Body if it receives an error.
+func (client CertificateOrdersClient) VerifyDomainOwnershipSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// VerifyDomainOwnershipResponder handles the response to the VerifyDomainOwnership request. The method always
+// closes the http.Response Body.
+func (client CertificateOrdersClient) VerifyDomainOwnershipResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/certificates.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/certificates.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/certificates.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/certificates.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// CertificatesClient is the use these APIs to manage Azure Websites resources
@@ -52,21 +52,21 @@
// resourceGroupName is name of the resource group name is name of the
// certificate. certificateEnvelope is details of certificate if it exists
// already.
-func (client CertificatesClient) CreateOrUpdateCertificate(resourceGroupName string, name string, certificateEnvelope Certificate) (result Certificate, ae error) {
+func (client CertificatesClient) CreateOrUpdateCertificate(resourceGroupName string, name string, certificateEnvelope Certificate) (result Certificate, err error) {
req, err := client.CreateOrUpdateCertificatePreparer(resourceGroupName, name, certificateEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCertificate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCertificate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCertificate", resp, "Failure responding to request")
}
return
@@ -75,29 +75,29 @@
// CreateOrUpdateCertificatePreparer prepares the CreateOrUpdateCertificate request.
func (client CertificatesClient) CreateOrUpdateCertificatePreparer(resourceGroupName string, name string, certificateEnvelope Certificate) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters),
autorest.WithJSON(certificateEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateCertificateSender sends the CreateOrUpdateCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) CreateOrUpdateCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateCertificateResponder handles the response to the CreateOrUpdateCertificate request. The method always
@@ -106,7 +106,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -118,21 +118,21 @@
// resourceGroupName is name of the resource group name is name of the
// certificate. csrEnvelope is details of certificate signing request if it
// exists already.
-func (client CertificatesClient) CreateOrUpdateCsr(resourceGroupName string, name string, csrEnvelope Csr) (result Csr, ae error) {
+func (client CertificatesClient) CreateOrUpdateCsr(resourceGroupName string, name string, csrEnvelope Csr) (result Csr, err error) {
req, err := client.CreateOrUpdateCsrPreparer(resourceGroupName, name, csrEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCsr", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCsr", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateCsrSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCsr", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCsr", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateCsrResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "CreateOrUpdateCsr", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdateCsr", resp, "Failure responding to request")
}
return
@@ -141,29 +141,29 @@
// CreateOrUpdateCsrPreparer prepares the CreateOrUpdateCsr request.
func (client CertificatesClient) CreateOrUpdateCsrPreparer(resourceGroupName string, name string, csrEnvelope Csr) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}", pathParameters),
autorest.WithJSON(csrEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateCsrSender sends the CreateOrUpdateCsr request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) CreateOrUpdateCsrSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateCsrResponder handles the response to the CreateOrUpdateCsr request. The method always
@@ -172,7 +172,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -183,21 +183,21 @@
//
// resourceGroupName is name of the resource group name is name of the
// certificate to be deleted.
-func (client CertificatesClient) DeleteCertificate(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client CertificatesClient) DeleteCertificate(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteCertificatePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCertificate", nil, "Failure preparing request")
}
resp, err := client.DeleteCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCertificate", resp, "Failure sending request")
}
result, err = client.DeleteCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCertificate", resp, "Failure responding to request")
}
return
@@ -206,37 +206,36 @@
// DeleteCertificatePreparer prepares the DeleteCertificate request.
func (client CertificatesClient) DeleteCertificatePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteCertificateSender sends the DeleteCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) DeleteCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteCertificateResponder handles the response to the DeleteCertificate request. The method always
// closes the http.Response Body.
-func (client CertificatesClient) DeleteCertificateResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client CertificatesClient) DeleteCertificateResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +246,21 @@
//
// resourceGroupName is name of the resource group name is name of the
// certificate signing request.
-func (client CertificatesClient) DeleteCsr(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client CertificatesClient) DeleteCsr(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteCsrPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCsr", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCsr", nil, "Failure preparing request")
}
resp, err := client.DeleteCsrSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCsr", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCsr", resp, "Failure sending request")
}
result, err = client.DeleteCsrResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "DeleteCsr", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "DeleteCsr", resp, "Failure responding to request")
}
return
@@ -270,37 +269,36 @@
// DeleteCsrPreparer prepares the DeleteCsr request.
func (client CertificatesClient) DeleteCsrPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteCsrSender sends the DeleteCsr request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) DeleteCsrSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteCsrResponder handles the response to the DeleteCsr request. The method always
// closes the http.Response Body.
-func (client CertificatesClient) DeleteCsrResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client CertificatesClient) DeleteCsrResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -311,21 +309,21 @@
//
// resourceGroupName is name of the resource group name is name of the
// certificate.
-func (client CertificatesClient) GetCertificate(resourceGroupName string, name string) (result Certificate, ae error) {
+func (client CertificatesClient) GetCertificate(resourceGroupName string, name string) (result Certificate, err error) {
req, err := client.GetCertificatePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificate", nil, "Failure preparing request")
}
resp, err := client.GetCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificate", resp, "Failure sending request")
}
result, err = client.GetCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificate", resp, "Failure responding to request")
}
return
@@ -334,28 +332,27 @@
// GetCertificatePreparer prepares the GetCertificate request.
func (client CertificatesClient) GetCertificatePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificateSender sends the GetCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) GetCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificateResponder handles the response to the GetCertificate request. The method always
@@ -364,7 +361,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -374,21 +371,21 @@
// GetCertificates sends the get certificates request.
//
// resourceGroupName is name of the resource group
-func (client CertificatesClient) GetCertificates(resourceGroupName string) (result CertificateCollection, ae error) {
+func (client CertificatesClient) GetCertificates(resourceGroupName string) (result CertificateCollection, err error) {
req, err := client.GetCertificatesPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificates", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificates", nil, "Failure preparing request")
}
resp, err := client.GetCertificatesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificates", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificates", resp, "Failure sending request")
}
result, err = client.GetCertificatesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCertificates", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCertificates", resp, "Failure responding to request")
}
return
@@ -397,27 +394,26 @@
// GetCertificatesPreparer prepares the GetCertificates request.
func (client CertificatesClient) GetCertificatesPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCertificatesSender sends the GetCertificates request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) GetCertificatesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCertificatesResponder handles the response to the GetCertificates request. The method always
@@ -426,7 +422,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -437,21 +433,21 @@
//
// resourceGroupName is name of the resource group name is name of the
// certificate.
-func (client CertificatesClient) GetCsr(resourceGroupName string, name string) (result Csr, ae error) {
+func (client CertificatesClient) GetCsr(resourceGroupName string, name string) (result Csr, err error) {
req, err := client.GetCsrPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsr", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsr", nil, "Failure preparing request")
}
resp, err := client.GetCsrSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsr", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsr", resp, "Failure sending request")
}
result, err = client.GetCsrResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsr", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsr", resp, "Failure responding to request")
}
return
@@ -460,28 +456,27 @@
// GetCsrPreparer prepares the GetCsr request.
func (client CertificatesClient) GetCsrPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCsrSender sends the GetCsr request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) GetCsrSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCsrResponder handles the response to the GetCsr request. The method always
@@ -490,7 +485,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -500,21 +495,21 @@
// GetCsrs sends the get csrs request.
//
// resourceGroupName is name of the resource group
-func (client CertificatesClient) GetCsrs(resourceGroupName string) (result CsrList, ae error) {
+func (client CertificatesClient) GetCsrs(resourceGroupName string) (result ListCsr, err error) {
req, err := client.GetCsrsPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsrs", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsrs", nil, "Failure preparing request")
}
resp, err := client.GetCsrsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsrs", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsrs", resp, "Failure sending request")
}
result, err = client.GetCsrsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "GetCsrs", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "GetCsrs", resp, "Failure responding to request")
}
return
@@ -523,36 +518,35 @@
// GetCsrsPreparer prepares the GetCsrs request.
func (client CertificatesClient) GetCsrsPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetCsrsSender sends the GetCsrs request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) GetCsrsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetCsrsResponder handles the response to the GetCsrs request. The method always
// closes the http.Response Body.
-func (client CertificatesClient) GetCsrsResponder(resp *http.Response) (result CsrList, err error) {
+func (client CertificatesClient) GetCsrsResponder(resp *http.Response) (result ListCsr, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -564,21 +558,21 @@
// resourceGroupName is name of the resource group name is name of the
// certificate. certificateEnvelope is details of certificate if it exists
// already.
-func (client CertificatesClient) UpdateCertificate(resourceGroupName string, name string, certificateEnvelope Certificate) (result Certificate, ae error) {
+func (client CertificatesClient) UpdateCertificate(resourceGroupName string, name string, certificateEnvelope Certificate) (result Certificate, err error) {
req, err := client.UpdateCertificatePreparer(resourceGroupName, name, certificateEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCertificate", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCertificate", nil, "Failure preparing request")
}
resp, err := client.UpdateCertificateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCertificate", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCertificate", resp, "Failure sending request")
}
result, err = client.UpdateCertificateResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCertificate", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCertificate", resp, "Failure responding to request")
}
return
@@ -587,29 +581,29 @@
// UpdateCertificatePreparer prepares the UpdateCertificate request.
func (client CertificatesClient) UpdateCertificatePreparer(resourceGroupName string, name string, certificateEnvelope Certificate) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters),
autorest.WithJSON(certificateEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateCertificateSender sends the UpdateCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) UpdateCertificateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateCertificateResponder handles the response to the UpdateCertificate request. The method always
@@ -618,7 +612,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -630,21 +624,21 @@
// resourceGroupName is name of the resource group name is name of the
// certificate. csrEnvelope is details of certificate signing request if it
// exists already.
-func (client CertificatesClient) UpdateCsr(resourceGroupName string, name string, csrEnvelope Csr) (result Csr, ae error) {
+func (client CertificatesClient) UpdateCsr(resourceGroupName string, name string, csrEnvelope Csr) (result Csr, err error) {
req, err := client.UpdateCsrPreparer(resourceGroupName, name, csrEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCsr", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCsr", nil, "Failure preparing request")
}
resp, err := client.UpdateCsrSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCsr", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCsr", resp, "Failure sending request")
}
result, err = client.UpdateCsrResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/CertificatesClient", "UpdateCsr", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.CertificatesClient", "UpdateCsr", resp, "Failure responding to request")
}
return
@@ -653,29 +647,29 @@
// UpdateCsrPreparer prepares the UpdateCsr request.
func (client CertificatesClient) UpdateCsrPreparer(resourceGroupName string, name string, csrEnvelope Csr) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}", pathParameters),
autorest.WithJSON(csrEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateCsrSender sends the UpdateCsr request. The method will close the
// http.Response Body if it receives an error.
func (client CertificatesClient) UpdateCsrSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateCsrResponder handles the response to the UpdateCsr request. The method always
@@ -684,7 +678,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/classicmobileservices.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/classicmobileservices.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/classicmobileservices.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/classicmobileservices.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// ClassicMobileServicesClient is the use these APIs to manage Azure Websites
@@ -51,21 +51,21 @@
// DeleteClassicMobileService sends the delete classic mobile service request.
//
// resourceGroupName is name of resource group name is name of mobile service
-func (client ClassicMobileServicesClient) DeleteClassicMobileService(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client ClassicMobileServicesClient) DeleteClassicMobileService(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteClassicMobileServicePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "DeleteClassicMobileService", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "DeleteClassicMobileService", nil, "Failure preparing request")
}
resp, err := client.DeleteClassicMobileServiceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "DeleteClassicMobileService", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "DeleteClassicMobileService", resp, "Failure sending request")
}
result, err = client.DeleteClassicMobileServiceResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "DeleteClassicMobileService", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "DeleteClassicMobileService", resp, "Failure responding to request")
}
return
@@ -74,37 +74,36 @@
// DeleteClassicMobileServicePreparer prepares the DeleteClassicMobileService request.
func (client ClassicMobileServicesClient) DeleteClassicMobileServicePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteClassicMobileServiceSender sends the DeleteClassicMobileService request. The method will close the
// http.Response Body if it receives an error.
func (client ClassicMobileServicesClient) DeleteClassicMobileServiceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteClassicMobileServiceResponder handles the response to the DeleteClassicMobileService request. The method always
// closes the http.Response Body.
-func (client ClassicMobileServicesClient) DeleteClassicMobileServiceResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ClassicMobileServicesClient) DeleteClassicMobileServiceResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -114,21 +113,21 @@
// GetClassicMobileService sends the get classic mobile service request.
//
// resourceGroupName is name of resource group name is name of mobile service
-func (client ClassicMobileServicesClient) GetClassicMobileService(resourceGroupName string, name string) (result ClassicMobileService, ae error) {
+func (client ClassicMobileServicesClient) GetClassicMobileService(resourceGroupName string, name string) (result ClassicMobileService, err error) {
req, err := client.GetClassicMobileServicePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileService", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileService", nil, "Failure preparing request")
}
resp, err := client.GetClassicMobileServiceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileService", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileService", resp, "Failure sending request")
}
result, err = client.GetClassicMobileServiceResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileService", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileService", resp, "Failure responding to request")
}
return
@@ -137,28 +136,27 @@
// GetClassicMobileServicePreparer prepares the GetClassicMobileService request.
func (client ClassicMobileServicesClient) GetClassicMobileServicePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetClassicMobileServiceSender sends the GetClassicMobileService request. The method will close the
// http.Response Body if it receives an error.
func (client ClassicMobileServicesClient) GetClassicMobileServiceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetClassicMobileServiceResponder handles the response to the GetClassicMobileService request. The method always
@@ -167,7 +165,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -177,21 +175,21 @@
// GetClassicMobileServices sends the get classic mobile services request.
//
// resourceGroupName is name of resource group
-func (client ClassicMobileServicesClient) GetClassicMobileServices(resourceGroupName string) (result ClassicMobileServiceCollection, ae error) {
+func (client ClassicMobileServicesClient) GetClassicMobileServices(resourceGroupName string) (result ClassicMobileServiceCollection, err error) {
req, err := client.GetClassicMobileServicesPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileServices", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileServices", nil, "Failure preparing request")
}
resp, err := client.GetClassicMobileServicesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileServices", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileServices", resp, "Failure sending request")
}
result, err = client.GetClassicMobileServicesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ClassicMobileServicesClient", "GetClassicMobileServices", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ClassicMobileServicesClient", "GetClassicMobileServices", resp, "Failure responding to request")
}
return
@@ -200,27 +198,26 @@
// GetClassicMobileServicesPreparer prepares the GetClassicMobileServices request.
func (client ClassicMobileServicesClient) GetClassicMobileServicesPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/classicMobileServices", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetClassicMobileServicesSender sends the GetClassicMobileServices request. The method will close the
// http.Response Body if it receives an error.
func (client ClassicMobileServicesClient) GetClassicMobileServicesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetClassicMobileServicesResponder handles the response to the GetClassicMobileServices request. The method always
@@ -229,7 +226,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/client.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/client.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/client.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/client.go 2016-10-13 14:32:06.000000000 +0000
@@ -1,3 +1,12 @@
+// Package web implements the Azure ARM Web service API version 2015-08-01.
+//
+// Use these APIs to manage Azure Websites resources through the Azure
+// Resource Manager. All task operations conform to the HTTP/1.1 protocol
+// specification and each operation returns an x-ms-request-id header that
+// can be used to obtain information about the request. You must make sure
+// that requests made to these resources are secure. For more information,
+// see Authenticating Azure Resource Manager requests
+// (https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx).
package web
// Copyright (c) Microsoft and contributors. All rights reserved.
@@ -14,12 +23,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
)
const (
@@ -30,17 +39,11 @@
DefaultBaseURI = "https://management.azure.com"
)
-// ManagementClient is the use these APIs to manage Azure Websites resources
-// through the Azure Resource Manager. All task operations conform to the
-// HTTP/1.1 protocol specification and each operation returns an
-// x-ms-request-id header that can be used to obtain information about the
-// request. You must make sure that requests made to these resources are
-// secure. For more information, see Authenticating
-// Azure Resource Manager requests.
+// ManagementClient is the base client for Web.
type ManagementClient struct {
autorest.Client
BaseURI string
+ APIVersion string
SubscriptionID string
}
@@ -54,6 +57,7 @@
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
+ APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/domains.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/domains.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/domains.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/domains.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// DomainsClient is the use these APIs to manage Azure Websites resources
@@ -50,21 +50,21 @@
//
// resourceGroupName is >Name of the resource group domainName is name of
// the domain domain is domain registration information
-func (client DomainsClient) CreateOrUpdateDomain(resourceGroupName string, domainName string, domain Domain) (result Domain, ae error) {
+func (client DomainsClient) CreateOrUpdateDomain(resourceGroupName string, domainName string, domain Domain) (result Domain, err error) {
req, err := client.CreateOrUpdateDomainPreparer(resourceGroupName, domainName, domain)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "CreateOrUpdateDomain", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateDomain", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateDomainSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "CreateOrUpdateDomain", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateDomain", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateDomainResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "CreateOrUpdateDomain", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateDomain", resp, "Failure responding to request")
}
return
@@ -73,29 +73,29 @@
// CreateOrUpdateDomainPreparer prepares the CreateOrUpdateDomain request.
func (client DomainsClient) CreateOrUpdateDomainPreparer(resourceGroupName string, domainName string, domain Domain) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "domainName": url.QueryEscape(domainName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "domainName": autorest.Encode("path", domainName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters),
autorest.WithJSON(domain),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateDomainSender sends the CreateOrUpdateDomain request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) CreateOrUpdateDomainSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateDomainResponder handles the response to the CreateOrUpdateDomain request. The method always
@@ -104,7 +104,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -116,21 +116,21 @@
// resourceGroupName is name of the resource group domainName is name of the
// domain forceHardDeleteDomain is if true then the domain will be deleted
// immediately instead of after 24 hours
-func (client DomainsClient) DeleteDomain(resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (result ObjectSet, ae error) {
+func (client DomainsClient) DeleteDomain(resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (result SetObject, err error) {
req, err := client.DeleteDomainPreparer(resourceGroupName, domainName, forceHardDeleteDomain)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "DeleteDomain", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteDomain", nil, "Failure preparing request")
}
resp, err := client.DeleteDomainSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "DeleteDomain", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteDomain", resp, "Failure sending request")
}
result, err = client.DeleteDomainResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "DeleteDomain", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteDomain", resp, "Failure responding to request")
}
return
@@ -139,40 +139,39 @@
// DeleteDomainPreparer prepares the DeleteDomain request.
func (client DomainsClient) DeleteDomainPreparer(resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "domainName": url.QueryEscape(domainName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "domainName": autorest.Encode("path", domainName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if forceHardDeleteDomain != nil {
- queryParameters["forceHardDeleteDomain"] = forceHardDeleteDomain
+ queryParameters["forceHardDeleteDomain"] = autorest.Encode("query", *forceHardDeleteDomain)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteDomainSender sends the DeleteDomain request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) DeleteDomainSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
+ return autorest.SendWithSender(client, req)
}
// DeleteDomainResponder handles the response to the DeleteDomain request. The method always
// closes the http.Response Body.
-func (client DomainsClient) DeleteDomainResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client DomainsClient) DeleteDomainResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -183,21 +182,21 @@
//
// resourceGroupName is name of the resource group domainName is name of the
// domain
-func (client DomainsClient) GetDomain(resourceGroupName string, domainName string) (result Domain, ae error) {
+func (client DomainsClient) GetDomain(resourceGroupName string, domainName string) (result Domain, err error) {
req, err := client.GetDomainPreparer(resourceGroupName, domainName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomain", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomain", nil, "Failure preparing request")
}
resp, err := client.GetDomainSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomain", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomain", resp, "Failure sending request")
}
result, err = client.GetDomainResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomain", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomain", resp, "Failure responding to request")
}
return
@@ -206,28 +205,27 @@
// GetDomainPreparer prepares the GetDomain request.
func (client DomainsClient) GetDomainPreparer(resourceGroupName string, domainName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "domainName": url.QueryEscape(domainName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "domainName": autorest.Encode("path", domainName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetDomainSender sends the GetDomain request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) GetDomainSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetDomainResponder handles the response to the GetDomain request. The method always
@@ -236,7 +234,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -247,21 +245,21 @@
//
// resourceGroupName is name of the resource group domainName is name of the
// domain operationID is domain purchase operation Id
-func (client DomainsClient) GetDomainOperation(resourceGroupName string, domainName string, operationID string) (result Domain, ae error) {
+func (client DomainsClient) GetDomainOperation(resourceGroupName string, domainName string, operationID string) (result Domain, err error) {
req, err := client.GetDomainOperationPreparer(resourceGroupName, domainName, operationID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomainOperation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomainOperation", nil, "Failure preparing request")
}
resp, err := client.GetDomainOperationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomainOperation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomainOperation", resp, "Failure sending request")
}
result, err = client.GetDomainOperationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomainOperation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomainOperation", resp, "Failure responding to request")
}
return
@@ -270,29 +268,28 @@
// GetDomainOperationPreparer prepares the GetDomainOperation request.
func (client DomainsClient) GetDomainOperationPreparer(resourceGroupName string, domainName string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "domainName": url.QueryEscape(domainName),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "domainName": autorest.Encode("path", domainName),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/operationresults/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/operationresults/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetDomainOperationSender sends the GetDomainOperation request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) GetDomainOperationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK, http.StatusInternalServerError)
+ return autorest.SendWithSender(client, req)
}
// GetDomainOperationResponder handles the response to the GetDomainOperation request. The method always
@@ -301,7 +298,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusInternalServerError),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusInternalServerError),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -311,21 +308,21 @@
// GetDomains sends the get domains request.
//
// resourceGroupName is name of the resource group
-func (client DomainsClient) GetDomains(resourceGroupName string) (result DomainCollection, ae error) {
+func (client DomainsClient) GetDomains(resourceGroupName string) (result DomainCollection, err error) {
req, err := client.GetDomainsPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomains", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomains", nil, "Failure preparing request")
}
resp, err := client.GetDomainsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomains", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomains", resp, "Failure sending request")
}
result, err = client.GetDomainsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "GetDomains", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetDomains", resp, "Failure responding to request")
}
return
@@ -334,27 +331,26 @@
// GetDomainsPreparer prepares the GetDomains request.
func (client DomainsClient) GetDomainsPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetDomainsSender sends the GetDomains request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) GetDomainsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetDomainsResponder handles the response to the GetDomains request. The method always
@@ -363,7 +359,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -374,21 +370,21 @@
//
// resourceGroupName is >Name of the resource group domainName is name of
// the domain domain is domain registration information
-func (client DomainsClient) UpdateDomain(resourceGroupName string, domainName string, domain Domain) (result Domain, ae error) {
+func (client DomainsClient) UpdateDomain(resourceGroupName string, domainName string, domain Domain) (result Domain, err error) {
req, err := client.UpdateDomainPreparer(resourceGroupName, domainName, domain)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "UpdateDomain", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateDomain", nil, "Failure preparing request")
}
resp, err := client.UpdateDomainSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/DomainsClient", "UpdateDomain", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateDomain", resp, "Failure sending request")
}
result, err = client.UpdateDomainResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/DomainsClient", "UpdateDomain", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateDomain", resp, "Failure responding to request")
}
return
@@ -397,29 +393,29 @@
// UpdateDomainPreparer prepares the UpdateDomain request.
func (client DomainsClient) UpdateDomainPreparer(resourceGroupName string, domainName string, domain Domain) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "domainName": url.QueryEscape(domainName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "domainName": autorest.Encode("path", domainName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters),
autorest.WithJSON(domain),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateDomainSender sends the UpdateDomain request. The method will close the
// http.Response Body if it receives an error.
func (client DomainsClient) UpdateDomainSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusAccepted, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateDomainResponder handles the response to the UpdateDomain request. The method always
@@ -428,7 +424,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globalcertificateorder.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globalcertificateorder.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globalcertificateorder.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globalcertificateorder.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// GlobalCertificateOrderClient is the use these APIs to manage Azure Websites
@@ -49,21 +49,21 @@
}
// GetAllCertificateOrders sends the get all certificate orders request.
-func (client GlobalCertificateOrderClient) GetAllCertificateOrders() (result CertificateOrderCollection, ae error) {
+func (client GlobalCertificateOrderClient) GetAllCertificateOrders() (result CertificateOrderCollection, err error) {
req, err := client.GetAllCertificateOrdersPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalCertificateOrderClient", "GetAllCertificateOrders", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "GetAllCertificateOrders", nil, "Failure preparing request")
}
resp, err := client.GetAllCertificateOrdersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalCertificateOrderClient", "GetAllCertificateOrders", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "GetAllCertificateOrders", resp, "Failure sending request")
}
result, err = client.GetAllCertificateOrdersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalCertificateOrderClient", "GetAllCertificateOrders", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "GetAllCertificateOrders", resp, "Failure responding to request")
}
return
@@ -72,26 +72,25 @@
// GetAllCertificateOrdersPreparer prepares the GetAllCertificateOrders request.
func (client GlobalCertificateOrderClient) GetAllCertificateOrdersPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllCertificateOrdersSender sends the GetAllCertificateOrders request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalCertificateOrderClient) GetAllCertificateOrdersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllCertificateOrdersResponder handles the response to the GetAllCertificateOrders request. The method always
@@ -100,9 +99,72 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
+}
+
+// ValidateCertificatePurchaseInformation sends the validate certificate
+// purchase information request.
+//
+// certificateOrder is certificate order
+func (client GlobalCertificateOrderClient) ValidateCertificatePurchaseInformation(certificateOrder CertificateOrder) (result SetObject, err error) {
+ req, err := client.ValidateCertificatePurchaseInformationPreparer(certificateOrder)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "ValidateCertificatePurchaseInformation", nil, "Failure preparing request")
+ }
+
+ resp, err := client.ValidateCertificatePurchaseInformationSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "ValidateCertificatePurchaseInformation", resp, "Failure sending request")
+ }
+
+ result, err = client.ValidateCertificatePurchaseInformationResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.GlobalCertificateOrderClient", "ValidateCertificatePurchaseInformation", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ValidateCertificatePurchaseInformationPreparer prepares the ValidateCertificatePurchaseInformation request.
+func (client GlobalCertificateOrderClient) ValidateCertificatePurchaseInformationPreparer(certificateOrder CertificateOrder) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation", pathParameters),
+ autorest.WithJSON(certificateOrder),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// ValidateCertificatePurchaseInformationSender sends the ValidateCertificatePurchaseInformation request. The method will close the
+// http.Response Body if it receives an error.
+func (client GlobalCertificateOrderClient) ValidateCertificatePurchaseInformationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// ValidateCertificatePurchaseInformationResponder handles the response to the ValidateCertificatePurchaseInformation request. The method always
+// closes the http.Response Body.
+func (client GlobalCertificateOrderClient) ValidateCertificatePurchaseInformationResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globaldomainregistration.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globaldomainregistration.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globaldomainregistration.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globaldomainregistration.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// GlobalDomainRegistrationClient is the use these APIs to manage Azure
@@ -51,21 +51,21 @@
// CheckDomainAvailability sends the check domain availability request.
//
// identifier is name of the domain
-func (client GlobalDomainRegistrationClient) CheckDomainAvailability(identifier NameIdentifier) (result DomainAvailablilityCheckResult, ae error) {
+func (client GlobalDomainRegistrationClient) CheckDomainAvailability(identifier NameIdentifier) (result DomainAvailablilityCheckResult, err error) {
req, err := client.CheckDomainAvailabilityPreparer(identifier)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "CheckDomainAvailability", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "CheckDomainAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckDomainAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "CheckDomainAvailability", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "CheckDomainAvailability", resp, "Failure sending request")
}
result, err = client.CheckDomainAvailabilityResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "CheckDomainAvailability", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "CheckDomainAvailability", resp, "Failure responding to request")
}
return
@@ -74,27 +74,27 @@
// CheckDomainAvailabilityPreparer prepares the CheckDomainAvailability request.
func (client GlobalDomainRegistrationClient) CheckDomainAvailabilityPreparer(identifier NameIdentifier) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability", pathParameters),
autorest.WithJSON(identifier),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CheckDomainAvailabilitySender sends the CheckDomainAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalDomainRegistrationClient) CheckDomainAvailabilitySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CheckDomainAvailabilityResponder handles the response to the CheckDomainAvailability request. The method always
@@ -103,7 +103,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -111,21 +111,21 @@
}
// GetAllDomains sends the get all domains request.
-func (client GlobalDomainRegistrationClient) GetAllDomains() (result DomainCollection, ae error) {
+func (client GlobalDomainRegistrationClient) GetAllDomains() (result DomainCollection, err error) {
req, err := client.GetAllDomainsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetAllDomains", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetAllDomains", nil, "Failure preparing request")
}
resp, err := client.GetAllDomainsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetAllDomains", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetAllDomains", resp, "Failure sending request")
}
result, err = client.GetAllDomainsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetAllDomains", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetAllDomains", resp, "Failure responding to request")
}
return
@@ -134,26 +134,25 @@
// GetAllDomainsPreparer prepares the GetAllDomains request.
func (client GlobalDomainRegistrationClient) GetAllDomainsPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllDomainsSender sends the GetAllDomains request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalDomainRegistrationClient) GetAllDomainsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllDomainsResponder handles the response to the GetAllDomains request. The method always
@@ -162,7 +161,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -171,21 +170,21 @@
// GetDomainControlCenterSsoRequest sends the get domain control center sso
// request request.
-func (client GlobalDomainRegistrationClient) GetDomainControlCenterSsoRequest() (result DomainControlCenterSsoRequest, ae error) {
+func (client GlobalDomainRegistrationClient) GetDomainControlCenterSsoRequest() (result DomainControlCenterSsoRequest, err error) {
req, err := client.GetDomainControlCenterSsoRequestPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", nil, "Failure preparing request")
}
resp, err := client.GetDomainControlCenterSsoRequestSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", resp, "Failure sending request")
}
result, err = client.GetDomainControlCenterSsoRequestResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "GetDomainControlCenterSsoRequest", resp, "Failure responding to request")
}
return
@@ -194,26 +193,25 @@
// GetDomainControlCenterSsoRequestPreparer prepares the GetDomainControlCenterSsoRequest request.
func (client GlobalDomainRegistrationClient) GetDomainControlCenterSsoRequestPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetDomainControlCenterSsoRequestSender sends the GetDomainControlCenterSsoRequest request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalDomainRegistrationClient) GetDomainControlCenterSsoRequestSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetDomainControlCenterSsoRequestResponder handles the response to the GetDomainControlCenterSsoRequest request. The method always
@@ -222,7 +220,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -232,21 +230,21 @@
// ListDomainRecommendations sends the list domain recommendations request.
//
// parameters is domain recommendation search parameters
-func (client GlobalDomainRegistrationClient) ListDomainRecommendations(parameters DomainRecommendationSearchParameters) (result NameIdentifierCollection, ae error) {
+func (client GlobalDomainRegistrationClient) ListDomainRecommendations(parameters DomainRecommendationSearchParameters) (result NameIdentifierCollection, err error) {
req, err := client.ListDomainRecommendationsPreparer(parameters)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ListDomainRecommendations", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ListDomainRecommendations", nil, "Failure preparing request")
}
resp, err := client.ListDomainRecommendationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ListDomainRecommendations", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ListDomainRecommendations", resp, "Failure sending request")
}
result, err = client.ListDomainRecommendationsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ListDomainRecommendations", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ListDomainRecommendations", resp, "Failure responding to request")
}
return
@@ -255,27 +253,27 @@
// ListDomainRecommendationsPreparer prepares the ListDomainRecommendations request.
func (client GlobalDomainRegistrationClient) ListDomainRecommendationsPreparer(parameters DomainRecommendationSearchParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations", pathParameters),
autorest.WithJSON(parameters),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListDomainRecommendationsSender sends the ListDomainRecommendations request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalDomainRegistrationClient) ListDomainRecommendationsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListDomainRecommendationsResponder handles the response to the ListDomainRecommendations request. The method always
@@ -284,7 +282,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -295,21 +293,21 @@
// information request.
//
// domainRegistrationInput is domain registration information
-func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformation(domainRegistrationInput DomainRegistrationInput) (result ObjectSet, ae error) {
+func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformation(domainRegistrationInput DomainRegistrationInput) (result SetObject, err error) {
req, err := client.ValidateDomainPurchaseInformationPreparer(domainRegistrationInput)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", nil, "Failure preparing request")
}
resp, err := client.ValidateDomainPurchaseInformationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", resp, "Failure sending request")
}
result, err = client.ValidateDomainPurchaseInformationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalDomainRegistrationClient", "ValidateDomainPurchaseInformation", resp, "Failure responding to request")
}
return
@@ -318,36 +316,36 @@
// ValidateDomainPurchaseInformationPreparer prepares the ValidateDomainPurchaseInformation request.
func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformationPreparer(domainRegistrationInput DomainRegistrationInput) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/validateDomainRegistrationInformation"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/validateDomainRegistrationInformation", pathParameters),
autorest.WithJSON(domainRegistrationInput),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ValidateDomainPurchaseInformationSender sends the ValidateDomainPurchaseInformation request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ValidateDomainPurchaseInformationResponder handles the response to the ValidateDomainPurchaseInformation request. The method always
// closes the http.Response Body.
-func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformationResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client GlobalDomainRegistrationClient) ValidateDomainPurchaseInformationResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/global.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/global.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/global.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/global.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// GlobalClient is the use these APIs to manage Azure Websites resources
@@ -49,21 +49,21 @@
// CheckNameAvailability sends the check name availability request.
//
// request is name availability request
-func (client GlobalClient) CheckNameAvailability(request ResourceNameAvailabilityRequest) (result ResourceNameAvailability, ae error) {
+func (client GlobalClient) CheckNameAvailability(request ResourceNameAvailabilityRequest) (result ResourceNameAvailability, err error) {
req, err := client.CheckNameAvailabilityPreparer(request)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "CheckNameAvailability", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "CheckNameAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "CheckNameAvailability", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "CheckNameAvailability", resp, "Failure sending request")
}
result, err = client.CheckNameAvailabilityResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "CheckNameAvailability", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "CheckNameAvailability", resp, "Failure responding to request")
}
return
@@ -72,27 +72,27 @@
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client GlobalClient) CheckNameAvailabilityPreparer(request ResourceNameAvailabilityRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
@@ -101,7 +101,65 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetAllCertificates sends the get all certificates request.
+func (client GlobalClient) GetAllCertificates() (result CertificateCollection, err error) {
+ req, err := client.GetAllCertificatesPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllCertificates", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetAllCertificatesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllCertificates", resp, "Failure sending request")
+ }
+
+ result, err = client.GetAllCertificatesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllCertificates", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetAllCertificatesPreparer prepares the GetAllCertificates request.
+func (client GlobalClient) GetAllCertificatesPreparer() (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetAllCertificatesSender sends the GetAllCertificates request. The method will close the
+// http.Response Body if it receives an error.
+func (client GlobalClient) GetAllCertificatesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetAllCertificatesResponder handles the response to the GetAllCertificates request. The method always
+// closes the http.Response Body.
+func (client GlobalClient) GetAllCertificatesResponder(resp *http.Response) (result CertificateCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -110,21 +168,21 @@
// GetAllClassicMobileServices sends the get all classic mobile services
// request.
-func (client GlobalClient) GetAllClassicMobileServices() (result ClassicMobileServiceCollection, ae error) {
+func (client GlobalClient) GetAllClassicMobileServices() (result ClassicMobileServiceCollection, err error) {
req, err := client.GetAllClassicMobileServicesPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllClassicMobileServices", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllClassicMobileServices", nil, "Failure preparing request")
}
resp, err := client.GetAllClassicMobileServicesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllClassicMobileServices", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllClassicMobileServices", resp, "Failure sending request")
}
result, err = client.GetAllClassicMobileServicesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllClassicMobileServices", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllClassicMobileServices", resp, "Failure responding to request")
}
return
@@ -133,26 +191,25 @@
// GetAllClassicMobileServicesPreparer prepares the GetAllClassicMobileServices request.
func (client GlobalClient) GetAllClassicMobileServicesPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/classicMobileServices"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/classicMobileServices", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllClassicMobileServicesSender sends the GetAllClassicMobileServices request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetAllClassicMobileServicesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllClassicMobileServicesResponder handles the response to the GetAllClassicMobileServices request. The method always
@@ -161,7 +218,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -169,21 +226,21 @@
}
// GetAllHostingEnvironments sends the get all hosting environments request.
-func (client GlobalClient) GetAllHostingEnvironments() (result HostingEnvironmentCollection, ae error) {
+func (client GlobalClient) GetAllHostingEnvironments() (result HostingEnvironmentCollection, err error) {
req, err := client.GetAllHostingEnvironmentsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllHostingEnvironments", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllHostingEnvironments", nil, "Failure preparing request")
}
resp, err := client.GetAllHostingEnvironmentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllHostingEnvironments", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllHostingEnvironments", resp, "Failure sending request")
}
result, err = client.GetAllHostingEnvironmentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllHostingEnvironments", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllHostingEnvironments", resp, "Failure responding to request")
}
return
@@ -192,26 +249,25 @@
// GetAllHostingEnvironmentsPreparer prepares the GetAllHostingEnvironments request.
func (client GlobalClient) GetAllHostingEnvironmentsPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllHostingEnvironmentsSender sends the GetAllHostingEnvironments request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetAllHostingEnvironmentsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllHostingEnvironmentsResponder handles the response to the GetAllHostingEnvironments request. The method always
@@ -220,7 +276,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -229,21 +285,21 @@
// GetAllManagedHostingEnvironments sends the get all managed hosting
// environments request.
-func (client GlobalClient) GetAllManagedHostingEnvironments() (result ManagedHostingEnvironmentCollection, ae error) {
+func (client GlobalClient) GetAllManagedHostingEnvironments() (result ManagedHostingEnvironmentCollection, err error) {
req, err := client.GetAllManagedHostingEnvironmentsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllManagedHostingEnvironments", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllManagedHostingEnvironments", nil, "Failure preparing request")
}
resp, err := client.GetAllManagedHostingEnvironmentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllManagedHostingEnvironments", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllManagedHostingEnvironments", resp, "Failure sending request")
}
result, err = client.GetAllManagedHostingEnvironmentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllManagedHostingEnvironments", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllManagedHostingEnvironments", resp, "Failure responding to request")
}
return
@@ -252,26 +308,25 @@
// GetAllManagedHostingEnvironmentsPreparer prepares the GetAllManagedHostingEnvironments request.
func (client GlobalClient) GetAllManagedHostingEnvironmentsPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/managedHostingEnvironments"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/managedHostingEnvironments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllManagedHostingEnvironmentsSender sends the GetAllManagedHostingEnvironments request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetAllManagedHostingEnvironmentsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllManagedHostingEnvironmentsResponder handles the response to the GetAllManagedHostingEnvironments request. The method always
@@ -280,7 +335,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -292,21 +347,21 @@
// detailed is false to return a subset of App Service Plan properties, true
// to return all of the properties.
// Retrieval of all properties may increase the API latency.
-func (client GlobalClient) GetAllServerFarms(detailed *bool) (result ServerFarmCollection, ae error) {
+func (client GlobalClient) GetAllServerFarms(detailed *bool) (result ServerFarmCollection, err error) {
req, err := client.GetAllServerFarmsPreparer(detailed)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllServerFarms", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllServerFarms", nil, "Failure preparing request")
}
resp, err := client.GetAllServerFarmsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllServerFarms", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllServerFarms", resp, "Failure sending request")
}
result, err = client.GetAllServerFarmsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllServerFarms", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllServerFarms", resp, "Failure responding to request")
}
return
@@ -315,29 +370,28 @@
// GetAllServerFarmsPreparer prepares the GetAllServerFarms request.
func (client GlobalClient) GetAllServerFarmsPreparer(detailed *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if detailed != nil {
- queryParameters["detailed"] = detailed
+ queryParameters["detailed"] = autorest.Encode("query", *detailed)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllServerFarmsSender sends the GetAllServerFarms request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetAllServerFarmsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllServerFarmsResponder handles the response to the GetAllServerFarms request. The method always
@@ -346,7 +400,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -354,21 +408,21 @@
}
// GetAllSites sends the get all sites request.
-func (client GlobalClient) GetAllSites() (result SiteCollection, ae error) {
+func (client GlobalClient) GetAllSites() (result SiteCollection, err error) {
req, err := client.GetAllSitesPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllSites", nil, "Failure preparing request")
}
resp, err := client.GetAllSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllSites", resp, "Failure sending request")
}
result, err = client.GetAllSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetAllSites", resp, "Failure responding to request")
}
return
@@ -377,26 +431,25 @@
// GetAllSitesPreparer prepares the GetAllSites request.
func (client GlobalClient) GetAllSitesPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetAllSitesSender sends the GetAllSites request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetAllSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetAllSitesResponder handles the response to the GetAllSites request. The method always
@@ -405,73 +458,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAllWebHostingPlans sends the get all web hosting plans request.
-//
-// detailed is false to return a subset of App Service Plan properties, true
-// to return all of the properties.
-// Retrieval of all properties may increase the API latency.
-func (client GlobalClient) GetAllWebHostingPlans(detailed *bool) (result ServerFarmCollection, ae error) {
- req, err := client.GetAllWebHostingPlansPreparer(detailed)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllWebHostingPlans", "Failure preparing request")
- }
-
- resp, err := client.GetAllWebHostingPlansSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllWebHostingPlans", "Failure sending request")
- }
-
- result, err = client.GetAllWebHostingPlansResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetAllWebHostingPlans", "Failure responding to request")
- }
-
- return
-}
-
-// GetAllWebHostingPlansPreparer prepares the GetAllWebHostingPlans request.
-func (client GlobalClient) GetAllWebHostingPlansPreparer(detailed *bool) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if detailed != nil {
- queryParameters["detailed"] = detailed
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/webhostingplans"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetAllWebHostingPlansSender sends the GetAllWebHostingPlans request. The method will close the
-// http.Response Body if it receives an error.
-func (client GlobalClient) GetAllWebHostingPlansSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetAllWebHostingPlansResponder handles the response to the GetAllWebHostingPlans request. The method always
-// closes the http.Response Body.
-func (client GlobalClient) GetAllWebHostingPlansResponder(resp *http.Response) (result ServerFarmCollection, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -479,49 +466,53 @@
}
// GetSubscriptionGeoRegions sends the get subscription geo regions request.
-func (client GlobalClient) GetSubscriptionGeoRegions() (result GeoRegionCollection, ae error) {
- req, err := client.GetSubscriptionGeoRegionsPreparer()
+//
+// sku is filter only to regions that support this sku
+func (client GlobalClient) GetSubscriptionGeoRegions(sku string) (result GeoRegionCollection, err error) {
+ req, err := client.GetSubscriptionGeoRegionsPreparer(sku)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionGeoRegions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionGeoRegions", nil, "Failure preparing request")
}
resp, err := client.GetSubscriptionGeoRegionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionGeoRegions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionGeoRegions", resp, "Failure sending request")
}
result, err = client.GetSubscriptionGeoRegionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionGeoRegions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionGeoRegions", resp, "Failure responding to request")
}
return
}
// GetSubscriptionGeoRegionsPreparer prepares the GetSubscriptionGeoRegions request.
-func (client GlobalClient) GetSubscriptionGeoRegionsPreparer() (*http.Request, error) {
+func (client GlobalClient) GetSubscriptionGeoRegionsPreparer(sku string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(sku) > 0 {
+ queryParameters["sku"] = autorest.Encode("query", sku)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSubscriptionGeoRegionsSender sends the GetSubscriptionGeoRegions request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetSubscriptionGeoRegionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSubscriptionGeoRegionsResponder handles the response to the GetSubscriptionGeoRegions request. The method always
@@ -530,7 +521,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -539,21 +530,21 @@
// GetSubscriptionPublishingCredentials sends the get subscription publishing
// credentials request.
-func (client GlobalClient) GetSubscriptionPublishingCredentials() (result User, ae error) {
+func (client GlobalClient) GetSubscriptionPublishingCredentials() (result User, err error) {
req, err := client.GetSubscriptionPublishingCredentialsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionPublishingCredentials", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionPublishingCredentials", nil, "Failure preparing request")
}
resp, err := client.GetSubscriptionPublishingCredentialsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionPublishingCredentials", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionPublishingCredentials", resp, "Failure sending request")
}
result, err = client.GetSubscriptionPublishingCredentialsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "GetSubscriptionPublishingCredentials", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionPublishingCredentials", resp, "Failure responding to request")
}
return
@@ -562,26 +553,25 @@
// GetSubscriptionPublishingCredentialsPreparer prepares the GetSubscriptionPublishingCredentials request.
func (client GlobalClient) GetSubscriptionPublishingCredentialsPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSubscriptionPublishingCredentialsSender sends the GetSubscriptionPublishingCredentials request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) GetSubscriptionPublishingCredentialsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSubscriptionPublishingCredentialsResponder handles the response to the GetSubscriptionPublishingCredentials request. The method always
@@ -590,7 +580,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -601,21 +591,21 @@
// available request.
//
// name is hosting environment name
-func (client GlobalClient) IsHostingEnvironmentNameAvailable(name string) (result ObjectSet, ae error) {
+func (client GlobalClient) IsHostingEnvironmentNameAvailable(name string) (result SetObject, err error) {
req, err := client.IsHostingEnvironmentNameAvailablePreparer(name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentNameAvailable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentNameAvailable", nil, "Failure preparing request")
}
resp, err := client.IsHostingEnvironmentNameAvailableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentNameAvailable", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentNameAvailable", resp, "Failure sending request")
}
result, err = client.IsHostingEnvironmentNameAvailableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentNameAvailable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentNameAvailable", resp, "Failure responding to request")
}
return
@@ -624,36 +614,35 @@
// IsHostingEnvironmentNameAvailablePreparer prepares the IsHostingEnvironmentNameAvailable request.
func (client GlobalClient) IsHostingEnvironmentNameAvailablePreparer(name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "name": name,
+ "api-version": client.APIVersion,
+ "name": autorest.Encode("query", name),
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/ishostingenvironmentnameavailable"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/ishostingenvironmentnameavailable", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// IsHostingEnvironmentNameAvailableSender sends the IsHostingEnvironmentNameAvailable request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) IsHostingEnvironmentNameAvailableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// IsHostingEnvironmentNameAvailableResponder handles the response to the IsHostingEnvironmentNameAvailable request. The method always
// closes the http.Response Body.
-func (client GlobalClient) IsHostingEnvironmentNameAvailableResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client GlobalClient) IsHostingEnvironmentNameAvailableResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -664,21 +653,21 @@
// environment with legacy name available request.
//
// name is hosting environment name
-func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailable(name string) (result ObjectSet, ae error) {
+func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailable(name string) (result SetObject, err error) {
req, err := client.IsHostingEnvironmentWithLegacyNameAvailablePreparer(name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", nil, "Failure preparing request")
}
resp, err := client.IsHostingEnvironmentWithLegacyNameAvailableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", resp, "Failure sending request")
}
result, err = client.IsHostingEnvironmentWithLegacyNameAvailableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "IsHostingEnvironmentWithLegacyNameAvailable", resp, "Failure responding to request")
}
return
@@ -687,36 +676,35 @@
// IsHostingEnvironmentWithLegacyNameAvailablePreparer prepares the IsHostingEnvironmentWithLegacyNameAvailable request.
func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailablePreparer(name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/ishostingenvironmentnameavailable/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/ishostingenvironmentnameavailable/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// IsHostingEnvironmentWithLegacyNameAvailableSender sends the IsHostingEnvironmentWithLegacyNameAvailable request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailableSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// IsHostingEnvironmentWithLegacyNameAvailableResponder handles the response to the IsHostingEnvironmentWithLegacyNameAvailable request. The method always
// closes the http.Response Body.
-func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailableResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client GlobalClient) IsHostingEnvironmentWithLegacyNameAvailableResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -724,21 +712,21 @@
}
// ListPremierAddOnOffers sends the list premier add on offers request.
-func (client GlobalClient) ListPremierAddOnOffers() (result ObjectSet, ae error) {
+func (client GlobalClient) ListPremierAddOnOffers() (result SetObject, err error) {
req, err := client.ListPremierAddOnOffersPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "ListPremierAddOnOffers", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "ListPremierAddOnOffers", nil, "Failure preparing request")
}
resp, err := client.ListPremierAddOnOffersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "ListPremierAddOnOffers", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "ListPremierAddOnOffers", resp, "Failure sending request")
}
result, err = client.ListPremierAddOnOffersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "ListPremierAddOnOffers", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "ListPremierAddOnOffers", resp, "Failure responding to request")
}
return
@@ -747,35 +735,34 @@
// ListPremierAddOnOffersPreparer prepares the ListPremierAddOnOffers request.
func (client GlobalClient) ListPremierAddOnOffersPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListPremierAddOnOffersSender sends the ListPremierAddOnOffers request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) ListPremierAddOnOffersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListPremierAddOnOffersResponder handles the response to the ListPremierAddOnOffers request. The method always
// closes the http.Response Body.
-func (client GlobalClient) ListPremierAddOnOffersResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client GlobalClient) ListPremierAddOnOffersResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -786,21 +773,21 @@
// publishing credentials request.
//
// requestMessage is requestMessage with new publishing credentials
-func (client GlobalClient) UpdateSubscriptionPublishingCredentials(requestMessage User) (result User, ae error) {
+func (client GlobalClient) UpdateSubscriptionPublishingCredentials(requestMessage User) (result User, err error) {
req, err := client.UpdateSubscriptionPublishingCredentialsPreparer(requestMessage)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "UpdateSubscriptionPublishingCredentials", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "UpdateSubscriptionPublishingCredentials", nil, "Failure preparing request")
}
resp, err := client.UpdateSubscriptionPublishingCredentialsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/GlobalClient", "UpdateSubscriptionPublishingCredentials", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalClient", "UpdateSubscriptionPublishingCredentials", resp, "Failure sending request")
}
result, err = client.UpdateSubscriptionPublishingCredentialsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalClient", "UpdateSubscriptionPublishingCredentials", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalClient", "UpdateSubscriptionPublishingCredentials", resp, "Failure responding to request")
}
return
@@ -809,27 +796,27 @@
// UpdateSubscriptionPublishingCredentialsPreparer prepares the UpdateSubscriptionPublishingCredentials request.
func (client GlobalClient) UpdateSubscriptionPublishingCredentialsPreparer(requestMessage User) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials", pathParameters),
autorest.WithJSON(requestMessage),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSubscriptionPublishingCredentialsSender sends the UpdateSubscriptionPublishingCredentials request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalClient) UpdateSubscriptionPublishingCredentialsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSubscriptionPublishingCredentialsResponder handles the response to the UpdateSubscriptionPublishingCredentials request. The method always
@@ -838,7 +825,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globalresourcegroups.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globalresourcegroups.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/globalresourcegroups.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/globalresourcegroups.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// GlobalResourceGroupsClient is the use these APIs to manage Azure Websites
@@ -50,21 +50,21 @@
// MoveResources sends the move resources request.
//
-func (client GlobalResourceGroupsClient) MoveResources(resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, ae error) {
+func (client GlobalResourceGroupsClient) MoveResources(resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) {
req, err := client.MoveResourcesPreparer(resourceGroupName, moveResourceEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/GlobalResourceGroupsClient", "MoveResources", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalResourceGroupsClient", "MoveResources", nil, "Failure preparing request")
}
resp, err := client.MoveResourcesSender(req)
if err != nil {
result.Response = resp
- return result, autorest.NewErrorWithError(err, "web/GlobalResourceGroupsClient", "MoveResources", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.GlobalResourceGroupsClient", "MoveResources", resp, "Failure sending request")
}
result, err = client.MoveResourcesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/GlobalResourceGroupsClient", "MoveResources", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.GlobalResourceGroupsClient", "MoveResources", resp, "Failure responding to request")
}
return
@@ -73,28 +73,28 @@
// MoveResourcesPreparer prepares the MoveResources request.
func (client GlobalResourceGroupsClient) MoveResourcesPreparer(resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters),
autorest.WithJSON(moveResourceEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// MoveResourcesSender sends the MoveResources request. The method will close the
// http.Response Body if it receives an error.
func (client GlobalResourceGroupsClient) MoveResourcesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNoContent)
+ return autorest.SendWithSender(client, req)
}
// MoveResourcesResponder handles the response to the MoveResources request. The method always
@@ -103,7 +103,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/hostingenvironments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/hostingenvironments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/hostingenvironments.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/hostingenvironments.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// HostingEnvironmentsClient is the use these APIs to manage Azure Websites
@@ -49,271 +49,284 @@
}
// CreateOrUpdateHostingEnvironment sends the create or update hosting
-// environment request.
+// environment request. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) hostingEnvironmentEnvelope is
// properties of hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironment(resourceGroupName string, name string, hostingEnvironmentEnvelope HostingEnvironment) (result HostingEnvironment, ae error) {
- req, err := client.CreateOrUpdateHostingEnvironmentPreparer(resourceGroupName, name, hostingEnvironmentEnvelope)
+func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironment(resourceGroupName string, name string, hostingEnvironmentEnvelope HostingEnvironment, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateHostingEnvironmentPreparer(resourceGroupName, name, hostingEnvironmentEnvelope, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateHostingEnvironment", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateHostingEnvironmentPreparer prepares the CreateOrUpdateHostingEnvironment request.
-func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironmentPreparer(resourceGroupName string, name string, hostingEnvironmentEnvelope HostingEnvironment) (*http.Request, error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironmentPreparer(resourceGroupName string, name string, hostingEnvironmentEnvelope HostingEnvironment, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters),
autorest.WithJSON(hostingEnvironmentEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateHostingEnvironmentSender sends the CreateOrUpdateHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateHostingEnvironmentResponder handles the response to the CreateOrUpdateHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironmentResponder(resp *http.Response) (result HostingEnvironment, err error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// CreateOrUpdateMultiRolePool sends the create or update multi role pool
-// request.
+// request. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) multiRolePoolEnvelope is
// properties of multiRole pool
-func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePool(resourceGroupName string, name string, multiRolePoolEnvelope WorkerPool) (result WorkerPool, ae error) {
- req, err := client.CreateOrUpdateMultiRolePoolPreparer(resourceGroupName, name, multiRolePoolEnvelope)
+func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePool(resourceGroupName string, name string, multiRolePoolEnvelope WorkerPool, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateMultiRolePoolPreparer(resourceGroupName, name, multiRolePoolEnvelope, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateMultiRolePoolSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateMultiRolePoolResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateMultiRolePool", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateMultiRolePoolPreparer prepares the CreateOrUpdateMultiRolePool request.
-func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePoolPreparer(resourceGroupName string, name string, multiRolePoolEnvelope WorkerPool) (*http.Request, error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePoolPreparer(resourceGroupName string, name string, multiRolePoolEnvelope WorkerPool, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters),
autorest.WithJSON(multiRolePoolEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateMultiRolePoolSender sends the CreateOrUpdateMultiRolePool request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePoolSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateMultiRolePoolResponder handles the response to the CreateOrUpdateMultiRolePool request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePoolResponder(resp *http.Response) (result WorkerPool, err error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateMultiRolePoolResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// CreateOrUpdateWorkerPool sends the create or update worker pool request.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool workerPoolEnvelope is properties of worker pool
-func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPool(resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPool) (result WorkerPool, ae error) {
- req, err := client.CreateOrUpdateWorkerPoolPreparer(resourceGroupName, name, workerPoolName, workerPoolEnvelope)
+func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPool(resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPool, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateWorkerPoolPreparer(resourceGroupName, name, workerPoolName, workerPoolEnvelope, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateWorkerPoolSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateWorkerPoolResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "CreateOrUpdateWorkerPool", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateWorkerPoolPreparer prepares the CreateOrUpdateWorkerPool request.
-func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPoolPreparer(resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPool) (*http.Request, error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPoolPreparer(resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPool, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters),
autorest.WithJSON(workerPoolEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateWorkerPoolSender sends the CreateOrUpdateWorkerPool request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPoolSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateWorkerPoolResponder handles the response to the CreateOrUpdateWorkerPool request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPoolResponder(resp *http.Response) (result WorkerPool, err error) {
+func (client HostingEnvironmentsClient) CreateOrUpdateWorkerPoolResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// DeleteHostingEnvironment sends the delete hosting environment request.
+// DeleteHostingEnvironment sends the delete hosting environment request. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) forceDelete is delete even if
// the hostingEnvironment (App Service Environment) contains resources
-func (client HostingEnvironmentsClient) DeleteHostingEnvironment(resourceGroupName string, name string, forceDelete *bool) (result ObjectSet, ae error) {
- req, err := client.DeleteHostingEnvironmentPreparer(resourceGroupName, name, forceDelete)
+func (client HostingEnvironmentsClient) DeleteHostingEnvironment(resourceGroupName string, name string, forceDelete *bool, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteHostingEnvironmentPreparer(resourceGroupName, name, forceDelete, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "DeleteHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "DeleteHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.DeleteHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "DeleteHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "DeleteHostingEnvironment", resp, "Failure sending request")
}
result, err = client.DeleteHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "DeleteHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "DeleteHostingEnvironment", resp, "Failure responding to request")
}
return
}
// DeleteHostingEnvironmentPreparer prepares the DeleteHostingEnvironment request.
-func (client HostingEnvironmentsClient) DeleteHostingEnvironmentPreparer(resourceGroupName string, name string, forceDelete *bool) (*http.Request, error) {
+func (client HostingEnvironmentsClient) DeleteHostingEnvironmentPreparer(resourceGroupName string, name string, forceDelete *bool, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if forceDelete != nil {
- queryParameters["forceDelete"] = forceDelete
+ queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteHostingEnvironmentSender sends the DeleteHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) DeleteHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteHostingEnvironmentResponder handles the response to the DeleteHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) DeleteHostingEnvironmentResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) DeleteHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -321,21 +334,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironment(resourceGroupName string, name string) (result HostingEnvironment, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironment(resourceGroupName string, name string) (result HostingEnvironment, err error) {
req, err := client.GetHostingEnvironmentPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironment", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironment", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironment", resp, "Failure responding to request")
}
return
@@ -344,28 +357,27 @@
// GetHostingEnvironmentPreparer prepares the GetHostingEnvironment request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentSender sends the GetHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentResponder handles the response to the GetHostingEnvironment request. The method always
@@ -374,7 +386,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -386,21 +398,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentCapacities(resourceGroupName string, name string) (result StampCapacityCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentCapacities(resourceGroupName string, name string) (result StampCapacityCollection, err error) {
req, err := client.GetHostingEnvironmentCapacitiesPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentCapacitiesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentCapacitiesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentCapacities", resp, "Failure responding to request")
}
return
@@ -409,28 +421,27 @@
// GetHostingEnvironmentCapacitiesPreparer prepares the GetHostingEnvironmentCapacities request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentCapacitiesPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentCapacitiesSender sends the GetHostingEnvironmentCapacities request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentCapacitiesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentCapacitiesResponder handles the response to the GetHostingEnvironmentCapacities request. The method always
@@ -439,7 +450,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -451,21 +462,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnostics(resourceGroupName string, name string) (result HostingEnvironmentDiagnosticsList, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnostics(resourceGroupName string, name string) (result ListHostingEnvironmentDiagnostics, err error) {
req, err := client.GetHostingEnvironmentDiagnosticsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentDiagnosticsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentDiagnosticsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnostics", resp, "Failure responding to request")
}
return
@@ -474,37 +485,36 @@
// GetHostingEnvironmentDiagnosticsPreparer prepares the GetHostingEnvironmentDiagnostics request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentDiagnosticsSender sends the GetHostingEnvironmentDiagnostics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentDiagnosticsResponder handles the response to the GetHostingEnvironmentDiagnostics request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsResponder(resp *http.Response) (result HostingEnvironmentDiagnosticsList, err error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsResponder(resp *http.Response) (result ListHostingEnvironmentDiagnostics, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -517,21 +527,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) diagnosticsName is name of
// the diagnostics
-func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsItem(resourceGroupName string, name string, diagnosticsName string) (result HostingEnvironmentDiagnostics, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsItem(resourceGroupName string, name string, diagnosticsName string) (result HostingEnvironmentDiagnostics, err error) {
req, err := client.GetHostingEnvironmentDiagnosticsItemPreparer(resourceGroupName, name, diagnosticsName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentDiagnosticsItemSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentDiagnosticsItemResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentDiagnosticsItem", resp, "Failure responding to request")
}
return
@@ -540,29 +550,28 @@
// GetHostingEnvironmentDiagnosticsItemPreparer prepares the GetHostingEnvironmentDiagnosticsItem request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsItemPreparer(resourceGroupName string, name string, diagnosticsName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "diagnosticsName": url.QueryEscape(diagnosticsName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "diagnosticsName": autorest.Encode("path", diagnosticsName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentDiagnosticsItemSender sends the GetHostingEnvironmentDiagnosticsItem request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentDiagnosticsItemSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentDiagnosticsItemResponder handles the response to the GetHostingEnvironmentDiagnosticsItem request. The method always
@@ -571,7 +580,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -583,21 +592,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricDefinitions(resourceGroupName string, name string) (result MetricDefinition, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricDefinitions(resourceGroupName string, name string) (result MetricDefinition, err error) {
req, err := client.GetHostingEnvironmentMetricDefinitionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -606,28 +615,27 @@
// GetHostingEnvironmentMetricDefinitionsPreparer prepares the GetHostingEnvironmentMetricDefinitions request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricDefinitionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentMetricDefinitionsSender sends the GetHostingEnvironmentMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentMetricDefinitionsResponder handles the response to the GetHostingEnvironmentMetricDefinitions request. The method always
@@ -636,7 +644,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -653,21 +661,21 @@
// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
// duration'[Hour|Minute|Day]'.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetHostingEnvironmentMetricsPreparer(resourceGroupName, name, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMetrics", resp, "Failure responding to request")
}
return
@@ -676,34 +684,33 @@
// GetHostingEnvironmentMetricsPreparer prepares the GetHostingEnvironmentMetrics request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricsPreparer(resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentMetricsSender sends the GetHostingEnvironmentMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentMetricsResponder handles the response to the GetHostingEnvironmentMetrics request. The method always
@@ -712,7 +719,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -724,21 +731,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricDefinitions(resourceGroupName string, name string) (result MetricDefinitionCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricDefinitions(resourceGroupName string, name string) (result MetricDefinitionCollection, err error) {
req, err := client.GetHostingEnvironmentMultiRoleMetricDefinitionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentMultiRoleMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentMultiRoleMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -747,28 +754,27 @@
// GetHostingEnvironmentMultiRoleMetricDefinitionsPreparer prepares the GetHostingEnvironmentMultiRoleMetricDefinitions request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricDefinitionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentMultiRoleMetricDefinitionsSender sends the GetHostingEnvironmentMultiRoleMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentMultiRoleMetricDefinitionsResponder handles the response to the GetHostingEnvironmentMultiRoleMetricDefinitions request. The method always
@@ -777,7 +783,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -795,21 +801,21 @@
// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq
// 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq
// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetrics(resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetrics(resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetHostingEnvironmentMultiRoleMetricsPreparer(resourceGroupName, name, startTime, endTime, timeGrain, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentMultiRoleMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentMultiRoleMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleMetrics", resp, "Failure responding to request")
}
return
@@ -818,43 +824,42 @@
// GetHostingEnvironmentMultiRoleMetricsPreparer prepares the GetHostingEnvironmentMultiRoleMetrics request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricsPreparer(resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(startTime) > 0 {
- queryParameters["startTime"] = startTime
+ queryParameters["startTime"] = autorest.Encode("query", startTime)
}
if len(endTime) > 0 {
- queryParameters["endTime"] = endTime
+ queryParameters["endTime"] = autorest.Encode("query", endTime)
}
if len(timeGrain) > 0 {
- queryParameters["timeGrain"] = timeGrain
+ queryParameters["timeGrain"] = autorest.Encode("query", timeGrain)
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentMultiRoleMetricsSender sends the GetHostingEnvironmentMultiRoleMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentMultiRoleMetricsResponder handles the response to the GetHostingEnvironmentMultiRoleMetrics request. The method always
@@ -863,7 +868,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -875,21 +880,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleUsages(resourceGroupName string, name string) (result UsageCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleUsages(resourceGroupName string, name string) (result UsageCollection, err error) {
req, err := client.GetHostingEnvironmentMultiRoleUsagesPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentMultiRoleUsagesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentMultiRoleUsagesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentMultiRoleUsages", resp, "Failure responding to request")
}
return
@@ -898,28 +903,27 @@
// GetHostingEnvironmentMultiRoleUsagesPreparer prepares the GetHostingEnvironmentMultiRoleUsages request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleUsagesPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentMultiRoleUsagesSender sends the GetHostingEnvironmentMultiRoleUsages request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentMultiRoleUsagesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentMultiRoleUsagesResponder handles the response to the GetHostingEnvironmentMultiRoleUsages request. The method always
@@ -928,7 +932,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -941,21 +945,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) operationID is operation
// identifier GUID
-func (client HostingEnvironmentsClient) GetHostingEnvironmentOperation(resourceGroupName string, name string, operationID string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentOperation(resourceGroupName string, name string, operationID string) (result SetObject, err error) {
req, err := client.GetHostingEnvironmentOperationPreparer(resourceGroupName, name, operationID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperation", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentOperationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperation", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentOperationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperation", resp, "Failure responding to request")
}
return
@@ -964,38 +968,37 @@
// GetHostingEnvironmentOperationPreparer prepares the GetHostingEnvironmentOperation request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentOperationSender sends the GetHostingEnvironmentOperation request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentOperationResponder handles the response to the GetHostingEnvironmentOperation request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1007,21 +1010,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentOperations(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentOperations(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.GetHostingEnvironmentOperationsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperations", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperations", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentOperationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperations", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperations", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentOperationsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentOperations", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentOperations", resp, "Failure responding to request")
}
return
@@ -1030,37 +1033,36 @@
// GetHostingEnvironmentOperationsPreparer prepares the GetHostingEnvironmentOperations request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentOperationsSender sends the GetHostingEnvironmentOperations request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentOperationsResponder handles the response to the GetHostingEnvironmentOperations request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentOperationsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1070,21 +1072,21 @@
// GetHostingEnvironments sends the get hosting environments request.
//
// resourceGroupName is name of resource group
-func (client HostingEnvironmentsClient) GetHostingEnvironments(resourceGroupName string) (result HostingEnvironmentCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironments(resourceGroupName string) (result HostingEnvironmentCollection, err error) {
req, err := client.GetHostingEnvironmentsPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironments", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironments", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironments", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironments", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironments", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironments", resp, "Failure responding to request")
}
return
@@ -1093,27 +1095,26 @@
// GetHostingEnvironmentsPreparer prepares the GetHostingEnvironments request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentsPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentsSender sends the GetHostingEnvironments request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentsResponder handles the response to the GetHostingEnvironments request. The method always
@@ -1122,7 +1123,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1134,21 +1135,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentServerFarms(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentServerFarms(resourceGroupName string, name string) (result ServerFarmCollection, err error) {
req, err := client.GetHostingEnvironmentServerFarmsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentServerFarmsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentServerFarmsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentServerFarms", resp, "Failure responding to request")
}
return
@@ -1157,28 +1158,27 @@
// GetHostingEnvironmentServerFarmsPreparer prepares the GetHostingEnvironmentServerFarms request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentServerFarmsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentServerFarmsSender sends the GetHostingEnvironmentServerFarms request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentServerFarmsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentServerFarmsResponder handles the response to the GetHostingEnvironmentServerFarms request. The method always
@@ -1187,7 +1187,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1199,21 +1199,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) propertiesToInclude is comma
// separated list of site properties to include
-func (client HostingEnvironmentsClient) GetHostingEnvironmentSites(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentSites(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, err error) {
req, err := client.GetHostingEnvironmentSitesPreparer(resourceGroupName, name, propertiesToInclude)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentSites", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentSites", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentSites", resp, "Failure responding to request")
}
return
@@ -1222,31 +1222,30 @@
// GetHostingEnvironmentSitesPreparer prepares the GetHostingEnvironmentSites request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentSitesPreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentSitesSender sends the GetHostingEnvironmentSites request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentSitesResponder handles the response to the GetHostingEnvironmentSites request. The method always
@@ -1255,7 +1254,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1271,21 +1270,21 @@
// Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and
// startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z'
// and timeGrain eq duration'[Hour|Minute|Day]'.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentUsages(resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentUsages(resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollection, err error) {
req, err := client.GetHostingEnvironmentUsagesPreparer(resourceGroupName, name, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentUsages", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentUsages", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentUsagesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentUsages", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentUsages", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentUsagesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentUsages", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentUsages", resp, "Failure responding to request")
}
return
@@ -1294,31 +1293,30 @@
// GetHostingEnvironmentUsagesPreparer prepares the GetHostingEnvironmentUsages request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentUsagesPreparer(resourceGroupName string, name string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentUsagesSender sends the GetHostingEnvironmentUsages request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentUsagesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentUsagesResponder handles the response to the GetHostingEnvironmentUsages request. The method always
@@ -1327,7 +1325,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1338,21 +1336,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentVips(resourceGroupName string, name string) (result AddressResponse, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentVips(resourceGroupName string, name string) (result AddressResponse, err error) {
req, err := client.GetHostingEnvironmentVipsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentVips", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentVips", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentVipsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentVips", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentVips", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentVipsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentVips", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentVips", resp, "Failure responding to request")
}
return
@@ -1361,28 +1359,27 @@
// GetHostingEnvironmentVipsPreparer prepares the GetHostingEnvironmentVips request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentVipsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentVipsSender sends the GetHostingEnvironmentVips request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentVipsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentVipsResponder handles the response to the GetHostingEnvironmentVips request. The method always
@@ -1391,7 +1388,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1403,21 +1400,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetHostingEnvironmentWebHostingPlans(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentWebHostingPlans(resourceGroupName string, name string) (result ServerFarmCollection, err error) {
req, err := client.GetHostingEnvironmentWebHostingPlansPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentWebHostingPlansSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentWebHostingPlansResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebHostingPlans", resp, "Failure responding to request")
}
return
@@ -1426,28 +1423,27 @@
// GetHostingEnvironmentWebHostingPlansPreparer prepares the GetHostingEnvironmentWebHostingPlans request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebHostingPlansPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/webhostingplans"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/webhostingplans", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentWebHostingPlansSender sends the GetHostingEnvironmentWebHostingPlans request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebHostingPlansSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentWebHostingPlansResponder handles the response to the GetHostingEnvironmentWebHostingPlans request. The method always
@@ -1456,7 +1452,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1469,21 +1465,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool
-func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricDefinitions(resourceGroupName string, name string, workerPoolName string) (result MetricDefinitionCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricDefinitions(resourceGroupName string, name string, workerPoolName string) (result MetricDefinitionCollection, err error) {
req, err := client.GetHostingEnvironmentWebWorkerMetricDefinitionsPreparer(resourceGroupName, name, workerPoolName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentWebWorkerMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentWebWorkerMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -1492,29 +1488,28 @@
// GetHostingEnvironmentWebWorkerMetricDefinitionsPreparer prepares the GetHostingEnvironmentWebWorkerMetricDefinitions request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricDefinitionsPreparer(resourceGroupName string, name string, workerPoolName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentWebWorkerMetricDefinitionsSender sends the GetHostingEnvironmentWebWorkerMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentWebWorkerMetricDefinitionsResponder handles the response to the GetHostingEnvironmentWebWorkerMetricDefinitions request. The method always
@@ -1523,7 +1518,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1540,21 +1535,21 @@
// Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and
// startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z'
// and timeGrain eq duration'[Hour|Minute|Day]'.
-func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetrics(resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetrics(resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetHostingEnvironmentWebWorkerMetricsPreparer(resourceGroupName, name, workerPoolName, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentWebWorkerMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentWebWorkerMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerMetrics", resp, "Failure responding to request")
}
return
@@ -1563,35 +1558,34 @@
// GetHostingEnvironmentWebWorkerMetricsPreparer prepares the GetHostingEnvironmentWebWorkerMetrics request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricsPreparer(resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentWebWorkerMetricsSender sends the GetHostingEnvironmentWebWorkerMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentWebWorkerMetricsResponder handles the response to the GetHostingEnvironmentWebWorkerMetrics request. The method always
@@ -1600,7 +1594,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1613,21 +1607,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool
-func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerUsages(resourceGroupName string, name string, workerPoolName string) (result UsageCollection, ae error) {
+func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerUsages(resourceGroupName string, name string, workerPoolName string) (result UsageCollection, err error) {
req, err := client.GetHostingEnvironmentWebWorkerUsagesPreparer(resourceGroupName, name, workerPoolName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", nil, "Failure preparing request")
}
resp, err := client.GetHostingEnvironmentWebWorkerUsagesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", resp, "Failure sending request")
}
result, err = client.GetHostingEnvironmentWebWorkerUsagesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetHostingEnvironmentWebWorkerUsages", resp, "Failure responding to request")
}
return
@@ -1636,29 +1630,28 @@
// GetHostingEnvironmentWebWorkerUsagesPreparer prepares the GetHostingEnvironmentWebWorkerUsages request.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerUsagesPreparer(resourceGroupName string, name string, workerPoolName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetHostingEnvironmentWebWorkerUsagesSender sends the GetHostingEnvironmentWebWorkerUsages request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetHostingEnvironmentWebWorkerUsagesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetHostingEnvironmentWebWorkerUsagesResponder handles the response to the GetHostingEnvironmentWebWorkerUsages request. The method always
@@ -1667,7 +1660,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1678,21 +1671,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetMultiRolePool(resourceGroupName string, name string) (result WorkerPool, ae error) {
+func (client HostingEnvironmentsClient) GetMultiRolePool(resourceGroupName string, name string) (result WorkerPool, err error) {
req, err := client.GetMultiRolePoolPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePool", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePool", nil, "Failure preparing request")
}
resp, err := client.GetMultiRolePoolSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePool", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePool", resp, "Failure sending request")
}
result, err = client.GetMultiRolePoolResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePool", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePool", resp, "Failure responding to request")
}
return
@@ -1701,28 +1694,27 @@
// GetMultiRolePoolPreparer prepares the GetMultiRolePool request.
func (client HostingEnvironmentsClient) GetMultiRolePoolPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetMultiRolePoolSender sends the GetMultiRolePool request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetMultiRolePoolSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetMultiRolePoolResponder handles the response to the GetMultiRolePool request. The method always
@@ -1731,7 +1723,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1744,21 +1736,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) instance is name of instance
// in the multiRole pool>
-func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitions(resourceGroupName string, name string, instance string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitions(resourceGroupName string, name string, instance string) (result SetObject, err error) {
req, err := client.GetMultiRolePoolInstanceMetricDefinitionsPreparer(resourceGroupName, name, instance)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetMultiRolePoolInstanceMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetMultiRolePoolInstanceMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -1767,38 +1759,37 @@
// GetMultiRolePoolInstanceMetricDefinitionsPreparer prepares the GetMultiRolePoolInstanceMetricDefinitions request.
func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitionsPreparer(resourceGroupName string, name string, instance string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instance": url.QueryEscape(instance),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "instance": autorest.Encode("path", instance),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetMultiRolePoolInstanceMetricDefinitionsSender sends the GetMultiRolePoolInstanceMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetMultiRolePoolInstanceMetricDefinitionsResponder handles the response to the GetMultiRolePoolInstanceMetricDefinitions request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricDefinitionsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1811,21 +1802,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) instance is name of instance
// in the multiRole pool details is include instance details
-func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetrics(resourceGroupName string, name string, instance string, details *bool) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetrics(resourceGroupName string, name string, instance string, details *bool) (result SetObject, err error) {
req, err := client.GetMultiRolePoolInstanceMetricsPreparer(resourceGroupName, name, instance, details)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", nil, "Failure preparing request")
}
resp, err := client.GetMultiRolePoolInstanceMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", resp, "Failure sending request")
}
result, err = client.GetMultiRolePoolInstanceMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolInstanceMetrics", resp, "Failure responding to request")
}
return
@@ -1834,41 +1825,40 @@
// GetMultiRolePoolInstanceMetricsPreparer prepares the GetMultiRolePoolInstanceMetrics request.
func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricsPreparer(resourceGroupName string, name string, instance string, details *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instance": url.QueryEscape(instance),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "instance": autorest.Encode("path", instance),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetMultiRolePoolInstanceMetricsSender sends the GetMultiRolePoolInstanceMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetMultiRolePoolInstanceMetricsResponder handles the response to the GetMultiRolePoolInstanceMetrics request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetMultiRolePoolInstanceMetricsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1879,21 +1869,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetMultiRolePools(resourceGroupName string, name string) (result WorkerPoolCollection, ae error) {
+func (client HostingEnvironmentsClient) GetMultiRolePools(resourceGroupName string, name string) (result WorkerPoolCollection, err error) {
req, err := client.GetMultiRolePoolsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePools", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePools", nil, "Failure preparing request")
}
resp, err := client.GetMultiRolePoolsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePools", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePools", resp, "Failure sending request")
}
result, err = client.GetMultiRolePoolsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePools", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePools", resp, "Failure responding to request")
}
return
@@ -1902,28 +1892,27 @@
// GetMultiRolePoolsPreparer prepares the GetMultiRolePools request.
func (client HostingEnvironmentsClient) GetMultiRolePoolsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetMultiRolePoolsSender sends the GetMultiRolePools request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetMultiRolePoolsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetMultiRolePoolsResponder handles the response to the GetMultiRolePools request. The method always
@@ -1932,7 +1921,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1943,21 +1932,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetMultiRolePoolSkus(resourceGroupName string, name string) (result SkuInfoCollection, ae error) {
+func (client HostingEnvironmentsClient) GetMultiRolePoolSkus(resourceGroupName string, name string) (result SkuInfoCollection, err error) {
req, err := client.GetMultiRolePoolSkusPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolSkus", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolSkus", nil, "Failure preparing request")
}
resp, err := client.GetMultiRolePoolSkusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolSkus", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolSkus", resp, "Failure sending request")
}
result, err = client.GetMultiRolePoolSkusResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetMultiRolePoolSkus", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetMultiRolePoolSkus", resp, "Failure responding to request")
}
return
@@ -1966,28 +1955,27 @@
// GetMultiRolePoolSkusPreparer prepares the GetMultiRolePoolSkus request.
func (client HostingEnvironmentsClient) GetMultiRolePoolSkusPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetMultiRolePoolSkusSender sends the GetMultiRolePoolSkus request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetMultiRolePoolSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetMultiRolePoolSkusResponder handles the response to the GetMultiRolePoolSkus request. The method always
@@ -1996,7 +1984,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2008,21 +1996,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool
-func (client HostingEnvironmentsClient) GetWorkerPool(resourceGroupName string, name string, workerPoolName string) (result WorkerPool, ae error) {
+func (client HostingEnvironmentsClient) GetWorkerPool(resourceGroupName string, name string, workerPoolName string) (result WorkerPool, err error) {
req, err := client.GetWorkerPoolPreparer(resourceGroupName, name, workerPoolName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPool", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPool", nil, "Failure preparing request")
}
resp, err := client.GetWorkerPoolSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPool", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPool", resp, "Failure sending request")
}
result, err = client.GetWorkerPoolResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPool", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPool", resp, "Failure responding to request")
}
return
@@ -2031,29 +2019,28 @@
// GetWorkerPoolPreparer prepares the GetWorkerPool request.
func (client HostingEnvironmentsClient) GetWorkerPoolPreparer(resourceGroupName string, name string, workerPoolName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetWorkerPoolSender sends the GetWorkerPool request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetWorkerPoolSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetWorkerPoolResponder handles the response to the GetWorkerPool request. The method always
@@ -2062,7 +2049,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2075,21 +2062,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool instance is name of instance in the worker pool
-func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitions(resourceGroupName string, name string, workerPoolName string, instance string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitions(resourceGroupName string, name string, workerPoolName string, instance string) (result SetObject, err error) {
req, err := client.GetWorkerPoolInstanceMetricDefinitionsPreparer(resourceGroupName, name, workerPoolName, instance)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetWorkerPoolInstanceMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetWorkerPoolInstanceMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -2098,39 +2085,38 @@
// GetWorkerPoolInstanceMetricDefinitionsPreparer prepares the GetWorkerPoolInstanceMetricDefinitions request.
func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitionsPreparer(resourceGroupName string, name string, workerPoolName string, instance string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instance": url.QueryEscape(instance),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "instance": autorest.Encode("path", instance),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetWorkerPoolInstanceMetricDefinitionsSender sends the GetWorkerPoolInstanceMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetWorkerPoolInstanceMetricDefinitionsResponder handles the response to the GetWorkerPoolInstanceMetricDefinitions request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricDefinitionsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2148,21 +2134,21 @@
// eq 'Metric1' or name.value eq 'Metric2') and startTime eq
// '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain
// eq duration'[Hour|Minute|Day]'.
-func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetrics(resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetrics(resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result SetObject, err error) {
req, err := client.GetWorkerPoolInstanceMetricsPreparer(resourceGroupName, name, workerPoolName, instance, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", nil, "Failure preparing request")
}
resp, err := client.GetWorkerPoolInstanceMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", resp, "Failure sending request")
}
result, err = client.GetWorkerPoolInstanceMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolInstanceMetrics", resp, "Failure responding to request")
}
return
@@ -2171,45 +2157,44 @@
// GetWorkerPoolInstanceMetricsPreparer prepares the GetWorkerPoolInstanceMetrics request.
func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricsPreparer(resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "instance": url.QueryEscape(instance),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "instance": autorest.Encode("path", instance),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetWorkerPoolInstanceMetricsSender sends the GetWorkerPoolInstanceMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetWorkerPoolInstanceMetricsResponder handles the response to the GetWorkerPoolInstanceMetrics request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) GetWorkerPoolInstanceMetricsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2220,21 +2205,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) GetWorkerPools(resourceGroupName string, name string) (result WorkerPoolCollection, ae error) {
+func (client HostingEnvironmentsClient) GetWorkerPools(resourceGroupName string, name string) (result WorkerPoolCollection, err error) {
req, err := client.GetWorkerPoolsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPools", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPools", nil, "Failure preparing request")
}
resp, err := client.GetWorkerPoolsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPools", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPools", resp, "Failure sending request")
}
result, err = client.GetWorkerPoolsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPools", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPools", resp, "Failure responding to request")
}
return
@@ -2243,28 +2228,27 @@
// GetWorkerPoolsPreparer prepares the GetWorkerPools request.
func (client HostingEnvironmentsClient) GetWorkerPoolsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetWorkerPoolsSender sends the GetWorkerPools request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetWorkerPoolsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetWorkerPoolsResponder handles the response to the GetWorkerPools request. The method always
@@ -2273,7 +2257,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2285,21 +2269,21 @@
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment) workerPoolName is name of
// worker pool
-func (client HostingEnvironmentsClient) GetWorkerPoolSkus(resourceGroupName string, name string, workerPoolName string) (result SkuInfoCollection, ae error) {
+func (client HostingEnvironmentsClient) GetWorkerPoolSkus(resourceGroupName string, name string, workerPoolName string) (result SkuInfoCollection, err error) {
req, err := client.GetWorkerPoolSkusPreparer(resourceGroupName, name, workerPoolName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolSkus", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolSkus", nil, "Failure preparing request")
}
resp, err := client.GetWorkerPoolSkusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolSkus", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolSkus", resp, "Failure sending request")
}
result, err = client.GetWorkerPoolSkusResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "GetWorkerPoolSkus", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "GetWorkerPoolSkus", resp, "Failure responding to request")
}
return
@@ -2308,29 +2292,28 @@
// GetWorkerPoolSkusPreparer prepares the GetWorkerPoolSkus request.
func (client HostingEnvironmentsClient) GetWorkerPoolSkusPreparer(resourceGroupName string, name string, workerPoolName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerPoolName": url.QueryEscape(workerPoolName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerPoolName": autorest.Encode("path", workerPoolName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetWorkerPoolSkusSender sends the GetWorkerPoolSkus request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) GetWorkerPoolSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetWorkerPoolSkusResponder handles the response to the GetWorkerPoolSkus request. The method always
@@ -2339,7 +2322,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2350,21 +2333,21 @@
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) RebootHostingEnvironment(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client HostingEnvironmentsClient) RebootHostingEnvironment(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.RebootHostingEnvironmentPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "RebootHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "RebootHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.RebootHostingEnvironmentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "RebootHostingEnvironment", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "RebootHostingEnvironment", resp, "Failure sending request")
}
result, err = client.RebootHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "RebootHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "RebootHostingEnvironment", resp, "Failure responding to request")
}
return
@@ -2373,167 +2356,172 @@
// RebootHostingEnvironmentPreparer prepares the RebootHostingEnvironment request.
func (client HostingEnvironmentsClient) RebootHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RebootHostingEnvironmentSender sends the RebootHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) RebootHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client, req)
}
// RebootHostingEnvironmentResponder handles the response to the RebootHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) RebootHostingEnvironmentResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client HostingEnvironmentsClient) RebootHostingEnvironmentResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ResumeHostingEnvironment sends the resume hosting environment request.
+// ResumeHostingEnvironment sends the resume hosting environment request. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) ResumeHostingEnvironment(resourceGroupName string, name string) (result SiteCollection, ae error) {
- req, err := client.ResumeHostingEnvironmentPreparer(resourceGroupName, name)
+func (client HostingEnvironmentsClient) ResumeHostingEnvironment(resourceGroupName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ResumeHostingEnvironmentPreparer(resourceGroupName, name, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "ResumeHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "ResumeHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.ResumeHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "ResumeHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "ResumeHostingEnvironment", resp, "Failure sending request")
}
result, err = client.ResumeHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "ResumeHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "ResumeHostingEnvironment", resp, "Failure responding to request")
}
return
}
// ResumeHostingEnvironmentPreparer prepares the ResumeHostingEnvironment request.
-func (client HostingEnvironmentsClient) ResumeHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
+func (client HostingEnvironmentsClient) ResumeHostingEnvironmentPreparer(resourceGroupName string, name string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ResumeHostingEnvironmentSender sends the ResumeHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) ResumeHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ResumeHostingEnvironmentResponder handles the response to the ResumeHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) ResumeHostingEnvironmentResponder(resp *http.Response) (result SiteCollection, err error) {
+func (client HostingEnvironmentsClient) ResumeHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// SuspendHostingEnvironment sends the suspend hosting environment request.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of
// hostingEnvironment (App Service Environment)
-func (client HostingEnvironmentsClient) SuspendHostingEnvironment(resourceGroupName string, name string) (result SiteCollection, ae error) {
- req, err := client.SuspendHostingEnvironmentPreparer(resourceGroupName, name)
+func (client HostingEnvironmentsClient) SuspendHostingEnvironment(resourceGroupName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.SuspendHostingEnvironmentPreparer(resourceGroupName, name, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "SuspendHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "SuspendHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.SuspendHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "SuspendHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "SuspendHostingEnvironment", resp, "Failure sending request")
}
result, err = client.SuspendHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/HostingEnvironmentsClient", "SuspendHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.HostingEnvironmentsClient", "SuspendHostingEnvironment", resp, "Failure responding to request")
}
return
}
// SuspendHostingEnvironmentPreparer prepares the SuspendHostingEnvironment request.
-func (client HostingEnvironmentsClient) SuspendHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
+func (client HostingEnvironmentsClient) SuspendHostingEnvironmentPreparer(resourceGroupName string, name string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// SuspendHostingEnvironmentSender sends the SuspendHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client HostingEnvironmentsClient) SuspendHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// SuspendHostingEnvironmentResponder handles the response to the SuspendHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client HostingEnvironmentsClient) SuspendHostingEnvironmentResponder(resp *http.Response) (result SiteCollection, err error) {
+func (client HostingEnvironmentsClient) SuspendHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/managedhostingenvironments.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/managedhostingenvironments.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/managedhostingenvironments.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/managedhostingenvironments.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// ManagedHostingEnvironmentsClient is the use these APIs to manage Azure
@@ -49,138 +49,143 @@
}
// CreateOrUpdateManagedHostingEnvironment sends the create or update managed
-// hosting environment request.
+// hosting environment request. This method may poll for completion. Polling
+// can be canceled by passing the cancel channel argument. The channel will
+// be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment managedHostingEnvironmentEnvelope is properties of managed
// hosting environment
-func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironment(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment) (result HostingEnvironment, ae error) {
- req, err := client.CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName, name, managedHostingEnvironmentEnvelope)
+func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironment(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName, name, managedHostingEnvironmentEnvelope, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateManagedHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateManagedHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateManagedHostingEnvironmentPreparer prepares the CreateOrUpdateManagedHostingEnvironment request.
-func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment) (*http.Request, error) {
+func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}", pathParameters),
autorest.WithJSON(managedHostingEnvironmentEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateManagedHostingEnvironmentSender sends the CreateOrUpdateManagedHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateManagedHostingEnvironmentResponder handles the response to the CreateOrUpdateManagedHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentResponder(resp *http.Response) (result HostingEnvironment, err error) {
+func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// DeleteManagedHostingEnvironment sends the delete managed hosting
-// environment request.
+// environment request. This method may poll for completion. Polling can be
+// canceled by passing the cancel channel argument. The channel will be used
+// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment forceDelete is delete even if the managed hosting environment
// contains resources
-func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironment(resourceGroupName string, name string, forceDelete *bool) (result ObjectSet, ae error) {
- req, err := client.DeleteManagedHostingEnvironmentPreparer(resourceGroupName, name, forceDelete)
+func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironment(resourceGroupName string, name string, forceDelete *bool, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.DeleteManagedHostingEnvironmentPreparer(resourceGroupName, name, forceDelete, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.DeleteManagedHostingEnvironmentSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", resp, "Failure sending request")
}
result, err = client.DeleteManagedHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", resp, "Failure responding to request")
}
return
}
// DeleteManagedHostingEnvironmentPreparer prepares the DeleteManagedHostingEnvironment request.
-func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentPreparer(resourceGroupName string, name string, forceDelete *bool) (*http.Request, error) {
+func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentPreparer(resourceGroupName string, name string, forceDelete *bool, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if forceDelete != nil {
- queryParameters["forceDelete"] = forceDelete
+ queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteManagedHostingEnvironmentSender sends the DeleteManagedHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteManagedHostingEnvironmentResponder handles the response to the DeleteManagedHostingEnvironment request. The method always
// closes the http.Response Body.
-func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -189,21 +194,21 @@
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironment(resourceGroupName string, name string) (result ManagedHostingEnvironment, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironment(resourceGroupName string, name string) (result ManagedHostingEnvironment, err error) {
req, err := client.GetManagedHostingEnvironmentPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", resp, "Failure responding to request")
}
return
@@ -212,28 +217,27 @@
// GetManagedHostingEnvironmentPreparer prepares the GetManagedHostingEnvironment request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentSender sends the GetManagedHostingEnvironment request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentResponder handles the response to the GetManagedHostingEnvironment request. The method always
@@ -242,7 +246,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -254,21 +258,21 @@
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment operationID is operation identifier GUID
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperation(resourceGroupName string, name string, operationID string) (result ObjectSet, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperation(resourceGroupName string, name string, operationID string) (result SetObject, err error) {
req, err := client.GetManagedHostingEnvironmentOperationPreparer(resourceGroupName, name, operationID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentOperationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentOperationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", resp, "Failure responding to request")
}
return
@@ -277,38 +281,37 @@
// GetManagedHostingEnvironmentOperationPreparer prepares the GetManagedHostingEnvironmentOperation request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/operations/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/operations/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentOperationSender sends the GetManagedHostingEnvironmentOperation request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentOperationResponder handles the response to the GetManagedHostingEnvironmentOperation request. The method always
// closes the http.Response Body.
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -319,21 +322,21 @@
// request.
//
// resourceGroupName is name of resource group
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironments(resourceGroupName string) (result HostingEnvironmentCollection, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironments(resourceGroupName string) (result HostingEnvironmentCollection, err error) {
req, err := client.GetManagedHostingEnvironmentsPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", resp, "Failure responding to request")
}
return
@@ -342,27 +345,26 @@
// GetManagedHostingEnvironmentsPreparer prepares the GetManagedHostingEnvironments request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentsPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentsSender sends the GetManagedHostingEnvironments request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentsResponder handles the response to the GetManagedHostingEnvironments request. The method always
@@ -371,7 +373,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -383,21 +385,21 @@
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarms(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarms(resourceGroupName string, name string) (result ServerFarmCollection, err error) {
req, err := client.GetManagedHostingEnvironmentServerFarmsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentServerFarmsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentServerFarmsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", resp, "Failure responding to request")
}
return
@@ -406,28 +408,27 @@
// GetManagedHostingEnvironmentServerFarmsPreparer prepares the GetManagedHostingEnvironmentServerFarms request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarmsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/serverfarms"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/serverfarms", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentServerFarmsSender sends the GetManagedHostingEnvironmentServerFarms request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarmsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentServerFarmsResponder handles the response to the GetManagedHostingEnvironmentServerFarms request. The method always
@@ -436,7 +437,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -449,21 +450,21 @@
// resourceGroupName is name of resource group name is name of managed hosting
// environment propertiesToInclude is comma separated list of site properties
// to include
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSites(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSites(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, err error) {
req, err := client.GetManagedHostingEnvironmentSitesPreparer(resourceGroupName, name, propertiesToInclude)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", resp, "Failure responding to request")
}
return
@@ -472,31 +473,30 @@
// GetManagedHostingEnvironmentSitesPreparer prepares the GetManagedHostingEnvironmentSites request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSitesPreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/sites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/sites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentSitesSender sends the GetManagedHostingEnvironmentSites request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentSitesResponder handles the response to the GetManagedHostingEnvironmentSites request. The method always
@@ -505,7 +505,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -517,21 +517,21 @@
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVips(resourceGroupName string, name string) (result AddressResponse, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVips(resourceGroupName string, name string) (result AddressResponse, err error) {
req, err := client.GetManagedHostingEnvironmentVipsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentVipsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentVipsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", resp, "Failure responding to request")
}
return
@@ -540,28 +540,27 @@
// GetManagedHostingEnvironmentVipsPreparer prepares the GetManagedHostingEnvironmentVips request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVipsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/capacities/virtualip"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/capacities/virtualip", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentVipsSender sends the GetManagedHostingEnvironmentVips request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVipsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentVipsResponder handles the response to the GetManagedHostingEnvironmentVips request. The method always
@@ -570,7 +569,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -582,21 +581,21 @@
//
// resourceGroupName is name of resource group name is name of managed hosting
// environment
-func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlans(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
+func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlans(resourceGroupName string, name string) (result ServerFarmCollection, err error) {
req, err := client.GetManagedHostingEnvironmentWebHostingPlansPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", nil, "Failure preparing request")
}
resp, err := client.GetManagedHostingEnvironmentWebHostingPlansSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", resp, "Failure sending request")
}
result, err = client.GetManagedHostingEnvironmentWebHostingPlansResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", resp, "Failure responding to request")
}
return
@@ -605,28 +604,27 @@
// GetManagedHostingEnvironmentWebHostingPlansPreparer prepares the GetManagedHostingEnvironmentWebHostingPlans request.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlansPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/webhostingplans"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/webhostingplans", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetManagedHostingEnvironmentWebHostingPlansSender sends the GetManagedHostingEnvironmentWebHostingPlans request. The method will close the
// http.Response Body if it receives an error.
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlansSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetManagedHostingEnvironmentWebHostingPlansResponder handles the response to the GetManagedHostingEnvironmentWebHostingPlans request. The method always
@@ -635,7 +633,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/models.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/models.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/models.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/models.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "io"
"net/http"
)
@@ -123,14 +124,37 @@
Twitter BuiltInAuthenticationProvider = "Twitter"
)
-// CertificateAction enumerates the values for certificate action.
-type CertificateAction string
-
-const (
- // Rekey specifies the rekey state for certificate action.
- Rekey CertificateAction = "Rekey"
- // Renew specifies the renew state for certificate action.
- Renew CertificateAction = "Renew"
+// CertificateOrderActionType enumerates the values for certificate order
+// action type.
+type CertificateOrderActionType string
+
+const (
+ // CertificateIssued specifies the certificate issued state for
+ // certificate order action type.
+ CertificateIssued CertificateOrderActionType = "CertificateIssued"
+ // CertificateOrderCanceled specifies the certificate order canceled state
+ // for certificate order action type.
+ CertificateOrderCanceled CertificateOrderActionType = "CertificateOrderCanceled"
+ // CertificateOrderCreated specifies the certificate order created state
+ // for certificate order action type.
+ CertificateOrderCreated CertificateOrderActionType = "CertificateOrderCreated"
+ // CertificateRevoked specifies the certificate revoked state for
+ // certificate order action type.
+ CertificateRevoked CertificateOrderActionType = "CertificateRevoked"
+ // DomainValidationComplete specifies the domain validation complete state
+ // for certificate order action type.
+ DomainValidationComplete CertificateOrderActionType = "DomainValidationComplete"
+ // FraudDetected specifies the fraud detected state for certificate order
+ // action type.
+ FraudDetected CertificateOrderActionType = "FraudDetected"
+ // OrgNameChange specifies the org name change state for certificate order
+ // action type.
+ OrgNameChange CertificateOrderActionType = "OrgNameChange"
+ // OrgValidationComplete specifies the org validation complete state for
+ // certificate order action type.
+ OrgValidationComplete CertificateOrderActionType = "OrgValidationComplete"
+ // SanDrop specifies the san drop state for certificate order action type.
+ SanDrop CertificateOrderActionType = "SanDrop"
)
// CertificateOrderStatus enumerates the values for certificate order status.
@@ -175,12 +199,41 @@
StandardDomainValidatedWildCardSsl CertificateProductType = "StandardDomainValidatedWildCardSsl"
)
+// Channels enumerates the values for channels.
+type Channels string
+
+const (
+ // All specifies the all state for channels.
+ All Channels = "All"
+ // API specifies the api state for channels.
+ API Channels = "Api"
+ // Email specifies the email state for channels.
+ Email Channels = "Email"
+ // Notification specifies the notification state for channels.
+ Notification Channels = "Notification"
+)
+
+// CloneAbilityResult enumerates the values for clone ability result.
+type CloneAbilityResult string
+
+const (
+ // Cloneable specifies the cloneable state for clone ability result.
+ Cloneable CloneAbilityResult = "Cloneable"
+ // NotCloneable specifies the not cloneable state for clone ability result.
+ NotCloneable CloneAbilityResult = "NotCloneable"
+ // PartiallyCloneable specifies the partially cloneable state for clone
+ // ability result.
+ PartiallyCloneable CloneAbilityResult = "PartiallyCloneable"
+)
+
// ComputeModeOptions enumerates the values for compute mode options.
type ComputeModeOptions string
const (
// Dedicated specifies the dedicated state for compute mode options.
Dedicated ComputeModeOptions = "Dedicated"
+ // Dynamic specifies the dynamic state for compute mode options.
+ Dynamic ComputeModeOptions = "Dynamic"
// Shared specifies the shared state for compute mode options.
Shared ComputeModeOptions = "Shared"
)
@@ -423,6 +476,45 @@
Integrated ManagedPipelineMode = "Integrated"
)
+// NotificationLevel enumerates the values for notification level.
+type NotificationLevel string
+
+const (
+ // NotificationLevelCritical specifies the notification level critical
+ // state for notification level.
+ NotificationLevelCritical NotificationLevel = "Critical"
+ // NotificationLevelInformation specifies the notification level
+ // information state for notification level.
+ NotificationLevelInformation NotificationLevel = "Information"
+ // NotificationLevelNonUrgentSuggestion specifies the notification level
+ // non urgent suggestion state for notification level.
+ NotificationLevelNonUrgentSuggestion NotificationLevel = "NonUrgentSuggestion"
+ // NotificationLevelWarning specifies the notification level warning state
+ // for notification level.
+ NotificationLevelWarning NotificationLevel = "Warning"
+)
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // ProvisioningStateCanceled specifies the provisioning state canceled
+ // state for provisioning state.
+ ProvisioningStateCanceled ProvisioningState = "Canceled"
+ // ProvisioningStateDeleting specifies the provisioning state deleting
+ // state for provisioning state.
+ ProvisioningStateDeleting ProvisioningState = "Deleting"
+ // ProvisioningStateFailed specifies the provisioning state failed state
+ // for provisioning state.
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ // ProvisioningStateInProgress specifies the provisioning state in
+ // progress state for provisioning state.
+ ProvisioningStateInProgress ProvisioningState = "InProgress"
+ // ProvisioningStateSucceeded specifies the provisioning state succeeded
+ // state for provisioning state.
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+)
+
// SiteAvailabilityState enumerates the values for site availability state.
type SiteAvailabilityState string
@@ -508,12 +600,18 @@
type WorkerSizeOptions string
const (
- // Large specifies the large state for worker size options.
- Large WorkerSizeOptions = "Large"
- // Medium specifies the medium state for worker size options.
- Medium WorkerSizeOptions = "Medium"
- // Small specifies the small state for worker size options.
- Small WorkerSizeOptions = "Small"
+ // WorkerSizeOptionsDefault specifies the worker size options default
+ // state for worker size options.
+ WorkerSizeOptionsDefault WorkerSizeOptions = "Default"
+ // WorkerSizeOptionsLarge specifies the worker size options large state
+ // for worker size options.
+ WorkerSizeOptionsLarge WorkerSizeOptions = "Large"
+ // WorkerSizeOptionsMedium specifies the worker size options medium state
+ // for worker size options.
+ WorkerSizeOptionsMedium WorkerSizeOptions = "Medium"
+ // WorkerSizeOptionsSmall specifies the worker size options small state
+ // for worker size options.
+ WorkerSizeOptionsSmall WorkerSizeOptions = "Small"
)
// Address is address information for domain registration
@@ -535,6 +633,12 @@
VipMappings *[]VirtualIPMapping `json:"vipMappings,omitempty"`
}
+// APIDefinitionInfo is information about the formal API definition for the
+// web app.
+type APIDefinitionInfo struct {
+ URL *string `json:"url,omitempty"`
+}
+
// ApplicationLogsConfig is application logs configuration
type ApplicationLogsConfig struct {
FileSystem *FileSystemApplicationLogsConfig `json:"fileSystem,omitempty"`
@@ -554,8 +658,9 @@
// AutoHealActions is autoHealActions - Describes the actions which can be
// taken by the auto-heal module when a rule is triggered.
type AutoHealActions struct {
- ActionType AutoHealActionType `json:"actionType,omitempty"`
- CustomAction *AutoHealCustomAction `json:"customAction,omitempty"`
+ ActionType AutoHealActionType `json:"actionType,omitempty"`
+ CustomAction *AutoHealCustomAction `json:"customAction,omitempty"`
+ MinProcessExecutionTime *string `json:"minProcessExecutionTime,omitempty"`
}
// AutoHealCustomAction is autoHealCustomAction - Describes the custom action
@@ -576,7 +681,7 @@
// AutoHealTriggers is autoHealTriggers - describes the triggers for auto-heal.
type AutoHealTriggers struct {
Requests *RequestsBasedTrigger `json:"requests,omitempty"`
- PrivateBytesInKB *int `json:"privateBytesInKB,omitempty"`
+ PrivateBytesInKB *int32 `json:"privateBytesInKB,omitempty"`
StatusCodes *[]StatusCodesBasedTrigger `json:"statusCodes,omitempty"`
SlowRequests *SlowRequestsBasedTrigger `json:"slowRequests,omitempty"`
}
@@ -586,14 +691,14 @@
type AzureBlobStorageApplicationLogsConfig struct {
Level LogLevel `json:"level,omitempty"`
SasURL *string `json:"sasUrl,omitempty"`
- RetentionInDays *int `json:"retentionInDays,omitempty"`
+ RetentionInDays *int32 `json:"retentionInDays,omitempty"`
}
// AzureBlobStorageHTTPLogsConfig is http logs to azure blob storage
// configuration
type AzureBlobStorageHTTPLogsConfig struct {
SasURL *string `json:"sasUrl,omitempty"`
- RetentionInDays *int `json:"retentionInDays,omitempty"`
+ RetentionInDays *int32 `json:"retentionInDays,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
@@ -609,6 +714,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -624,11 +730,12 @@
// BackupItemProperties is
type BackupItemProperties struct {
+ ID *int32 `json:"id,omitempty"`
StorageAccountURL *string `json:"storageAccountUrl,omitempty"`
BlobName *string `json:"blobName,omitempty"`
Name *string `json:"name,omitempty"`
Status BackupItemStatus `json:"status,omitempty"`
- SizeInBytes *int32 `json:"sizeInBytes,omitempty"`
+ SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
Created *date.Time `json:"created,omitempty"`
Log *string `json:"log,omitempty"`
Databases *[]DatabaseBackupSetting `json:"databases,omitempty"`
@@ -636,7 +743,7 @@
LastRestoreTimeStamp *date.Time `json:"lastRestoreTimeStamp,omitempty"`
FinishedTimeStamp *date.Time `json:"finishedTimeStamp,omitempty"`
CorrelationID *string `json:"correlationId,omitempty"`
- WebsiteSizeInBytes *int32 `json:"websiteSizeInBytes,omitempty"`
+ WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty"`
}
// BackupRequest is description of a backup which will be performed
@@ -644,6 +751,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -663,10 +771,10 @@
// BackupSchedule is description of a backup schedule. Describes how often
// should be the backup performed and what should be the retention policy.
type BackupSchedule struct {
- FrequencyInterval *int `json:"frequencyInterval,omitempty"`
+ FrequencyInterval *int32 `json:"frequencyInterval,omitempty"`
FrequencyUnit FrequencyUnit `json:"frequencyUnit,omitempty"`
KeepAtLeastOneBackup *bool `json:"keepAtLeastOneBackup,omitempty"`
- RetentionPeriodInDays *int `json:"retentionPeriodInDays,omitempty"`
+ RetentionPeriodInDays *int32 `json:"retentionPeriodInDays,omitempty"`
StartTime *date.Time `json:"startTime,omitempty"`
LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"`
}
@@ -676,6 +784,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -689,23 +798,83 @@
NextLink *string `json:"nextLink,omitempty"`
}
+// CertificateDetails is certificate Details
+type CertificateDetails struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *CertificateDetailsProperties `json:"properties,omitempty"`
+}
+
+// CertificateDetailsProperties is
+type CertificateDetailsProperties struct {
+ Version *int32 `json:"version,omitempty"`
+ SerialNumber *string `json:"serialNumber,omitempty"`
+ Thumbprint *string `json:"thumbprint,omitempty"`
+ Subject *string `json:"subject,omitempty"`
+ NotBefore *date.Time `json:"notBefore,omitempty"`
+ NotAfter *date.Time `json:"notAfter,omitempty"`
+ SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty"`
+ Issuer *string `json:"issuer,omitempty"`
+ RawData *string `json:"rawData,omitempty"`
+}
+
+// CertificateEmail is certificate Email
+type CertificateEmail struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *CertificateEmailProperties `json:"properties,omitempty"`
+}
+
+// CertificateEmailProperties is
+type CertificateEmailProperties struct {
+ EmailID *string `json:"emailId,omitempty"`
+ TimeStamp *date.Time `json:"timeStamp,omitempty"`
+}
+
// CertificateOrder is certificate purchase order
type CertificateOrder struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *CertificateOrderProperties `json:"properties,omitempty"`
}
+// CertificateOrderAction is represents a certificate action
+type CertificateOrderAction struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *CertificateOrderActionProperties `json:"properties,omitempty"`
+}
+
+// CertificateOrderActionProperties is
+type CertificateOrderActionProperties struct {
+ Type CertificateOrderActionType `json:"type,omitempty"`
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+}
+
// CertificateOrderCertificate is class representing the Key Vault container
// for certificate purchased through Azure
type CertificateOrderCertificate struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -722,10 +891,9 @@
// CertificateOrderCertificateProperties is
type CertificateOrderCertificateProperties struct {
- KeyVaultCsmID *string `json:"keyVaultCsmId,omitempty"`
+ KeyVaultID *string `json:"keyVaultId,omitempty"`
KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"`
ProvisioningState KeyVaultSecretStatus `json:"provisioningState,omitempty"`
- Thumbprint *string `json:"thumbprint,omitempty"`
}
// CertificateOrderCollection is collection of ceritificate orders
@@ -737,21 +905,22 @@
// CertificateOrderProperties is
type CertificateOrderProperties struct {
- Certificates *map[string]*CertificateOrderCertificate `json:"certificates,omitempty"`
- DistinguishedName *string `json:"distinguishedName,omitempty"`
- DomainVerificationToken *string `json:"domainVerificationToken,omitempty"`
- ValidityInYears *int `json:"validityInYears,omitempty"`
- KeySize *int `json:"keySize,omitempty"`
- ProductType CertificateProductType `json:"productType,omitempty"`
- Status CertificateOrderStatus `json:"status,omitempty"`
- SignedCertificate *string `json:"signedCertificate,omitempty"`
- Csr *string `json:"csr,omitempty"`
- Intermediate *string `json:"intermediate,omitempty"`
- Root *string `json:"root,omitempty"`
- SerialNumber *string `json:"serialNumber,omitempty"`
- Action CertificateAction `json:"action,omitempty"`
- KeyVaultCsmID *string `json:"keyVaultCsmId,omitempty"`
- DelayExistingRevokeInHours *int `json:"delayExistingRevokeInHours,omitempty"`
+ Certificates *map[string]*CertificateOrderCertificate `json:"certificates,omitempty"`
+ DistinguishedName *string `json:"distinguishedName,omitempty"`
+ DomainVerificationToken *string `json:"domainVerificationToken,omitempty"`
+ ValidityInYears *int32 `json:"validityInYears,omitempty"`
+ KeySize *int32 `json:"keySize,omitempty"`
+ ProductType CertificateProductType `json:"productType,omitempty"`
+ AutoRenew *bool `json:"autoRenew,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ Status CertificateOrderStatus `json:"status,omitempty"`
+ SignedCertificate *CertificateDetails `json:"signedCertificate,omitempty"`
+ Csr *string `json:"csr,omitempty"`
+ Intermediate *CertificateDetails `json:"intermediate,omitempty"`
+ Root *CertificateDetails `json:"root,omitempty"`
+ SerialNumber *string `json:"serialNumber,omitempty"`
+ LastCertificateIssuanceTime *date.Time `json:"lastCertificateIssuanceTime,omitempty"`
+ ExpirationTime *date.Time `json:"expirationTime,omitempty"`
}
// CertificateProperties is
@@ -771,8 +940,6 @@
CerBlob *string `json:"cerBlob,omitempty"`
PublicKeyHash *string `json:"publicKeyHash,omitempty"`
HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"`
- KeyVaultCsmID *string `json:"keyVaultCsmId,omitempty"`
- KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"`
}
// ClassicMobileService is a mobile service
@@ -780,6 +947,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -817,6 +985,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -851,6 +1020,12 @@
Phone *string `json:"phone,omitempty"`
}
+// CorsSettings is cross-Origin Resource Sharing (CORS) settings for the web
+// app.
+type CorsSettings struct {
+ AllowedOrigins *[]string `json:"allowedOrigins,omitempty"`
+}
+
// CsmMoveResourceEnvelope is class containing a list of the resources that
// need to be moved and the resource group they should be moved to
type CsmMoveResourceEnvelope struct {
@@ -866,9 +1041,10 @@
// CsmSiteRecoveryEntity is class containting details about site recovery
// operation.
type CsmSiteRecoveryEntity struct {
- SnapshotTime *date.Time `json:"snapshotTime,omitempty"`
- SiteName *string `json:"siteName,omitempty"`
- SlotName *string `json:"slotName,omitempty"`
+ SnapshotTime *date.Time `json:"snapshotTime,omitempty"`
+ RecoverConfig *bool `json:"recoverConfig,omitempty"`
+ SiteName *string `json:"siteName,omitempty"`
+ SlotName *string `json:"slotName,omitempty"`
}
// CsmSlotEntity is class containing deployment slot parameters
@@ -881,8 +1057,8 @@
type CsmUsageQuota struct {
Unit *string `json:"unit,omitempty"`
NextResetTime *date.Time `json:"nextResetTime,omitempty"`
- CurrentValue *int32 `json:"currentValue,omitempty"`
- Limit *int32 `json:"limit,omitempty"`
+ CurrentValue *int64 `json:"currentValue,omitempty"`
+ Limit *int64 `json:"limit,omitempty"`
Name *LocalizableString `json:"name,omitempty"`
}
@@ -898,18 +1074,13 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *CsrProperties `json:"properties,omitempty"`
}
-// CsrList is
-type CsrList struct {
- autorest.Response `json:"-"`
- Value *[]Csr `json:"value,omitempty"`
-}
-
// CsrProperties is
type CsrProperties struct {
Name *string `json:"name,omitempty"`
@@ -937,6 +1108,7 @@
type DeletedSite struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -974,8 +1146,47 @@
GatewaySiteName *string `json:"gatewaySiteName,omitempty"`
ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"`
ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
+ HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"`
OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"`
+ ContainerSize *int32 `json:"containerSize,omitempty"`
+ MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty"`
CloningInfo *CloningInfo `json:"cloningInfo,omitempty"`
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+ IsDefaultContainer *bool `json:"isDefaultContainer,omitempty"`
+ DefaultHostName *string `json:"defaultHostName,omitempty"`
+}
+
+// Deployment is represents user crendentials used for publishing activity
+type Deployment struct {
+ autorest.Response `json:"-"`
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *DeploymentProperties `json:"properties,omitempty"`
+}
+
+// DeploymentCollection is collection of app deployments
+type DeploymentCollection struct {
+ autorest.Response `json:"-"`
+ Value *[]Deployment `json:"value,omitempty"`
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// DeploymentProperties is
+type DeploymentProperties struct {
+ ID *string `json:"id,omitempty"`
+ Status *int32 `json:"status,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Author *string `json:"author,omitempty"`
+ Deployer *string `json:"deployer,omitempty"`
+ AuthorEmail *string `json:"author_email,omitempty"`
+ StartTime *date.Time `json:"start_time,omitempty"`
+ EndTime *date.Time `json:"end_time,omitempty"`
+ Active *bool `json:"active,omitempty"`
+ Details *string `json:"details,omitempty"`
}
// Domain is represents a domain
@@ -983,6 +1194,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1020,6 +1232,7 @@
ContactRegistrant *Contact `json:"contactRegistrant,omitempty"`
ContactTech *Contact `json:"contactTech,omitempty"`
RegistrationStatus DomainStatus `json:"registrationStatus,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
NameServers *[]string `json:"nameServers,omitempty"`
Privacy *bool `json:"privacy,omitempty"`
CreatedTime *date.Time `json:"createdTime,omitempty"`
@@ -1029,6 +1242,7 @@
ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty"`
ManagedHostNames *[]HostName `json:"managedHostNames,omitempty"`
Consent *DomainPurchaseConsent `json:"consent,omitempty"`
+ DomainNotRenewableReasons *[]string `json:"domainNotRenewableReasons,omitempty"`
}
// DomainPurchaseConsent is domain purchase consent object representing
@@ -1043,13 +1257,14 @@
// parameters
type DomainRecommendationSearchParameters struct {
Keywords *string `json:"keywords,omitempty"`
- MaxDomainRecommendations *int `json:"maxDomainRecommendations,omitempty"`
+ MaxDomainRecommendations *int32 `json:"maxDomainRecommendations,omitempty"`
}
// DomainRegistrationInput is domain registration input for validation Api
type DomainRegistrationInput struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1064,6 +1279,7 @@
ContactRegistrant *Contact `json:"contactRegistrant,omitempty"`
ContactTech *Contact `json:"contactTech,omitempty"`
RegistrationStatus DomainStatus `json:"registrationStatus,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
NameServers *[]string `json:"nameServers,omitempty"`
Privacy *bool `json:"privacy,omitempty"`
CreatedTime *date.Time `json:"createdTime,omitempty"`
@@ -1073,6 +1289,7 @@
ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty"`
ManagedHostNames *[]HostName `json:"managedHostNames,omitempty"`
Consent *DomainPurchaseConsent `json:"consent,omitempty"`
+ DomainNotRenewableReasons *[]string `json:"domainNotRenewableReasons,omitempty"`
}
// EnabledConfig is enabled configuration
@@ -1093,15 +1310,16 @@
// FileSystemHTTPLogsConfig is http logs to file system configuration
type FileSystemHTTPLogsConfig struct {
- RetentionInMb *int `json:"retentionInMb,omitempty"`
- RetentionInDays *int `json:"retentionInDays,omitempty"`
- Enabled *bool `json:"enabled,omitempty"`
+ RetentionInMb *int32 `json:"retentionInMb,omitempty"`
+ RetentionInDays *int32 `json:"retentionInDays,omitempty"`
+ Enabled *bool `json:"enabled,omitempty"`
}
// GeoRegion is geographical region
type GeoRegion struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1138,6 +1356,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1160,12 +1379,6 @@
DiagnosicsOutput *string `json:"diagnosicsOutput,omitempty"`
}
-// HostingEnvironmentDiagnosticsList is
-type HostingEnvironmentDiagnosticsList struct {
- autorest.Response `json:"-"`
- Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"`
-}
-
// HostingEnvironmentProfile is specification for a hostingEnvironment (App
// Service Environment) to use for this resource
type HostingEnvironmentProfile struct {
@@ -1178,6 +1391,7 @@
type HostingEnvironmentProperties struct {
Name *string `json:"name,omitempty"`
Location *string `json:"location,omitempty"`
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
Status HostingEnvironmentStatus `json:"status,omitempty"`
VnetName *string `json:"vnetName,omitempty"`
VnetResourceGroupName *string `json:"vnetResourceGroupName,omitempty"`
@@ -1185,19 +1399,19 @@
VirtualNetwork *VirtualNetworkProfile `json:"virtualNetwork,omitempty"`
InternalLoadBalancingMode InternalLoadBalancingMode `json:"internalLoadBalancingMode,omitempty"`
MultiSize *string `json:"multiSize,omitempty"`
- MultiRoleCount *int `json:"multiRoleCount,omitempty"`
+ MultiRoleCount *int32 `json:"multiRoleCount,omitempty"`
WorkerPools *[]WorkerPool `json:"workerPools,omitempty"`
- IpsslAddressCount *int `json:"ipsslAddressCount,omitempty"`
+ IpsslAddressCount *int32 `json:"ipsslAddressCount,omitempty"`
DatabaseEdition *string `json:"databaseEdition,omitempty"`
DatabaseServiceObjective *string `json:"databaseServiceObjective,omitempty"`
- UpgradeDomains *int `json:"upgradeDomains,omitempty"`
+ UpgradeDomains *int32 `json:"upgradeDomains,omitempty"`
SubscriptionID *string `json:"subscriptionId,omitempty"`
DNSSuffix *string `json:"dnsSuffix,omitempty"`
LastAction *string `json:"lastAction,omitempty"`
LastActionResult *string `json:"lastActionResult,omitempty"`
AllowedMultiSizes *string `json:"allowedMultiSizes,omitempty"`
AllowedWorkerSizes *string `json:"allowedWorkerSizes,omitempty"`
- MaximumNumberOfMachines *int `json:"maximumNumberOfMachines,omitempty"`
+ MaximumNumberOfMachines *int32 `json:"maximumNumberOfMachines,omitempty"`
VipMappings *[]VirtualIPMapping `json:"vipMappings,omitempty"`
EnvironmentCapacities *[]StampCapacity `json:"environmentCapacities,omitempty"`
NetworkAccessControlList *[]NetworkAccessControlEntry `json:"networkAccessControlList,omitempty"`
@@ -1206,6 +1420,7 @@
ResourceGroup *string `json:"resourceGroup,omitempty"`
APIManagementAccountID *string `json:"apiManagementAccountId,omitempty"`
Suspended *bool `json:"suspended,omitempty"`
+ ClusterSettings *[]NameValuePair `json:"clusterSettings,omitempty"`
}
// HostName is details of a hostname derived from a domain
@@ -1223,6 +1438,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1249,12 +1465,11 @@
// HostNameSslState is object that represents a SSL-enabled host name.
type HostNameSslState struct {
- Name *string `json:"name,omitempty"`
- SslState SslState `json:"sslState,omitempty"`
- VirtualIP *string `json:"virtualIP,omitempty"`
- Thumbprint *string `json:"thumbprint,omitempty"`
- ToUpdate *bool `json:"toUpdate,omitempty"`
- ToUpdateIPBasedSsl *bool `json:"toUpdateIpBasedSsl,omitempty"`
+ Name *string `json:"name,omitempty"`
+ SslState SslState `json:"sslState,omitempty"`
+ VirtualIP *string `json:"virtualIP,omitempty"`
+ Thumbprint *string `json:"thumbprint,omitempty"`
+ ToUpdate *bool `json:"toUpdate,omitempty"`
}
// HTTPLogsConfig is http logs configuration
@@ -1263,12 +1478,60 @@
AzureBlobStorage *AzureBlobStorageHTTPLogsConfig `json:"azureBlobStorage,omitempty"`
}
+// IPSecurityRestriction is represents an ip security restriction on a web app.
+type IPSecurityRestriction struct {
+ IPAddress *string `json:"ipAddress,omitempty"`
+ SubnetMask *string `json:"subnetMask,omitempty"`
+}
+
// KeyValuePairStringString is
type KeyValuePairStringString struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
+// ListCertificateEmail is
+type ListCertificateEmail struct {
+ autorest.Response `json:"-"`
+ Value *[]CertificateEmail `json:"value,omitempty"`
+}
+
+// ListCertificateOrderAction is
+type ListCertificateOrderAction struct {
+ autorest.Response `json:"-"`
+ Value *[]CertificateOrderAction `json:"value,omitempty"`
+}
+
+// ListCsr is
+type ListCsr struct {
+ autorest.Response `json:"-"`
+ Value *[]Csr `json:"value,omitempty"`
+}
+
+// ListHostingEnvironmentDiagnostics is
+type ListHostingEnvironmentDiagnostics struct {
+ autorest.Response `json:"-"`
+ Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"`
+}
+
+// ListRecommendation is
+type ListRecommendation struct {
+ autorest.Response `json:"-"`
+ Value *[]Recommendation `json:"value,omitempty"`
+}
+
+// ListVnetInfo is
+type ListVnetInfo struct {
+ autorest.Response `json:"-"`
+ Value *[]VnetInfo `json:"value,omitempty"`
+}
+
+// ListVnetRoute is
+type ListVnetRoute struct {
+ autorest.Response `json:"-"`
+ Value *[]VnetRoute `json:"value,omitempty"`
+}
+
// LocalizableString is localizableString object containing the name and a
// localized value.
type LocalizableString struct {
@@ -1281,6 +1544,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1301,13 +1565,14 @@
Location *string `json:"location,omitempty"`
Status ManagedHostingEnvironmentStatus `json:"status,omitempty"`
VirtualNetwork *VirtualNetworkProfile `json:"virtualNetwork,omitempty"`
- IpsslAddressCount *int `json:"ipsslAddressCount,omitempty"`
+ IpsslAddressCount *int32 `json:"ipsslAddressCount,omitempty"`
DNSSuffix *string `json:"dnsSuffix,omitempty"`
SubscriptionID *string `json:"subscriptionId,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
EnvironmentIsHealthy *bool `json:"environmentIsHealthy,omitempty"`
EnvironmentStatus *string `json:"environmentStatus,omitempty"`
Suspended *bool `json:"suspended,omitempty"`
+ APIManagementAccount *string `json:"apiManagementAccount,omitempty"`
}
// MetricAvailabilily is class repesenting metrics availability and retention
@@ -1321,6 +1586,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1365,7 +1631,7 @@
type NetworkAccessControlEntry struct {
Action AccessControlEntryAction `json:"action,omitempty"`
Description *string `json:"description,omitempty"`
- Order *int `json:"order,omitempty"`
+ Order *int32 `json:"order,omitempty"`
RemoteSubnet *string `json:"remoteSubnet,omitempty"`
}
@@ -1376,6 +1642,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1389,12 +1656,6 @@
HybridConnections *[]RelayServiceConnectionEntity `json:"hybridConnections,omitempty"`
}
-// ObjectSet is
-type ObjectSet struct {
- autorest.Response `json:"-"`
- Value *map[string]interface{} `json:"value,omitempty"`
-}
-
// PremierAddOnRequest is
type PremierAddOnRequest struct {
Location *string `json:"location,omitempty"`
@@ -1411,19 +1672,83 @@
ActionHostName *string `json:"actionHostName,omitempty"`
ReroutePercentage *float64 `json:"reroutePercentage,omitempty"`
ChangeStep *float64 `json:"changeStep,omitempty"`
- ChangeIntervalInMinutes *int `json:"changeIntervalInMinutes,omitempty"`
+ ChangeIntervalInMinutes *int32 `json:"changeIntervalInMinutes,omitempty"`
MinReroutePercentage *float64 `json:"minReroutePercentage,omitempty"`
MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"`
ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"`
Name *string `json:"name,omitempty"`
}
+// ReadCloser is
+type ReadCloser struct {
+ autorest.Response `json:"-"`
+ Value *io.ReadCloser `json:"value,omitempty"`
+}
+
+// Recommendation is represents a recommendation result generated by the
+// recommendation engine
+type Recommendation struct {
+ CreationTime *date.Time `json:"creationTime,omitempty"`
+ RecommendationID *string `json:"recommendationId,omitempty"`
+ ResourceID *string `json:"resourceId,omitempty"`
+ ResourceScope *string `json:"resourceScope,omitempty"`
+ RuleName *string `json:"ruleName,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Message *string `json:"message,omitempty"`
+ Level NotificationLevel `json:"level,omitempty"`
+ Channels Channels `json:"channels,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+ ActionName *string `json:"actionName,omitempty"`
+ Enabled *int32 `json:"enabled,omitempty"`
+ StartTime *date.Time `json:"startTime,omitempty"`
+ EndTime *date.Time `json:"endTime,omitempty"`
+ NextNotificationTime *date.Time `json:"nextNotificationTime,omitempty"`
+ NotificationExpirationTime *date.Time `json:"notificationExpirationTime,omitempty"`
+ NotifiedTime *date.Time `json:"notifiedTime,omitempty"`
+ Score *float64 `json:"score,omitempty"`
+}
+
+// RecommendationRule is represents a recommendation rule that the
+// recommendation engine can perform
+type RecommendationRule struct {
+ autorest.Response `json:"-"`
+ Name *string `json:"name,omitempty"`
+ DisplayName *string `json:"displayName,omitempty"`
+ Message *string `json:"message,omitempty"`
+ RecommendationID *string `json:"recommendationId,omitempty"`
+ Description *string `json:"description,omitempty"`
+ ActionName *string `json:"actionName,omitempty"`
+ Enabled *int32 `json:"enabled,omitempty"`
+ Level NotificationLevel `json:"level,omitempty"`
+ Channels Channels `json:"channels,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+}
+
+// ReissueCertificateOrderRequest is class representing certificate reissue
+// request
+type ReissueCertificateOrderRequest struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *ReissueCertificateOrderRequestProperties `json:"properties,omitempty"`
+}
+
+// ReissueCertificateOrderRequestProperties is
+type ReissueCertificateOrderRequestProperties struct {
+ KeySize *int32 `json:"keySize,omitempty"`
+ DelayExistingRevokeInHours *int32 `json:"delayExistingRevokeInHours,omitempty"`
+}
+
// RelayServiceConnectionEntity is class that represents a Biztalk Hybrid
// Connection
type RelayServiceConnectionEntity struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1437,13 +1762,29 @@
ResourceType *string `json:"resourceType,omitempty"`
ResourceConnectionString *string `json:"resourceConnectionString,omitempty"`
Hostname *string `json:"hostname,omitempty"`
- Port *int `json:"port,omitempty"`
+ Port *int32 `json:"port,omitempty"`
BiztalkURI *string `json:"biztalkUri,omitempty"`
}
+// RenewCertificateOrderRequest is class representing certificate renew request
+type RenewCertificateOrderRequest struct {
+ ID *string `json:"id,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
+ Location *string `json:"location,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Tags *map[string]*string `json:"tags,omitempty"`
+ Properties *RenewCertificateOrderRequestProperties `json:"properties,omitempty"`
+}
+
+// RenewCertificateOrderRequestProperties is
+type RenewCertificateOrderRequestProperties struct {
+ KeySize *int32 `json:"keySize,omitempty"`
+}
+
// RequestsBasedTrigger is requestsBasedTrigger
type RequestsBasedTrigger struct {
- Count *int `json:"count,omitempty"`
+ Count *int32 `json:"count,omitempty"`
TimeInterval *string `json:"timeInterval,omitempty"`
}
@@ -1451,6 +1792,7 @@
type Resource struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1512,6 +1854,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1536,6 +1879,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1564,6 +1908,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1574,22 +1919,30 @@
// ServerFarmWithRichSkuProperties is
type ServerFarmWithRichSkuProperties struct {
Name *string `json:"name,omitempty"`
+ WorkerTierName *string `json:"workerTierName,omitempty"`
Status StatusOptions `json:"status,omitempty"`
Subscription *string `json:"subscription,omitempty"`
AdminSiteName *string `json:"adminSiteName,omitempty"`
HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"`
- MaximumNumberOfWorkers *int `json:"maximumNumberOfWorkers,omitempty"`
+ MaximumNumberOfWorkers *int32 `json:"maximumNumberOfWorkers,omitempty"`
GeoRegion *string `json:"geoRegion,omitempty"`
PerSiteScaling *bool `json:"perSiteScaling,omitempty"`
- NumberOfSites *int `json:"numberOfSites,omitempty"`
+ NumberOfSites *int32 `json:"numberOfSites,omitempty"`
ResourceGroup *string `json:"resourceGroup,omitempty"`
}
+// SetObject is
+type SetObject struct {
+ autorest.Response `json:"-"`
+ Value *map[string]interface{} `json:"value,omitempty"`
+}
+
// Site is represents a web app
type Site struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1606,10 +1959,12 @@
TokenStoreEnabled *bool `json:"tokenStoreEnabled,omitempty"`
AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"`
DefaultProvider BuiltInAuthenticationProvider `json:"defaultProvider,omitempty"`
+ TokenRefreshExtensionHours *float64 `json:"tokenRefreshExtensionHours,omitempty"`
ClientID *string `json:"clientId,omitempty"`
ClientSecret *string `json:"clientSecret,omitempty"`
Issuer *string `json:"issuer,omitempty"`
AllowedAudiences *[]string `json:"allowedAudiences,omitempty"`
+ AdditionalLoginParams *[]string `json:"additionalLoginParams,omitempty"`
AadClientID *string `json:"aadClientId,omitempty"`
OpenIDIssuer *string `json:"openIdIssuer,omitempty"`
GoogleClientID *string `json:"googleClientId,omitempty"`
@@ -1625,6 +1980,21 @@
MicrosoftAccountOAuthScopes *[]string `json:"microsoftAccountOAuthScopes,omitempty"`
}
+// SiteCloneability is represents whether or not a web app is cloneable
+type SiteCloneability struct {
+ autorest.Response `json:"-"`
+ Result CloneAbilityResult `json:"result,omitempty"`
+ BlockingFeatures *[]SiteCloneabilityCriterion `json:"blockingFeatures,omitempty"`
+ UnsupportedFeatures *[]SiteCloneabilityCriterion `json:"unsupportedFeatures,omitempty"`
+ BlockingCharacteristics *[]SiteCloneabilityCriterion `json:"blockingCharacteristics,omitempty"`
+}
+
+// SiteCloneabilityCriterion is represents a site cloneability criterion
+type SiteCloneabilityCriterion struct {
+ Name *string `json:"name,omitempty"`
+ Description *string `json:"description,omitempty"`
+}
+
// SiteCollection is collection of sites
type SiteCollection struct {
autorest.Response `json:"-"`
@@ -1649,6 +2019,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1657,48 +2028,53 @@
// SiteConfigProperties is
type SiteConfigProperties struct {
- NumberOfWorkers *int `json:"numberOfWorkers,omitempty"`
- DefaultDocuments *[]string `json:"defaultDocuments,omitempty"`
- NetFrameworkVersion *string `json:"netFrameworkVersion,omitempty"`
- PhpVersion *string `json:"phpVersion,omitempty"`
- PythonVersion *string `json:"pythonVersion,omitempty"`
- RequestTracingEnabled *bool `json:"requestTracingEnabled,omitempty"`
- RequestTracingExpirationTime *date.Time `json:"requestTracingExpirationTime,omitempty"`
- RemoteDebuggingEnabled *bool `json:"remoteDebuggingEnabled,omitempty"`
- RemoteDebuggingVersion *string `json:"remoteDebuggingVersion,omitempty"`
- HTTPLoggingEnabled *bool `json:"httpLoggingEnabled,omitempty"`
- LogsDirectorySizeLimit *int `json:"logsDirectorySizeLimit,omitempty"`
- DetailedErrorLoggingEnabled *bool `json:"detailedErrorLoggingEnabled,omitempty"`
- PublishingUsername *string `json:"publishingUsername,omitempty"`
- PublishingPassword *string `json:"publishingPassword,omitempty"`
- AppSettings *[]NameValuePair `json:"appSettings,omitempty"`
- Metadata *[]NameValuePair `json:"metadata,omitempty"`
- ConnectionStrings *[]ConnStringInfo `json:"connectionStrings,omitempty"`
- HandlerMappings *[]HandlerMapping `json:"handlerMappings,omitempty"`
- DocumentRoot *string `json:"documentRoot,omitempty"`
- ScmType *string `json:"scmType,omitempty"`
- Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"`
- WebSocketsEnabled *bool `json:"webSocketsEnabled,omitempty"`
- AlwaysOn *bool `json:"alwaysOn,omitempty"`
- JavaVersion *string `json:"javaVersion,omitempty"`
- JavaContainer *string `json:"javaContainer,omitempty"`
- JavaContainerVersion *string `json:"javaContainerVersion,omitempty"`
- ManagedPipelineMode ManagedPipelineMode `json:"managedPipelineMode,omitempty"`
- VirtualApplications *[]VirtualApplication `json:"virtualApplications,omitempty"`
- LoadBalancing SiteLoadBalancing `json:"loadBalancing,omitempty"`
- Experiments *Experiments `json:"experiments,omitempty"`
- Limits *SiteLimits `json:"limits,omitempty"`
- AutoHealEnabled *bool `json:"autoHealEnabled,omitempty"`
- AutoHealRules *AutoHealRules `json:"autoHealRules,omitempty"`
- TracingOptions *string `json:"tracingOptions,omitempty"`
- VnetName *string `json:"vnetName,omitempty"`
- AutoSwapSlotName *string `json:"autoSwapSlotName,omitempty"`
+ NumberOfWorkers *int32 `json:"numberOfWorkers,omitempty"`
+ DefaultDocuments *[]string `json:"defaultDocuments,omitempty"`
+ NetFrameworkVersion *string `json:"netFrameworkVersion,omitempty"`
+ PhpVersion *string `json:"phpVersion,omitempty"`
+ PythonVersion *string `json:"pythonVersion,omitempty"`
+ RequestTracingEnabled *bool `json:"requestTracingEnabled,omitempty"`
+ RequestTracingExpirationTime *date.Time `json:"requestTracingExpirationTime,omitempty"`
+ RemoteDebuggingEnabled *bool `json:"remoteDebuggingEnabled,omitempty"`
+ RemoteDebuggingVersion *string `json:"remoteDebuggingVersion,omitempty"`
+ HTTPLoggingEnabled *bool `json:"httpLoggingEnabled,omitempty"`
+ LogsDirectorySizeLimit *int32 `json:"logsDirectorySizeLimit,omitempty"`
+ DetailedErrorLoggingEnabled *bool `json:"detailedErrorLoggingEnabled,omitempty"`
+ PublishingUsername *string `json:"publishingUsername,omitempty"`
+ PublishingPassword *string `json:"publishingPassword,omitempty"`
+ AppSettings *[]NameValuePair `json:"appSettings,omitempty"`
+ Metadata *[]NameValuePair `json:"metadata,omitempty"`
+ ConnectionStrings *[]ConnStringInfo `json:"connectionStrings,omitempty"`
+ HandlerMappings *[]HandlerMapping `json:"handlerMappings,omitempty"`
+ DocumentRoot *string `json:"documentRoot,omitempty"`
+ ScmType *string `json:"scmType,omitempty"`
+ Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"`
+ WebSocketsEnabled *bool `json:"webSocketsEnabled,omitempty"`
+ AlwaysOn *bool `json:"alwaysOn,omitempty"`
+ JavaVersion *string `json:"javaVersion,omitempty"`
+ JavaContainer *string `json:"javaContainer,omitempty"`
+ JavaContainerVersion *string `json:"javaContainerVersion,omitempty"`
+ ManagedPipelineMode ManagedPipelineMode `json:"managedPipelineMode,omitempty"`
+ VirtualApplications *[]VirtualApplication `json:"virtualApplications,omitempty"`
+ LoadBalancing SiteLoadBalancing `json:"loadBalancing,omitempty"`
+ Experiments *Experiments `json:"experiments,omitempty"`
+ Limits *SiteLimits `json:"limits,omitempty"`
+ AutoHealEnabled *bool `json:"autoHealEnabled,omitempty"`
+ AutoHealRules *AutoHealRules `json:"autoHealRules,omitempty"`
+ TracingOptions *string `json:"tracingOptions,omitempty"`
+ VnetName *string `json:"vnetName,omitempty"`
+ Cors *CorsSettings `json:"cors,omitempty"`
+ APIDefinition *APIDefinitionInfo `json:"apiDefinition,omitempty"`
+ AutoSwapSlotName *string `json:"autoSwapSlotName,omitempty"`
+ LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty"`
+ IPSecurityRestrictions *[]IPSecurityRestriction `json:"ipSecurityRestrictions,omitempty"`
}
// SiteInstance is instance of a web app
type SiteInstance struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1720,8 +2096,8 @@
// SiteLimits is represents metric limits set on a web app.
type SiteLimits struct {
MaxPercentageCPU *float64 `json:"maxPercentageCpu,omitempty"`
- MaxMemoryInMb *int32 `json:"maxMemoryInMb,omitempty"`
- MaxDiskSizeInMb *int32 `json:"maxDiskSizeInMb,omitempty"`
+ MaxMemoryInMb *int64 `json:"maxMemoryInMb,omitempty"`
+ MaxDiskSizeInMb *int64 `json:"maxDiskSizeInMb,omitempty"`
}
// SiteLogsConfig is configuration of Azure web site
@@ -1729,6 +2105,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1766,8 +2143,14 @@
GatewaySiteName *string `json:"gatewaySiteName,omitempty"`
ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"`
ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
+ HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"`
OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"`
+ ContainerSize *int32 `json:"containerSize,omitempty"`
+ MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty"`
CloningInfo *CloningInfo `json:"cloningInfo,omitempty"`
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+ IsDefaultContainer *bool `json:"isDefaultContainer,omitempty"`
+ DefaultHostName *string `json:"defaultHostName,omitempty"`
}
// SitePropertiesModel is
@@ -1782,6 +2165,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1799,9 +2183,9 @@
// SkuCapacity is description of the App Service Plan scale options
type SkuCapacity struct {
- Minimum *int `json:"minimum,omitempty"`
- Maximum *int `json:"maximum,omitempty"`
- Default *int `json:"default,omitempty"`
+ Minimum *int32 `json:"minimum,omitempty"`
+ Maximum *int32 `json:"maximum,omitempty"`
+ Default *int32 `json:"default,omitempty"`
ScaleType *string `json:"scaleType,omitempty"`
}
@@ -1811,7 +2195,7 @@
Tier *string `json:"tier,omitempty"`
Size *string `json:"size,omitempty"`
Family *string `json:"family,omitempty"`
- Capacity *int `json:"capacity,omitempty"`
+ Capacity *int32 `json:"capacity,omitempty"`
}
// SkuInfo is sku discovery information
@@ -1842,6 +2226,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1859,6 +2244,7 @@
type SlotDifference struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1886,7 +2272,7 @@
// SlowRequestsBasedTrigger is slowRequestsBasedTrigger
type SlowRequestsBasedTrigger struct {
TimeTaken *string `json:"timeTaken,omitempty"`
- Count *int `json:"count,omitempty"`
+ Count *int32 `json:"count,omitempty"`
TimeInterval *string `json:"timeInterval,omitempty"`
}
@@ -1895,6 +2281,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1920,12 +2307,12 @@
// StampCapacity is class containing stamp capacity information
type StampCapacity struct {
Name *string `json:"name,omitempty"`
- AvailableCapacity *int32 `json:"availableCapacity,omitempty"`
- TotalCapacity *int32 `json:"totalCapacity,omitempty"`
+ AvailableCapacity *int64 `json:"availableCapacity,omitempty"`
+ TotalCapacity *int64 `json:"totalCapacity,omitempty"`
Unit *string `json:"unit,omitempty"`
ComputeMode ComputeModeOptions `json:"computeMode,omitempty"`
WorkerSize WorkerSizeOptions `json:"workerSize,omitempty"`
- WorkerSizeID *int `json:"workerSizeId,omitempty"`
+ WorkerSizeID *int32 `json:"workerSizeId,omitempty"`
ExcludeFromCapacityAllocation *bool `json:"excludeFromCapacityAllocation,omitempty"`
IsApplicableForAllComputeModes *bool `json:"isApplicableForAllComputeModes,omitempty"`
SiteMode *string `json:"siteMode,omitempty"`
@@ -1940,10 +2327,10 @@
// StatusCodesBasedTrigger is statusCodeBasedTrigger
type StatusCodesBasedTrigger struct {
- Status *int `json:"status,omitempty"`
- SubStatus *int `json:"subStatus,omitempty"`
- Win32Status *int `json:"win32Status,omitempty"`
- Count *int `json:"count,omitempty"`
+ Status *int32 `json:"status,omitempty"`
+ SubStatus *int32 `json:"subStatus,omitempty"`
+ Win32Status *int32 `json:"win32Status,omitempty"`
+ Count *int32 `json:"count,omitempty"`
TimeInterval *string `json:"timeInterval,omitempty"`
}
@@ -1952,6 +2339,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -1978,6 +2366,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -2007,6 +2396,7 @@
type Usage struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -2026,8 +2416,8 @@
Name *string `json:"name,omitempty"`
ResourceName *string `json:"resourceName,omitempty"`
Unit *string `json:"unit,omitempty"`
- CurrentValue *int32 `json:"currentValue,omitempty"`
- Limit *int32 `json:"limit,omitempty"`
+ CurrentValue *int64 `json:"currentValue,omitempty"`
+ Limit *int64 `json:"limit,omitempty"`
NextResetTime *date.Time `json:"nextResetTime,omitempty"`
ComputeMode ComputeModeOptions `json:"computeMode,omitempty"`
SiteMode *string `json:"siteMode,omitempty"`
@@ -2038,6 +2428,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -2046,13 +2437,10 @@
// UserProperties is
type UserProperties struct {
- Name *string `json:"name,omitempty"`
- PublishingUserName *string `json:"publishingUserName,omitempty"`
- PublishingPassword *string `json:"publishingPassword,omitempty"`
- LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
- Metadata *string `json:"metadata,omitempty"`
- IsDeleted *bool `json:"isDeleted,omitempty"`
- ScmURI *string `json:"scmUri,omitempty"`
+ Name *string `json:"name,omitempty"`
+ PublishingUserName *string `json:"publishingUserName,omitempty"`
+ PublishingPassword *string `json:"publishingPassword,omitempty"`
+ ScmURI *string `json:"scmUri,omitempty"`
}
// VirtualApplication is
@@ -2072,8 +2460,8 @@
// VirtualIPMapping is class that represents a VIP mapping
type VirtualIPMapping struct {
VirtualIP *string `json:"virtualIP,omitempty"`
- InternalHTTPPort *int `json:"internalHttpPort,omitempty"`
- InternalHTTPSPort *int `json:"internalHttpsPort,omitempty"`
+ InternalHTTPPort *int32 `json:"internalHttpPort,omitempty"`
+ InternalHTTPSPort *int32 `json:"internalHttpsPort,omitempty"`
InUse *bool `json:"inUse,omitempty"`
}
@@ -2091,6 +2479,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -2109,24 +2498,21 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *VnetInfoProperties `json:"properties,omitempty"`
}
-// VnetInfoList is
-type VnetInfoList struct {
- autorest.Response `json:"-"`
- Value *[]VnetInfo `json:"value,omitempty"`
-}
-
// VnetInfoProperties is
type VnetInfoProperties struct {
VnetResourceID *string `json:"vnetResourceId,omitempty"`
CertThumbprint *string `json:"certThumbprint,omitempty"`
CertBlob *string `json:"certBlob,omitempty"`
Routes *[]VnetRoute `json:"routes,omitempty"`
+ ResyncRequired *bool `json:"resyncRequired,omitempty"`
+ DNSServers *string `json:"dnsServers,omitempty"`
}
// VnetRoute is vnetRoute contract used to pass routing information for a vnet.
@@ -2134,18 +2520,13 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *VnetRouteProperties `json:"properties,omitempty"`
}
-// VnetRouteList is
-type VnetRouteList struct {
- autorest.Response `json:"-"`
- Value *[]VnetRoute `json:"value,omitempty"`
-}
-
// VnetRouteProperties is
type VnetRouteProperties struct {
Name *string `json:"name,omitempty"`
@@ -2159,6 +2540,7 @@
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
+ Kind *string `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
@@ -2175,9 +2557,9 @@
// WorkerPoolProperties is
type WorkerPoolProperties struct {
- WorkerSizeID *int `json:"workerSizeId,omitempty"`
+ WorkerSizeID *int32 `json:"workerSizeId,omitempty"`
ComputeMode ComputeModeOptions `json:"computeMode,omitempty"`
WorkerSize *string `json:"workerSize,omitempty"`
- WorkerCount *int `json:"workerCount,omitempty"`
+ WorkerCount *int32 `json:"workerCount,omitempty"`
InstanceNames *[]string `json:"instanceNames,omitempty"`
}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/provider.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/provider.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/provider.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/provider.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// ProviderClient is the use these APIs to manage Azure Websites resources
@@ -48,21 +48,21 @@
}
// GetPublishingUser sends the get publishing user request.
-func (client ProviderClient) GetPublishingUser() (result User, ae error) {
+func (client ProviderClient) GetPublishingUser() (result User, err error) {
req, err := client.GetPublishingUserPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetPublishingUser", nil, "Failure preparing request")
}
resp, err := client.GetPublishingUserSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetPublishingUser", resp, "Failure sending request")
}
result, err = client.GetPublishingUserResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetPublishingUser", resp, "Failure responding to request")
}
return
@@ -71,21 +71,21 @@
// GetPublishingUserPreparer prepares the GetPublishingUser request.
func (client ProviderClient) GetPublishingUserPreparer() (*http.Request, error) {
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetPublishingUserSender sends the GetPublishingUser request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderClient) GetPublishingUserSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetPublishingUserResponder handles the response to the GetPublishingUser request. The method always
@@ -94,7 +94,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -104,21 +104,21 @@
// GetSourceControl sends the get source control request.
//
// sourceControlType is type of source control
-func (client ProviderClient) GetSourceControl(sourceControlType string) (result SourceControl, ae error) {
+func (client ProviderClient) GetSourceControl(sourceControlType string) (result SourceControl, err error) {
req, err := client.GetSourceControlPreparer(sourceControlType)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControl", nil, "Failure preparing request")
}
resp, err := client.GetSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControl", resp, "Failure sending request")
}
result, err = client.GetSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControl", resp, "Failure responding to request")
}
return
@@ -127,26 +127,25 @@
// GetSourceControlPreparer prepares the GetSourceControl request.
func (client ProviderClient) GetSourceControlPreparer(sourceControlType string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "sourceControlType": url.QueryEscape(sourceControlType),
+ "sourceControlType": autorest.Encode("path", sourceControlType),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSourceControlSender sends the GetSourceControl request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderClient) GetSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSourceControlResponder handles the response to the GetSourceControl request. The method always
@@ -155,7 +154,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -163,21 +162,21 @@
}
// GetSourceControls sends the get source controls request.
-func (client ProviderClient) GetSourceControls() (result SourceControlCollection, ae error) {
+func (client ProviderClient) GetSourceControls() (result SourceControlCollection, err error) {
req, err := client.GetSourceControlsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControls", nil, "Failure preparing request")
}
resp, err := client.GetSourceControlsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControls", resp, "Failure sending request")
}
result, err = client.GetSourceControlsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetSourceControls", resp, "Failure responding to request")
}
return
@@ -186,21 +185,21 @@
// GetSourceControlsPreparer prepares the GetSourceControls request.
func (client ProviderClient) GetSourceControlsPreparer() (*http.Request, error) {
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Web/sourcecontrols"),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSourceControlsSender sends the GetSourceControls request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderClient) GetSourceControlsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSourceControlsResponder handles the response to the GetSourceControls request. The method always
@@ -209,7 +208,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -219,21 +218,21 @@
// UpdatePublishingUser sends the update publishing user request.
//
// requestMessage is details of publishing user
-func (client ProviderClient) UpdatePublishingUser(requestMessage User) (result User, ae error) {
+func (client ProviderClient) UpdatePublishingUser(requestMessage User) (result User, err error) {
req, err := client.UpdatePublishingUserPreparer(requestMessage)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "UpdatePublishingUser", nil, "Failure preparing request")
}
resp, err := client.UpdatePublishingUserSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "UpdatePublishingUser", resp, "Failure sending request")
}
result, err = client.UpdatePublishingUserResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ProviderClient", "UpdatePublishingUser", resp, "Failure responding to request")
}
return
@@ -242,22 +241,23 @@
// UpdatePublishingUserPreparer prepares the UpdatePublishingUser request.
func (client ProviderClient) UpdatePublishingUserPreparer(requestMessage User) (*http.Request, error) {
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
autorest.WithJSON(requestMessage),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdatePublishingUserSender sends the UpdatePublishingUser request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderClient) UpdatePublishingUserSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdatePublishingUserResponder handles the response to the UpdatePublishingUser request. The method always
@@ -266,7 +266,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -277,21 +277,21 @@
//
// sourceControlType is type of source control requestMessage is source
// control token information
-func (client ProviderClient) UpdateSourceControl(sourceControlType string, requestMessage SourceControl) (result SourceControl, ae error) {
+func (client ProviderClient) UpdateSourceControl(sourceControlType string, requestMessage SourceControl) (result SourceControl, err error) {
req, err := client.UpdateSourceControlPreparer(sourceControlType, requestMessage)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "UpdateSourceControl", nil, "Failure preparing request")
}
resp, err := client.UpdateSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ProviderClient", "UpdateSourceControl", resp, "Failure sending request")
}
result, err = client.UpdateSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ProviderClient", "UpdateSourceControl", resp, "Failure responding to request")
}
return
@@ -300,27 +300,27 @@
// UpdateSourceControlPreparer prepares the UpdateSourceControl request.
func (client ProviderClient) UpdateSourceControlPreparer(sourceControlType string, requestMessage SourceControl) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "sourceControlType": url.QueryEscape(sourceControlType),
+ "sourceControlType": autorest.Encode("path", sourceControlType),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}"),
+ autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters),
autorest.WithJSON(requestMessage),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSourceControlSender sends the UpdateSourceControl request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderClient) UpdateSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSourceControlResponder handles the response to the UpdateSourceControl request. The method always
@@ -329,7 +329,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/recommendations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/recommendations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/recommendations.go 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/recommendations.go 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,332 @@
+package web
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "net/http"
+)
+
+// RecommendationsClient is the use these APIs to manage Azure Websites
+// resources through the Azure Resource Manager. All task operations conform
+// to the HTTP/1.1 protocol specification and each operation returns an
+// x-ms-request-id header that can be used to obtain information about the
+// request. You must make sure that requests made to these resources are
+// secure. For more information, see Authenticating
+// Azure Resource Manager requests.
+type RecommendationsClient struct {
+ ManagementClient
+}
+
+// NewRecommendationsClient creates an instance of the RecommendationsClient
+// client.
+func NewRecommendationsClient(subscriptionID string) RecommendationsClient {
+ return NewRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewRecommendationsClientWithBaseURI creates an instance of the
+// RecommendationsClient client.
+func NewRecommendationsClientWithBaseURI(baseURI string, subscriptionID string) RecommendationsClient {
+ return RecommendationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// GetRecommendationBySubscription sends the get recommendation by
+// subscription request.
+//
+// featured is if set, this API returns only the most critical recommendation
+// among the others. Otherwise this API returns all recommendations available
+// filter is return only channels specified in the filter. Filter is
+// specified by using OData syntax. Example: $filter=channels eq 'Api' or
+// channel eq 'Notification'
+func (client RecommendationsClient) GetRecommendationBySubscription(featured *bool, filter string) (result ListRecommendation, err error) {
+ req, err := client.GetRecommendationBySubscriptionPreparer(featured, filter)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationBySubscription", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetRecommendationBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationBySubscription", resp, "Failure sending request")
+ }
+
+ result, err = client.GetRecommendationBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetRecommendationBySubscriptionPreparer prepares the GetRecommendationBySubscription request.
+func (client RecommendationsClient) GetRecommendationBySubscriptionPreparer(featured *bool, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if featured != nil {
+ queryParameters["featured"] = autorest.Encode("query", *featured)
+ }
+ 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.Web/recommendations", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetRecommendationBySubscriptionSender sends the GetRecommendationBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) GetRecommendationBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetRecommendationBySubscriptionResponder handles the response to the GetRecommendationBySubscription request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) GetRecommendationBySubscriptionResponder(resp *http.Response) (result ListRecommendation, 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
+}
+
+// GetRecommendationHistoryForSite sends the get recommendation history for
+// site request.
+//
+// resourceGroupName is resource group name siteName is site name startTime is
+// the start time of a time range to query, e.g. $filter=startTime eq
+// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' endTime is
+// the end time of a time range to query, e.g. $filter=startTime eq
+// '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z'
+func (client RecommendationsClient) GetRecommendationHistoryForSite(resourceGroupName string, siteName string, startTime string, endTime string) (result ListRecommendation, err error) {
+ req, err := client.GetRecommendationHistoryForSitePreparer(resourceGroupName, siteName, startTime, endTime)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationHistoryForSite", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetRecommendationHistoryForSiteSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationHistoryForSite", resp, "Failure sending request")
+ }
+
+ result, err = client.GetRecommendationHistoryForSiteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendationHistoryForSite", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetRecommendationHistoryForSitePreparer prepares the GetRecommendationHistoryForSite request.
+func (client RecommendationsClient) GetRecommendationHistoryForSitePreparer(resourceGroupName string, siteName string, startTime string, endTime string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "siteName": autorest.Encode("path", siteName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if len(startTime) > 0 {
+ queryParameters["startTime"] = autorest.Encode("query", startTime)
+ }
+ if len(endTime) > 0 {
+ queryParameters["endTime"] = autorest.Encode("query", endTime)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetRecommendationHistoryForSiteSender sends the GetRecommendationHistoryForSite request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) GetRecommendationHistoryForSiteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetRecommendationHistoryForSiteResponder handles the response to the GetRecommendationHistoryForSite request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) GetRecommendationHistoryForSiteResponder(resp *http.Response) (result ListRecommendation, 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
+}
+
+// GetRecommendedRulesForSite sends the get recommended rules for site request.
+//
+// resourceGroupName is resource group name siteName is site name featured is
+// if set, this API returns only the most critical recommendation among the
+// others. Otherwise this API returns all recommendations available siteSku
+// is the name of site SKU. numSlots is the number of site slots associated
+// to the site
+func (client RecommendationsClient) GetRecommendedRulesForSite(resourceGroupName string, siteName string, featured *bool, siteSku string, numSlots *int32) (result ListRecommendation, err error) {
+ req, err := client.GetRecommendedRulesForSitePreparer(resourceGroupName, siteName, featured, siteSku, numSlots)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendedRulesForSite", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetRecommendedRulesForSiteSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendedRulesForSite", resp, "Failure sending request")
+ }
+
+ result, err = client.GetRecommendedRulesForSiteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRecommendedRulesForSite", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetRecommendedRulesForSitePreparer prepares the GetRecommendedRulesForSite request.
+func (client RecommendationsClient) GetRecommendedRulesForSitePreparer(resourceGroupName string, siteName string, featured *bool, siteSku string, numSlots *int32) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "siteName": autorest.Encode("path", siteName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+ if featured != nil {
+ queryParameters["featured"] = autorest.Encode("query", *featured)
+ }
+ if len(siteSku) > 0 {
+ queryParameters["siteSku"] = autorest.Encode("query", siteSku)
+ }
+ if numSlots != nil {
+ queryParameters["numSlots"] = autorest.Encode("query", *numSlots)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetRecommendedRulesForSiteSender sends the GetRecommendedRulesForSite request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) GetRecommendedRulesForSiteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetRecommendedRulesForSiteResponder handles the response to the GetRecommendedRulesForSite request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) GetRecommendedRulesForSiteResponder(resp *http.Response) (result ListRecommendation, 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
+}
+
+// GetRuleDetailsBySiteName sends the get rule details by site name request.
+//
+// resourceGroupName is resource group name siteName is site name name is
+// recommendation rule name
+func (client RecommendationsClient) GetRuleDetailsBySiteName(resourceGroupName string, siteName string, name string) (result RecommendationRule, err error) {
+ req, err := client.GetRuleDetailsBySiteNamePreparer(resourceGroupName, siteName, name)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsBySiteName", nil, "Failure preparing request")
+ }
+
+ resp, err := client.GetRuleDetailsBySiteNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsBySiteName", resp, "Failure sending request")
+ }
+
+ result, err = client.GetRuleDetailsBySiteNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsBySiteName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetRuleDetailsBySiteNamePreparer prepares the GetRuleDetailsBySiteName request.
+func (client RecommendationsClient) GetRuleDetailsBySiteNamePreparer(resourceGroupName string, siteName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "siteName": autorest.Encode("path", siteName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// GetRuleDetailsBySiteNameSender sends the GetRuleDetailsBySiteName request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) GetRuleDetailsBySiteNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// GetRuleDetailsBySiteNameResponder handles the response to the GetRuleDetailsBySiteName request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) GetRuleDetailsBySiteNameResponder(resp *http.Response) (result RecommendationRule, 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 -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/serverfarms.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/serverfarms.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/serverfarms.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/serverfarms.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// ServerFarmsClient is the use these APIs to manage Azure Websites resources
@@ -48,71 +48,75 @@
}
// CreateOrUpdateServerFarm sends the create or update server farm request.
+// This method may poll for completion. Polling can be canceled by passing
+// the cancel channel argument. The channel will be used to cancel polling
+// and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of App Service
// Plan serverFarmEnvelope is details of App Service Plan allowPendingState
// is oBSOLETE: If true, allow pending state for App Service Plan
-func (client ServerFarmsClient) CreateOrUpdateServerFarm(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (result ServerFarmWithRichSku, ae error) {
- req, err := client.CreateOrUpdateServerFarmPreparer(resourceGroupName, name, serverFarmEnvelope, allowPendingState)
+func (client ServerFarmsClient) CreateOrUpdateServerFarm(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateServerFarmPreparer(resourceGroupName, name, serverFarmEnvelope, allowPendingState, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateServerFarm", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateServerFarmSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateServerFarm", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateServerFarm", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateServerFarmPreparer prepares the CreateOrUpdateServerFarm request.
-func (client ServerFarmsClient) CreateOrUpdateServerFarmPreparer(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (*http.Request, error) {
+func (client ServerFarmsClient) CreateOrUpdateServerFarmPreparer(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if allowPendingState != nil {
- queryParameters["allowPendingState"] = allowPendingState
+ queryParameters["allowPendingState"] = autorest.Encode("query", *allowPendingState)
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters),
autorest.WithJSON(serverFarmEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateServerFarmSender sends the CreateOrUpdateServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) CreateOrUpdateServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateServerFarmResponder handles the response to the CreateOrUpdateServerFarm request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) CreateOrUpdateServerFarmResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
+func (client ServerFarmsClient) CreateOrUpdateServerFarmResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -121,21 +125,21 @@
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network routeName is name of the virtual
// network route route is the route object
-func (client ServerFarmsClient) CreateOrUpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
+func (client ServerFarmsClient) CreateOrUpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) {
req, err := client.CreateOrUpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateVnetRoute", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateVnetRouteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateVnetRoute", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateVnetRouteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "CreateOrUpdateVnetRoute", resp, "Failure responding to request")
}
return
@@ -144,31 +148,31 @@
// CreateOrUpdateVnetRoutePreparer prepares the CreateOrUpdateVnetRoute request.
func (client ServerFarmsClient) CreateOrUpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters),
autorest.WithJSON(route),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateVnetRouteSender sends the CreateOrUpdateVnetRoute request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) CreateOrUpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateVnetRouteResponder handles the response to the CreateOrUpdateVnetRoute request. The method always
@@ -177,7 +181,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -188,21 +192,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan
-func (client ServerFarmsClient) DeleteServerFarm(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client ServerFarmsClient) DeleteServerFarm(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteServerFarmPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteServerFarm", nil, "Failure preparing request")
}
resp, err := client.DeleteServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteServerFarm", resp, "Failure sending request")
}
result, err = client.DeleteServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteServerFarm", resp, "Failure responding to request")
}
return
@@ -211,37 +215,36 @@
// DeleteServerFarmPreparer prepares the DeleteServerFarm request.
func (client ServerFarmsClient) DeleteServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteServerFarmSender sends the DeleteServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) DeleteServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteServerFarmResponder handles the response to the DeleteServerFarm request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) DeleteServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ServerFarmsClient) DeleteServerFarmResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -253,21 +256,21 @@
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network routeName is name of the virtual
// network route
-func (client ServerFarmsClient) DeleteVnetRoute(resourceGroupName string, name string, vnetName string, routeName string) (result ObjectSet, ae error) {
+func (client ServerFarmsClient) DeleteVnetRoute(resourceGroupName string, name string, vnetName string, routeName string) (result SetObject, err error) {
req, err := client.DeleteVnetRoutePreparer(resourceGroupName, name, vnetName, routeName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteVnetRoute", nil, "Failure preparing request")
}
resp, err := client.DeleteVnetRouteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteVnetRoute", resp, "Failure sending request")
}
result, err = client.DeleteVnetRouteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "DeleteVnetRoute", resp, "Failure responding to request")
}
return
@@ -276,39 +279,38 @@
// DeleteVnetRoutePreparer prepares the DeleteVnetRoute request.
func (client ServerFarmsClient) DeleteVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteVnetRouteSender sends the DeleteVnetRoute request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) DeleteVnetRouteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// DeleteVnetRouteResponder handles the response to the DeleteVnetRoute request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) DeleteVnetRouteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ServerFarmsClient) DeleteVnetRouteResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -320,21 +322,21 @@
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network routeName is name of the virtual
// network route
-func (client ServerFarmsClient) GetRouteForVnet(resourceGroupName string, name string, vnetName string, routeName string) (result VnetRouteList, ae error) {
+func (client ServerFarmsClient) GetRouteForVnet(resourceGroupName string, name string, vnetName string, routeName string) (result ListVnetRoute, err error) {
req, err := client.GetRouteForVnetPreparer(resourceGroupName, name, vnetName, routeName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRouteForVnet", nil, "Failure preparing request")
}
resp, err := client.GetRouteForVnetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRouteForVnet", resp, "Failure sending request")
}
result, err = client.GetRouteForVnetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRouteForVnet", resp, "Failure responding to request")
}
return
@@ -343,39 +345,38 @@
// GetRouteForVnetPreparer prepares the GetRouteForVnet request.
func (client ServerFarmsClient) GetRouteForVnetPreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetRouteForVnetSender sends the GetRouteForVnet request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetRouteForVnetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetRouteForVnetResponder handles the response to the GetRouteForVnet request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) GetRouteForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
+func (client ServerFarmsClient) GetRouteForVnetResponder(resp *http.Response) (result ListVnetRoute, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -386,21 +387,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network
-func (client ServerFarmsClient) GetRoutesForVnet(resourceGroupName string, name string, vnetName string) (result VnetRouteList, ae error) {
+func (client ServerFarmsClient) GetRoutesForVnet(resourceGroupName string, name string, vnetName string) (result ListVnetRoute, err error) {
req, err := client.GetRoutesForVnetPreparer(resourceGroupName, name, vnetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRoutesForVnet", nil, "Failure preparing request")
}
resp, err := client.GetRoutesForVnetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRoutesForVnet", resp, "Failure sending request")
}
result, err = client.GetRoutesForVnetResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetRoutesForVnet", resp, "Failure responding to request")
}
return
@@ -409,38 +410,37 @@
// GetRoutesForVnetPreparer prepares the GetRoutesForVnet request.
func (client ServerFarmsClient) GetRoutesForVnetPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetRoutesForVnetSender sends the GetRoutesForVnet request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetRoutesForVnetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetRoutesForVnetResponder handles the response to the GetRoutesForVnet request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) GetRoutesForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
+func (client ServerFarmsClient) GetRoutesForVnetResponder(resp *http.Response) (result ListVnetRoute, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -451,21 +451,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan
-func (client ServerFarmsClient) GetServerFarm(resourceGroupName string, name string) (result ServerFarmWithRichSku, ae error) {
+func (client ServerFarmsClient) GetServerFarm(resourceGroupName string, name string) (result ServerFarmWithRichSku, err error) {
req, err := client.GetServerFarmPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarm", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarm", resp, "Failure sending request")
}
result, err = client.GetServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarm", resp, "Failure responding to request")
}
return
@@ -474,28 +474,27 @@
// GetServerFarmPreparer prepares the GetServerFarm request.
func (client ServerFarmsClient) GetServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmSender sends the GetServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmResponder handles the response to the GetServerFarm request. The method always
@@ -504,7 +503,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -516,21 +515,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan
-func (client ServerFarmsClient) GetServerFarmMetricDefintions(resourceGroupName string, name string) (result MetricDefinitionCollection, ae error) {
+func (client ServerFarmsClient) GetServerFarmMetricDefintions(resourceGroupName string, name string) (result MetricDefinitionCollection, err error) {
req, err := client.GetServerFarmMetricDefintionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetricDefintions", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmMetricDefintionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetricDefintions", resp, "Failure sending request")
}
result, err = client.GetServerFarmMetricDefintionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetricDefintions", resp, "Failure responding to request")
}
return
@@ -539,28 +538,27 @@
// GetServerFarmMetricDefintionsPreparer prepares the GetServerFarmMetricDefintions request.
func (client ServerFarmsClient) GetServerFarmMetricDefintionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmMetricDefintionsSender sends the GetServerFarmMetricDefintions request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmMetricDefintionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmMetricDefintionsResponder handles the response to the GetServerFarmMetricDefintions request. The method always
@@ -569,7 +567,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -585,21 +583,21 @@
// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
// duration'[Hour|Minute|Day]'.
-func (client ServerFarmsClient) GetServerFarmMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client ServerFarmsClient) GetServerFarmMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetServerFarmMetricsPreparer(resourceGroupName, name, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetrics", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetrics", resp, "Failure sending request")
}
result, err = client.GetServerFarmMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmMetrics", resp, "Failure responding to request")
}
return
@@ -608,34 +606,33 @@
// GetServerFarmMetricsPreparer prepares the GetServerFarmMetrics request.
func (client ServerFarmsClient) GetServerFarmMetricsPreparer(resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmMetricsSender sends the GetServerFarmMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmMetricsResponder handles the response to the GetServerFarmMetrics request. The method always
@@ -644,7 +641,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -655,21 +652,21 @@
//
// resourceGroupName is name of resource group name is name of server farm
// operationID is id of Server farm operation">
-func (client ServerFarmsClient) GetServerFarmOperation(resourceGroupName string, name string, operationID string) (result ServerFarmWithRichSku, ae error) {
+func (client ServerFarmsClient) GetServerFarmOperation(resourceGroupName string, name string, operationID string) (result ServerFarmWithRichSku, err error) {
req, err := client.GetServerFarmOperationPreparer(resourceGroupName, name, operationID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmOperation", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmOperationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmOperation", resp, "Failure sending request")
}
result, err = client.GetServerFarmOperationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmOperation", resp, "Failure responding to request")
}
return
@@ -678,29 +675,28 @@
// GetServerFarmOperationPreparer prepares the GetServerFarmOperation request.
func (client ServerFarmsClient) GetServerFarmOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmOperationSender sends the GetServerFarmOperation request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmOperationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmOperationResponder handles the response to the GetServerFarmOperation request. The method always
@@ -709,7 +705,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -719,21 +715,21 @@
// GetServerFarms sends the get server farms request.
//
// resourceGroupName is name of resource group
-func (client ServerFarmsClient) GetServerFarms(resourceGroupName string) (result ServerFarmCollection, ae error) {
+func (client ServerFarmsClient) GetServerFarms(resourceGroupName string) (result ServerFarmCollection, err error) {
req, err := client.GetServerFarmsPreparer(resourceGroupName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarms", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarms", resp, "Failure sending request")
}
result, err = client.GetServerFarmsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarms", resp, "Failure responding to request")
}
return
@@ -742,27 +738,26 @@
// GetServerFarmsPreparer prepares the GetServerFarms request.
func (client ServerFarmsClient) GetServerFarmsPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmsSender sends the GetServerFarms request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmsResponder handles the response to the GetServerFarms request. The method always
@@ -771,7 +766,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -787,21 +782,21 @@
// the list filter is supported filter: $filter=state eq running. Returns
// only web apps that are currently running top is list page size. If
// specified, results are paged.
-func (client ServerFarmsClient) GetServerFarmSites(resourceGroupName string, name string, skipToken string, filter string, top string) (result SiteCollection, ae error) {
+func (client ServerFarmsClient) GetServerFarmSites(resourceGroupName string, name string, skipToken string, filter string, top string) (result SiteCollection, err error) {
req, err := client.GetServerFarmSitesPreparer(resourceGroupName, name, skipToken, filter, top)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", resp, "Failure sending request")
}
result, err = client.GetServerFarmSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", resp, "Failure responding to request")
}
return
@@ -810,37 +805,36 @@
// GetServerFarmSitesPreparer prepares the GetServerFarmSites request.
func (client ServerFarmsClient) GetServerFarmSitesPreparer(resourceGroupName string, name string, skipToken string, filter string, top string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(skipToken) > 0 {
- queryParameters["$skipToken"] = skipToken
+ queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(top) > 0 {
- queryParameters["$top"] = top
+ queryParameters["$top"] = autorest.Encode("query", top)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmSitesSender sends the GetServerFarmSites request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmSitesResponder handles the response to the GetServerFarmSites request. The method always
@@ -849,7 +843,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -857,10 +851,10 @@
}
// GetServerFarmSitesNextResults retrieves the next set of results, if any.
-func (client ServerFarmsClient) GetServerFarmSitesNextResults(lastResults SiteCollection) (result SiteCollection, ae error) {
+func (client ServerFarmsClient) GetServerFarmSitesNextResults(lastResults SiteCollection) (result SiteCollection, err error) {
req, err := lastResults.SiteCollectionPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing next results request request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", nil, "Failure preparing next results request request")
}
if req == nil {
return
@@ -869,12 +863,12 @@
resp, err := client.GetServerFarmSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending next results request request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", resp, "Failure sending next results request request")
}
result, err = client.GetServerFarmSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to next results request request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmSites", resp, "Failure responding to next results request request")
}
return
@@ -885,21 +879,21 @@
// resourceGroupName is name of resource group name is name of the App Service
// Plan vnetName is name of the virtual network gatewayName is name of the
// gateway. Only the 'primary' gateway is supported.
-func (client ServerFarmsClient) GetServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, ae error) {
+func (client ServerFarmsClient) GetServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) {
req, err := client.GetServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmVnetGateway", nil, "Failure preparing request")
}
resp, err := client.GetServerFarmVnetGatewaySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmVnetGateway", resp, "Failure sending request")
}
result, err = client.GetServerFarmVnetGatewayResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetServerFarmVnetGateway", resp, "Failure responding to request")
}
return
@@ -908,30 +902,29 @@
// GetServerFarmVnetGatewayPreparer prepares the GetServerFarmVnetGateway request.
func (client ServerFarmsClient) GetServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetServerFarmVnetGatewaySender sends the GetServerFarmVnetGateway request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetServerFarmVnetGatewayResponder handles the response to the GetServerFarmVnetGateway request. The method always
@@ -940,7 +933,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -951,21 +944,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network
-func (client ServerFarmsClient) GetVnetFromServerFarm(resourceGroupName string, name string, vnetName string) (result VnetInfo, ae error) {
+func (client ServerFarmsClient) GetVnetFromServerFarm(resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) {
req, err := client.GetVnetFromServerFarmPreparer(resourceGroupName, name, vnetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetFromServerFarm", nil, "Failure preparing request")
}
resp, err := client.GetVnetFromServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetFromServerFarm", resp, "Failure sending request")
}
result, err = client.GetVnetFromServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetFromServerFarm", resp, "Failure responding to request")
}
return
@@ -974,29 +967,28 @@
// GetVnetFromServerFarmPreparer prepares the GetVnetFromServerFarm request.
func (client ServerFarmsClient) GetVnetFromServerFarmPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetVnetFromServerFarmSender sends the GetVnetFromServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetVnetFromServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetVnetFromServerFarmResponder handles the response to the GetVnetFromServerFarm request. The method always
@@ -1005,7 +997,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1016,21 +1008,21 @@
//
// resourceGroupName is name of resource group name is name of App Service
// Plan
-func (client ServerFarmsClient) GetVnetsForServerFarm(resourceGroupName string, name string) (result VnetInfoList, ae error) {
+func (client ServerFarmsClient) GetVnetsForServerFarm(resourceGroupName string, name string) (result ListVnetInfo, err error) {
req, err := client.GetVnetsForServerFarmPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetsForServerFarm", nil, "Failure preparing request")
}
resp, err := client.GetVnetsForServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetsForServerFarm", resp, "Failure sending request")
}
result, err = client.GetVnetsForServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "GetVnetsForServerFarm", resp, "Failure responding to request")
}
return
@@ -1039,37 +1031,36 @@
// GetVnetsForServerFarmPreparer prepares the GetVnetsForServerFarm request.
func (client ServerFarmsClient) GetVnetsForServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetVnetsForServerFarmSender sends the GetVnetsForServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) GetVnetsForServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetVnetsForServerFarmResponder handles the response to the GetVnetsForServerFarm request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) GetVnetsForServerFarmResponder(resp *http.Response) (result VnetInfoList, err error) {
+func (client ServerFarmsClient) GetVnetsForServerFarmResponder(resp *http.Response) (result ListVnetInfo, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1079,22 +1070,22 @@
// RebootWorkerForServerFarm sends the reboot worker for server farm request.
//
// resourceGroupName is name of resource group name is name of server farm
-// workerName is name of worker machine, typically IP address
-func (client ServerFarmsClient) RebootWorkerForServerFarm(resourceGroupName string, name string, workerName string) (result ObjectSet, ae error) {
+// workerName is name of worker machine, typically starts with RD
+func (client ServerFarmsClient) RebootWorkerForServerFarm(resourceGroupName string, name string, workerName string) (result SetObject, err error) {
req, err := client.RebootWorkerForServerFarmPreparer(resourceGroupName, name, workerName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RebootWorkerForServerFarm", nil, "Failure preparing request")
}
resp, err := client.RebootWorkerForServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RebootWorkerForServerFarm", resp, "Failure sending request")
}
result, err = client.RebootWorkerForServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RebootWorkerForServerFarm", resp, "Failure responding to request")
}
return
@@ -1103,38 +1094,37 @@
// RebootWorkerForServerFarmPreparer prepares the RebootWorkerForServerFarm request.
func (client ServerFarmsClient) RebootWorkerForServerFarmPreparer(resourceGroupName string, name string, workerName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "workerName": url.QueryEscape(workerName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "workerName": autorest.Encode("path", workerName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RebootWorkerForServerFarmSender sends the RebootWorkerForServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) RebootWorkerForServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RebootWorkerForServerFarmResponder handles the response to the RebootWorkerForServerFarm request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) RebootWorkerForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ServerFarmsClient) RebootWorkerForServerFarmResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1147,21 +1137,21 @@
// Plan softRestart is soft restart applies the configuration settings and
// restarts the apps if necessary. Hard restart always restarts and
// reprovisions the apps
-func (client ServerFarmsClient) RestartSitesForServerFarm(resourceGroupName string, name string, softRestart *bool) (result ObjectSet, ae error) {
+func (client ServerFarmsClient) RestartSitesForServerFarm(resourceGroupName string, name string, softRestart *bool) (result SetObject, err error) {
req, err := client.RestartSitesForServerFarmPreparer(resourceGroupName, name, softRestart)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RestartSitesForServerFarm", nil, "Failure preparing request")
}
resp, err := client.RestartSitesForServerFarmSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RestartSitesForServerFarm", resp, "Failure sending request")
}
result, err = client.RestartSitesForServerFarmResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "RestartSitesForServerFarm", resp, "Failure responding to request")
}
return
@@ -1170,40 +1160,39 @@
// RestartSitesForServerFarmPreparer prepares the RestartSitesForServerFarm request.
func (client ServerFarmsClient) RestartSitesForServerFarmPreparer(resourceGroupName string, name string, softRestart *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if softRestart != nil {
- queryParameters["softRestart"] = softRestart
+ queryParameters["softRestart"] = autorest.Encode("query", *softRestart)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RestartSitesForServerFarmSender sends the RestartSitesForServerFarm request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) RestartSitesForServerFarmSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RestartSitesForServerFarmResponder handles the response to the RestartSitesForServerFarm request. The method always
// closes the http.Response Body.
-func (client ServerFarmsClient) RestartSitesForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client ServerFarmsClient) RestartSitesForServerFarmResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1217,21 +1206,21 @@
// Plan vnetName is the name of the virtual network gatewayName is the name
// of the gateway. Only 'primary' is supported. connectionEnvelope is the
// gateway entity.
-func (client ServerFarmsClient) UpdateServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, ae error) {
+func (client ServerFarmsClient) UpdateServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) {
req, err := client.UpdateServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateServerFarmVnetGateway", nil, "Failure preparing request")
}
resp, err := client.UpdateServerFarmVnetGatewaySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateServerFarmVnetGateway", resp, "Failure sending request")
}
result, err = client.UpdateServerFarmVnetGatewayResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateServerFarmVnetGateway", resp, "Failure responding to request")
}
return
@@ -1240,31 +1229,31 @@
// UpdateServerFarmVnetGatewayPreparer prepares the UpdateServerFarmVnetGateway request.
func (client ServerFarmsClient) UpdateServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateServerFarmVnetGatewaySender sends the UpdateServerFarmVnetGateway request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) UpdateServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateServerFarmVnetGatewayResponder handles the response to the UpdateServerFarmVnetGateway request. The method always
@@ -1273,7 +1262,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1285,21 +1274,21 @@
// resourceGroupName is name of resource group name is name of App Service
// Plan vnetName is name of virtual network routeName is name of the virtual
// network route route is the route object
-func (client ServerFarmsClient) UpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
+func (client ServerFarmsClient) UpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) {
req, err := client.UpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateVnetRoute", nil, "Failure preparing request")
}
resp, err := client.UpdateVnetRouteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateVnetRoute", resp, "Failure sending request")
}
result, err = client.UpdateVnetRouteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.ServerFarmsClient", "UpdateVnetRoute", resp, "Failure responding to request")
}
return
@@ -1308,31 +1297,31 @@
// UpdateVnetRoutePreparer prepares the UpdateVnetRoute request.
func (client ServerFarmsClient) UpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "routeName": url.QueryEscape(routeName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "routeName": autorest.Encode("path", routeName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters),
autorest.WithJSON(route),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateVnetRouteSender sends the UpdateVnetRoute request. The method will close the
// http.Response Body if it receives an error.
func (client ServerFarmsClient) UpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// UpdateVnetRouteResponder handles the response to the UpdateVnetRoute request. The method always
@@ -1341,7 +1330,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/sites.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/sites.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/sites.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/sites.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// SitesClient is the use these APIs to manage Azure Websites resources
@@ -48,21 +48,21 @@
// AddSitePremierAddOn sends the add site premier add on request.
//
-func (client SitesClient) AddSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest) (result ObjectSet, ae error) {
+func (client SitesClient) AddSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest) (result SetObject, err error) {
req, err := client.AddSitePremierAddOnPreparer(resourceGroupName, name, premierAddOnName, premierAddOn)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOn", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOn", nil, "Failure preparing request")
}
resp, err := client.AddSitePremierAddOnSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOn", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOn", resp, "Failure sending request")
}
result, err = client.AddSitePremierAddOnResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOn", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOn", resp, "Failure responding to request")
}
return
@@ -71,39 +71,39 @@
// AddSitePremierAddOnPreparer prepares the AddSitePremierAddOn request.
func (client SitesClient) AddSitePremierAddOnPreparer(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters),
autorest.WithJSON(premierAddOn),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// AddSitePremierAddOnSender sends the AddSitePremierAddOn request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) AddSitePremierAddOnSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// AddSitePremierAddOnResponder handles the response to the AddSitePremierAddOn request. The method always
// closes the http.Response Body.
-func (client SitesClient) AddSitePremierAddOnResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) AddSitePremierAddOnResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -112,21 +112,21 @@
// AddSitePremierAddOnSlot sends the add site premier add on slot request.
//
-func (client SitesClient) AddSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) AddSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest, slot string) (result SetObject, err error) {
req, err := client.AddSitePremierAddOnSlotPreparer(resourceGroupName, name, premierAddOnName, premierAddOn, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOnSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOnSlot", nil, "Failure preparing request")
}
resp, err := client.AddSitePremierAddOnSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOnSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOnSlot", resp, "Failure sending request")
}
result, err = client.AddSitePremierAddOnSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "AddSitePremierAddOnSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "AddSitePremierAddOnSlot", resp, "Failure responding to request")
}
return
@@ -135,40 +135,40 @@
// AddSitePremierAddOnSlotPreparer prepares the AddSitePremierAddOnSlot request.
func (client SitesClient) AddSitePremierAddOnSlotPreparer(resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnRequest, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters),
autorest.WithJSON(premierAddOn),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// AddSitePremierAddOnSlotSender sends the AddSitePremierAddOnSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) AddSitePremierAddOnSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// AddSitePremierAddOnSlotResponder handles the response to the AddSitePremierAddOnSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) AddSitePremierAddOnSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) AddSitePremierAddOnSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -182,21 +182,21 @@
// Settings from that slot will be applied on the source slot slot is name of
// the source slot. Settings from the target slot will be applied onto this
// slot
-func (client SitesClient) ApplySlotConfigSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) ApplySlotConfigSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SetObject, err error) {
req, err := client.ApplySlotConfigSlotPreparer(resourceGroupName, name, slotSwapEntity, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigSlot", nil, "Failure preparing request")
}
resp, err := client.ApplySlotConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigSlot", resp, "Failure sending request")
}
result, err = client.ApplySlotConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigSlot", resp, "Failure responding to request")
}
return
@@ -205,39 +205,39 @@
// ApplySlotConfigSlotPreparer prepares the ApplySlotConfigSlot request.
func (client SitesClient) ApplySlotConfigSlotPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ApplySlotConfigSlotSender sends the ApplySlotConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ApplySlotConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ApplySlotConfigSlotResponder handles the response to the ApplySlotConfigSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ApplySlotConfigSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ApplySlotConfigSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -250,21 +250,21 @@
// resourceGroupName is name of resource group name is name of web app
// slotSwapEntity is request body that contains the target slot name.
// Settings from that slot will be applied on the source slot
-func (client SitesClient) ApplySlotConfigToProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result ObjectSet, ae error) {
+func (client SitesClient) ApplySlotConfigToProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result SetObject, err error) {
req, err := client.ApplySlotConfigToProductionPreparer(resourceGroupName, name, slotSwapEntity)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigToProduction", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigToProduction", nil, "Failure preparing request")
}
resp, err := client.ApplySlotConfigToProductionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigToProduction", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigToProduction", resp, "Failure sending request")
}
result, err = client.ApplySlotConfigToProductionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ApplySlotConfigToProduction", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ApplySlotConfigToProduction", resp, "Failure responding to request")
}
return
@@ -273,38 +273,38 @@
// ApplySlotConfigToProductionPreparer prepares the ApplySlotConfigToProduction request.
func (client SitesClient) ApplySlotConfigToProductionPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ApplySlotConfigToProductionSender sends the ApplySlotConfigToProduction request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ApplySlotConfigToProductionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ApplySlotConfigToProductionResponder handles the response to the ApplySlotConfigToProduction request. The method always
// closes the http.Response Body.
-func (client SitesClient) ApplySlotConfigToProductionResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ApplySlotConfigToProductionResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -315,21 +315,21 @@
//
// resourceGroupName is name of resource group name is name of web app request
// is information on backup request
-func (client SitesClient) BackupSite(resourceGroupName string, name string, request BackupRequest) (result BackupItem, ae error) {
+func (client SitesClient) BackupSite(resourceGroupName string, name string, request BackupRequest) (result BackupItem, err error) {
req, err := client.BackupSitePreparer(resourceGroupName, name, request)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "BackupSite", nil, "Failure preparing request")
}
resp, err := client.BackupSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "BackupSite", resp, "Failure sending request")
}
result, err = client.BackupSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "BackupSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "BackupSite", resp, "Failure responding to request")
}
return
@@ -338,29 +338,29 @@
// BackupSitePreparer prepares the BackupSite request.
func (client SitesClient) BackupSitePreparer(resourceGroupName string, name string, request BackupRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// BackupSiteSender sends the BackupSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) BackupSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// BackupSiteResponder handles the response to the BackupSite request. The method always
@@ -369,213 +369,357 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// BackupSiteDeprecated sends the backup site deprecated request.
+// BackupSiteSlot sends the backup site slot request.
//
// resourceGroupName is name of resource group name is name of web app request
-// is information on backup request
-func (client SitesClient) BackupSiteDeprecated(resourceGroupName string, name string, request BackupRequest) (result BackupItem, ae error) {
- req, err := client.BackupSiteDeprecatedPreparer(resourceGroupName, name, request)
+// is information on backup request slot is name of web app slot. If not
+// specified then will default to production slot.
+func (client SitesClient) BackupSiteSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupItem, err error) {
+ req, err := client.BackupSiteSlotPreparer(resourceGroupName, name, request, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecated", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "BackupSiteSlot", nil, "Failure preparing request")
}
- resp, err := client.BackupSiteDeprecatedSender(req)
+ resp, err := client.BackupSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecated", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "BackupSiteSlot", resp, "Failure sending request")
}
- result, err = client.BackupSiteDeprecatedResponder(resp)
+ result, err = client.BackupSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecated", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "BackupSiteSlot", resp, "Failure responding to request")
}
return
}
-// BackupSiteDeprecatedPreparer prepares the BackupSiteDeprecated request.
-func (client SitesClient) BackupSiteDeprecatedPreparer(resourceGroupName string, name string, request BackupRequest) (*http.Request, error) {
+// BackupSiteSlotPreparer prepares the BackupSiteSlot request.
+func (client SitesClient) BackupSiteSlotPreparer(resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
- autorest.AsPut(),
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// BackupSiteDeprecatedSender sends the BackupSiteDeprecated request. The method will close the
+// BackupSiteSlotSender sends the BackupSiteSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) BackupSiteDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) BackupSiteSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// BackupSiteDeprecatedResponder handles the response to the BackupSiteDeprecated request. The method always
+// BackupSiteSlotResponder handles the response to the BackupSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) BackupSiteDeprecatedResponder(resp *http.Response) (result BackupItem, err error) {
+func (client SitesClient) BackupSiteSlotResponder(resp *http.Response) (result BackupItem, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// BackupSiteDeprecatedSlot sends the backup site deprecated slot request.
+// CreateDeployment sends the create deployment request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on backup request slot is name of web app slot. If not
-// specified then will default to production slot.
-func (client SitesClient) BackupSiteDeprecatedSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupItem, ae error) {
- req, err := client.BackupSiteDeprecatedSlotPreparer(resourceGroupName, name, request, slot)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment deployment is details of deployment
+func (client SitesClient) CreateDeployment(resourceGroupName string, name string, id string, deployment Deployment) (result Deployment, err error) {
+ req, err := client.CreateDeploymentPreparer(resourceGroupName, name, id, deployment)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecatedSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeployment", nil, "Failure preparing request")
}
- resp, err := client.BackupSiteDeprecatedSlotSender(req)
+ resp, err := client.CreateDeploymentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecatedSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeployment", resp, "Failure sending request")
}
- result, err = client.BackupSiteDeprecatedSlotResponder(resp)
+ result, err = client.CreateDeploymentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteDeprecatedSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeployment", resp, "Failure responding to request")
}
return
}
-// BackupSiteDeprecatedSlotPreparer prepares the BackupSiteDeprecatedSlot request.
-func (client SitesClient) BackupSiteDeprecatedSlotPreparer(resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) {
+// CreateDeploymentPreparer prepares the CreateDeployment request.
+func (client SitesClient) CreateDeploymentPreparer(resourceGroupName string, name string, id string, deployment Deployment) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters),
+ autorest.WithJSON(deployment),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// BackupSiteDeprecatedSlotSender sends the BackupSiteDeprecatedSlot request. The method will close the
+// CreateDeploymentSender sends the CreateDeployment request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) BackupSiteDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) CreateDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// BackupSiteDeprecatedSlotResponder handles the response to the BackupSiteDeprecatedSlot request. The method always
+// CreateDeploymentResponder handles the response to the CreateDeployment request. The method always
// closes the http.Response Body.
-func (client SitesClient) BackupSiteDeprecatedSlotResponder(resp *http.Response) (result BackupItem, err error) {
+func (client SitesClient) CreateDeploymentResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// BackupSiteSlot sends the backup site slot request.
+// CreateDeploymentSlot sends the create deployment slot request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on backup request slot is name of web app slot. If not
-// specified then will default to production slot.
-func (client SitesClient) BackupSiteSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupItem, ae error) {
- req, err := client.BackupSiteSlotPreparer(resourceGroupName, name, request, slot)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot. deployment is details of deployment
+func (client SitesClient) CreateDeploymentSlot(resourceGroupName string, name string, id string, slot string, deployment Deployment) (result Deployment, err error) {
+ req, err := client.CreateDeploymentSlotPreparer(resourceGroupName, name, id, slot, deployment)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeploymentSlot", nil, "Failure preparing request")
}
- resp, err := client.BackupSiteSlotSender(req)
+ resp, err := client.CreateDeploymentSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeploymentSlot", resp, "Failure sending request")
}
- result, err = client.BackupSiteSlotResponder(resp)
+ result, err = client.CreateDeploymentSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "BackupSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateDeploymentSlot", resp, "Failure responding to request")
}
return
}
-// BackupSiteSlotPreparer prepares the BackupSiteSlot request.
-func (client SitesClient) BackupSiteSlotPreparer(resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) {
+// CreateDeploymentSlotPreparer prepares the CreateDeploymentSlot request.
+func (client SitesClient) CreateDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string, deployment Deployment) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
- autorest.AsPost(),
+ autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters),
+ autorest.WithJSON(deployment),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// BackupSiteSlotSender sends the BackupSiteSlot request. The method will close the
+// CreateDeploymentSlotSender sends the CreateDeploymentSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) BackupSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) CreateDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// BackupSiteSlotResponder handles the response to the BackupSiteSlot request. The method always
+// CreateDeploymentSlotResponder handles the response to the CreateDeploymentSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) BackupSiteSlotResponder(resp *http.Response) (result BackupItem, err error) {
+func (client SitesClient) CreateDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateInstanceDeployment sends the create instance deployment request.
+//
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment instanceID is id of web app instance deployment is
+// details of deployment
+func (client SitesClient) CreateInstanceDeployment(resourceGroupName string, name string, id string, instanceID string, deployment Deployment) (result Deployment, err error) {
+ req, err := client.CreateInstanceDeploymentPreparer(resourceGroupName, name, id, instanceID, deployment)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeployment", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateInstanceDeploymentSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeployment", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateInstanceDeploymentResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeployment", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateInstanceDeploymentPreparer prepares the CreateInstanceDeployment request.
+func (client SitesClient) CreateInstanceDeploymentPreparer(resourceGroupName string, name string, id string, instanceID string, deployment Deployment) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/deployments/{id}", pathParameters),
+ autorest.WithJSON(deployment),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateInstanceDeploymentSender sends the CreateInstanceDeployment request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) CreateInstanceDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateInstanceDeploymentResponder handles the response to the CreateInstanceDeployment request. The method always
+// closes the http.Response Body.
+func (client SitesClient) CreateInstanceDeploymentResponder(resp *http.Response) (result Deployment, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CreateInstanceDeploymentSlot sends the create instance deployment slot
+// request.
+//
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot. instanceID is id of web app instance
+// deployment is details of deployment
+func (client SitesClient) CreateInstanceDeploymentSlot(resourceGroupName string, name string, id string, slot string, instanceID string, deployment Deployment) (result Deployment, err error) {
+ req, err := client.CreateInstanceDeploymentSlotPreparer(resourceGroupName, name, id, slot, instanceID, deployment)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeploymentSlot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.CreateInstanceDeploymentSlotSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeploymentSlot", resp, "Failure sending request")
+ }
+
+ result, err = client.CreateInstanceDeploymentSlotResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateInstanceDeploymentSlot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateInstanceDeploymentSlotPreparer prepares the CreateInstanceDeploymentSlot request.
+func (client SitesClient) CreateInstanceDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string, instanceID string, deployment Deployment) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsJSON(),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/deployments/{id}", pathParameters),
+ autorest.WithJSON(deployment),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// CreateInstanceDeploymentSlotSender sends the CreateInstanceDeploymentSlot request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) CreateInstanceDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// CreateInstanceDeploymentSlotResponder handles the response to the CreateInstanceDeploymentSlot request. The method always
+// closes the http.Response Body.
+func (client SitesClient) CreateInstanceDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// CreateOrUpdateSite sends the create or update site request.
+// CreateOrUpdateSite sends the create or update site request. This method may
+// poll for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of the resource group name is name of the web app
// siteEnvelope is details of web app if it exists already
@@ -586,76 +730,77 @@
// not verified. forceDNSRegistration is if true, web app hostname is force
// registered with DNS ttlInSeconds is time to live in seconds for web app's
// default domain name
-func (client SitesClient) CreateOrUpdateSite(resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string) (result Site, ae error) {
- req, err := client.CreateOrUpdateSitePreparer(resourceGroupName, name, siteEnvelope, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, ttlInSeconds)
+func (client SitesClient) CreateOrUpdateSite(resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateSitePreparer(resourceGroupName, name, siteEnvelope, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, ttlInSeconds, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSite", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSite", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSite", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSite", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateSitePreparer prepares the CreateOrUpdateSite request.
-func (client SitesClient) CreateOrUpdateSitePreparer(resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string) (*http.Request, error) {
+func (client SitesClient) CreateOrUpdateSitePreparer(resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(skipDNSRegistration) > 0 {
- queryParameters["skipDnsRegistration"] = skipDNSRegistration
+ queryParameters["skipDnsRegistration"] = autorest.Encode("query", skipDNSRegistration)
}
if len(skipCustomDomainVerification) > 0 {
- queryParameters["skipCustomDomainVerification"] = skipCustomDomainVerification
+ queryParameters["skipCustomDomainVerification"] = autorest.Encode("query", skipCustomDomainVerification)
}
if len(forceDNSRegistration) > 0 {
- queryParameters["forceDnsRegistration"] = forceDNSRegistration
+ queryParameters["forceDnsRegistration"] = autorest.Encode("query", forceDNSRegistration)
}
if len(ttlInSeconds) > 0 {
- queryParameters["ttlInSeconds"] = ttlInSeconds
+ queryParameters["ttlInSeconds"] = autorest.Encode("query", ttlInSeconds)
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters),
autorest.WithJSON(siteEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSiteSender sends the CreateOrUpdateSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateSiteResponder handles the response to the CreateOrUpdateSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) CreateOrUpdateSiteResponder(resp *http.Response) (result Site, err error) {
+func (client SitesClient) CreateOrUpdateSiteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -664,21 +809,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteConfig is request body that contains the configuraiton setting for the
// web app
-func (client SitesClient) CreateOrUpdateSiteConfig(resourceGroupName string, name string, siteConfig SiteConfig) (result SiteConfig, ae error) {
+func (client SitesClient) CreateOrUpdateSiteConfig(resourceGroupName string, name string, siteConfig SiteConfig) (result SiteConfig, err error) {
req, err := client.CreateOrUpdateSiteConfigPreparer(resourceGroupName, name, siteConfig)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfig", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfig", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfig", resp, "Failure responding to request")
}
return
@@ -687,29 +832,29 @@
// CreateOrUpdateSiteConfigPreparer prepares the CreateOrUpdateSiteConfig request.
func (client SitesClient) CreateOrUpdateSiteConfigPreparer(resourceGroupName string, name string, siteConfig SiteConfig) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters),
autorest.WithJSON(siteConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteConfigSender sends the CreateOrUpdateSiteConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteConfigResponder handles the response to the CreateOrUpdateSiteConfig request. The method always
@@ -718,7 +863,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -732,21 +877,21 @@
// siteConfig is request body that contains the configuraiton setting for the
// web app slot is name of web app slot. If not specified then will default
// to production slot.
-func (client SitesClient) CreateOrUpdateSiteConfigSlot(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (result SiteConfig, ae error) {
+func (client SitesClient) CreateOrUpdateSiteConfigSlot(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (result SiteConfig, err error) {
req, err := client.CreateOrUpdateSiteConfigSlotPreparer(resourceGroupName, name, siteConfig, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfigSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfigSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteConfigSlot", resp, "Failure responding to request")
}
return
@@ -755,30 +900,30 @@
// CreateOrUpdateSiteConfigSlotPreparer prepares the CreateOrUpdateSiteConfigSlot request.
func (client SitesClient) CreateOrUpdateSiteConfigSlotPreparer(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters),
autorest.WithJSON(siteConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteConfigSlotSender sends the CreateOrUpdateSiteConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteConfigSlotResponder handles the response to the CreateOrUpdateSiteConfigSlot request. The method always
@@ -787,7 +932,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -799,21 +944,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// hostName is name of host hostNameBinding is host name binding information
-func (client SitesClient) CreateOrUpdateSiteHostNameBinding(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, ae error) {
+func (client SitesClient) CreateOrUpdateSiteHostNameBinding(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, err error) {
req, err := client.CreateOrUpdateSiteHostNameBindingPreparer(resourceGroupName, name, hostName, hostNameBinding)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBinding", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBinding", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteHostNameBindingSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBinding", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBinding", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteHostNameBindingResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBinding", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBinding", resp, "Failure responding to request")
}
return
@@ -822,30 +967,30 @@
// CreateOrUpdateSiteHostNameBindingPreparer prepares the CreateOrUpdateSiteHostNameBinding request.
func (client SitesClient) CreateOrUpdateSiteHostNameBindingPreparer(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters),
autorest.WithJSON(hostNameBinding),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteHostNameBindingSender sends the CreateOrUpdateSiteHostNameBinding request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteHostNameBindingSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteHostNameBindingResponder handles the response to the CreateOrUpdateSiteHostNameBinding request. The method always
@@ -854,7 +999,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -868,21 +1013,21 @@
// hostName is name of host hostNameBinding is host name binding information
// slot is name of web app slot. If not specified then will default to
// production slot.
-func (client SitesClient) CreateOrUpdateSiteHostNameBindingSlot(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, ae error) {
+func (client SitesClient) CreateOrUpdateSiteHostNameBindingSlot(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, err error) {
req, err := client.CreateOrUpdateSiteHostNameBindingSlotPreparer(resourceGroupName, name, hostName, hostNameBinding, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteHostNameBindingSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteHostNameBindingSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteHostNameBindingSlot", resp, "Failure responding to request")
}
return
@@ -891,31 +1036,31 @@
// CreateOrUpdateSiteHostNameBindingSlotPreparer prepares the CreateOrUpdateSiteHostNameBindingSlot request.
func (client SitesClient) CreateOrUpdateSiteHostNameBindingSlotPreparer(resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters),
autorest.WithJSON(hostNameBinding),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteHostNameBindingSlotSender sends the CreateOrUpdateSiteHostNameBindingSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteHostNameBindingSlotResponder handles the response to the CreateOrUpdateSiteHostNameBindingSlot request. The method always
@@ -924,7 +1069,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -937,21 +1082,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app entityName is the name by which the Hybrid Connection is identified
// connectionEnvelope is the details of the Hybrid Connection
-func (client SitesClient) CreateOrUpdateSiteRelayServiceConnection(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) CreateOrUpdateSiteRelayServiceConnection(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) {
req, err := client.CreateOrUpdateSiteRelayServiceConnectionPreparer(resourceGroupName, name, entityName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnection", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteRelayServiceConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnection", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteRelayServiceConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnection", resp, "Failure responding to request")
}
return
@@ -960,30 +1105,30 @@
// CreateOrUpdateSiteRelayServiceConnectionPreparer prepares the CreateOrUpdateSiteRelayServiceConnection request.
func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionPreparer(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteRelayServiceConnectionSender sends the CreateOrUpdateSiteRelayServiceConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteRelayServiceConnectionResponder handles the response to the CreateOrUpdateSiteRelayServiceConnection request. The method always
@@ -992,7 +1137,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1006,21 +1151,21 @@
// app entityName is the name by which the Hybrid Connection is identified
// connectionEnvelope is the details of the Hybrid Connection slot is the
// name of the slot for the web app.
-func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) {
req, err := client.CreateOrUpdateSiteRelayServiceConnectionSlotPreparer(resourceGroupName, name, entityName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteRelayServiceConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteRelayServiceConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteRelayServiceConnectionSlot", resp, "Failure responding to request")
}
return
@@ -1029,31 +1174,31 @@
// CreateOrUpdateSiteRelayServiceConnectionSlotPreparer prepares the CreateOrUpdateSiteRelayServiceConnectionSlot request.
func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionSlotPreparer(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteRelayServiceConnectionSlotSender sends the CreateOrUpdateSiteRelayServiceConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteRelayServiceConnectionSlotResponder handles the response to the CreateOrUpdateSiteRelayServiceConnectionSlot request. The method always
@@ -1062,14 +1207,17 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// CreateOrUpdateSiteSlot sends the create or update site slot request.
+// CreateOrUpdateSiteSlot sends the create or update site slot request. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is name of the resource group name is name of the web app
// siteEnvelope is details of web app if it exists already slot is name of
@@ -1081,77 +1229,78 @@
// not verified. forceDNSRegistration is if true, web app hostname is force
// registered with DNS ttlInSeconds is time to live in seconds for web app's
// default domain name
-func (client SitesClient) CreateOrUpdateSiteSlot(resourceGroupName string, name string, siteEnvelope Site, slot string, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string) (result Site, ae error) {
- req, err := client.CreateOrUpdateSiteSlotPreparer(resourceGroupName, name, siteEnvelope, slot, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, ttlInSeconds)
+func (client SitesClient) CreateOrUpdateSiteSlot(resourceGroupName string, name string, siteEnvelope Site, slot string, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.CreateOrUpdateSiteSlotPreparer(resourceGroupName, name, siteEnvelope, slot, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, ttlInSeconds, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteSlotSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSlot", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSlot", resp, "Failure responding to request")
}
return
}
// CreateOrUpdateSiteSlotPreparer prepares the CreateOrUpdateSiteSlot request.
-func (client SitesClient) CreateOrUpdateSiteSlotPreparer(resourceGroupName string, name string, siteEnvelope Site, slot string, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string) (*http.Request, error) {
+func (client SitesClient) CreateOrUpdateSiteSlotPreparer(resourceGroupName string, name string, siteEnvelope Site, slot string, skipDNSRegistration string, skipCustomDomainVerification string, forceDNSRegistration string, ttlInSeconds string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(skipDNSRegistration) > 0 {
- queryParameters["skipDnsRegistration"] = skipDNSRegistration
+ queryParameters["skipDnsRegistration"] = autorest.Encode("query", skipDNSRegistration)
}
if len(skipCustomDomainVerification) > 0 {
- queryParameters["skipCustomDomainVerification"] = skipCustomDomainVerification
+ queryParameters["skipCustomDomainVerification"] = autorest.Encode("query", skipCustomDomainVerification)
}
if len(forceDNSRegistration) > 0 {
- queryParameters["forceDnsRegistration"] = forceDNSRegistration
+ queryParameters["forceDnsRegistration"] = autorest.Encode("query", forceDNSRegistration)
}
if len(ttlInSeconds) > 0 {
- queryParameters["ttlInSeconds"] = ttlInSeconds
+ queryParameters["ttlInSeconds"] = autorest.Encode("query", ttlInSeconds)
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters),
autorest.WithJSON(siteEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSiteSlotSender sends the CreateOrUpdateSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateSiteSlotResponder handles the response to the CreateOrUpdateSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) CreateOrUpdateSiteSlotResponder(resp *http.Response) (result Site, err error) {
+func (client SitesClient) CreateOrUpdateSiteSlotResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -1161,21 +1310,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteSourceControl is request body that contains the source control
// parameters
-func (client SitesClient) CreateOrUpdateSiteSourceControl(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result SiteSourceControl, ae error) {
+func (client SitesClient) CreateOrUpdateSiteSourceControl(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result SiteSourceControl, err error) {
req, err := client.CreateOrUpdateSiteSourceControlPreparer(resourceGroupName, name, siteSourceControl)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControl", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControl", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControl", resp, "Failure responding to request")
}
return
@@ -1184,29 +1333,29 @@
// CreateOrUpdateSiteSourceControlPreparer prepares the CreateOrUpdateSiteSourceControl request.
func (client SitesClient) CreateOrUpdateSiteSourceControlPreparer(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters),
autorest.WithJSON(siteSourceControl),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteSourceControlSender sends the CreateOrUpdateSiteSourceControl request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteSourceControlResponder handles the response to the CreateOrUpdateSiteSourceControl request. The method always
@@ -1215,7 +1364,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1229,21 +1378,21 @@
// siteSourceControl is request body that contains the source control
// parameters slot is name of web app slot. If not specified then will
// default to production slot.
-func (client SitesClient) CreateOrUpdateSiteSourceControlSlot(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, ae error) {
+func (client SitesClient) CreateOrUpdateSiteSourceControlSlot(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, err error) {
req, err := client.CreateOrUpdateSiteSourceControlSlotPreparer(resourceGroupName, name, siteSourceControl, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControlSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControlSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteSourceControlSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControlSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControlSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteSourceControlSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteSourceControlSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteSourceControlSlot", resp, "Failure responding to request")
}
return
@@ -1252,30 +1401,30 @@
// CreateOrUpdateSiteSourceControlSlotPreparer prepares the CreateOrUpdateSiteSourceControlSlot request.
func (client SitesClient) CreateOrUpdateSiteSourceControlSlotPreparer(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters),
autorest.WithJSON(siteSourceControl),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteSourceControlSlotSender sends the CreateOrUpdateSiteSourceControlSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteSourceControlSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteSourceControlSlotResponder handles the response to the CreateOrUpdateSiteSourceControlSlot request. The method always
@@ -1284,7 +1433,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1297,21 +1446,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app vnetName is the name of the Virtual Network connectionEnvelope is the
// properties of this Virtual Network Connection
-func (client SitesClient) CreateOrUpdateSiteVNETConnection(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, ae error) {
+func (client SitesClient) CreateOrUpdateSiteVNETConnection(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) {
req, err := client.CreateOrUpdateSiteVNETConnectionPreparer(resourceGroupName, name, vnetName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnection", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteVNETConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnection", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteVNETConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnection", resp, "Failure responding to request")
}
return
@@ -1320,30 +1469,30 @@
// CreateOrUpdateSiteVNETConnectionPreparer prepares the CreateOrUpdateSiteVNETConnection request.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionPreparer(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteVNETConnectionSender sends the CreateOrUpdateSiteVNETConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteVNETConnectionResponder handles the response to the CreateOrUpdateSiteVNETConnection request. The method always
@@ -1352,7 +1501,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1366,21 +1515,21 @@
// app vnetName is the name of the Virtual Network gatewayName is the name of
// the gateway. The only gateway that exists presently is "primary"
// connectionEnvelope is the properties to update this gateway with.
-func (client SitesClient) CreateOrUpdateSiteVNETConnectionGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, ae error) {
+func (client SitesClient) CreateOrUpdateSiteVNETConnectionGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) {
req, err := client.CreateOrUpdateSiteVNETConnectionGatewayPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteVNETConnectionGatewaySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteVNETConnectionGatewayResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGateway", resp, "Failure responding to request")
}
return
@@ -1389,31 +1538,31 @@
// CreateOrUpdateSiteVNETConnectionGatewayPreparer prepares the CreateOrUpdateSiteVNETConnectionGateway request.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteVNETConnectionGatewaySender sends the CreateOrUpdateSiteVNETConnectionGateway request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewaySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteVNETConnectionGatewayResponder handles the response to the CreateOrUpdateSiteVNETConnectionGateway request. The method always
@@ -1422,7 +1571,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1437,21 +1586,21 @@
// the gateway. The only gateway that exists presently is "primary"
// connectionEnvelope is the properties to update this gateway with. slot is
// the name of the slot for this web app.
-func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, ae error) {
+func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) {
req, err := client.CreateOrUpdateSiteVNETConnectionGatewaySlotPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteVNETConnectionGatewaySlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteVNETConnectionGatewaySlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionGatewaySlot", resp, "Failure responding to request")
}
return
@@ -1460,32 +1609,32 @@
// CreateOrUpdateSiteVNETConnectionGatewaySlotPreparer prepares the CreateOrUpdateSiteVNETConnectionGatewaySlot request.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewaySlotPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteVNETConnectionGatewaySlotSender sends the CreateOrUpdateSiteVNETConnectionGatewaySlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteVNETConnectionGatewaySlotResponder handles the response to the CreateOrUpdateSiteVNETConnectionGatewaySlot request. The method always
@@ -1494,7 +1643,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1508,21 +1657,21 @@
// app vnetName is the name of the Virtual Network connectionEnvelope is the
// properties of this Virtual Network Connection slot is the name of the slot
// for this web app.
-func (client SitesClient) CreateOrUpdateSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, ae error) {
+func (client SitesClient) CreateOrUpdateSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) {
req, err := client.CreateOrUpdateSiteVNETConnectionSlotPreparer(resourceGroupName, name, vnetName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSiteVNETConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateSiteVNETConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "CreateOrUpdateSiteVNETConnectionSlot", resp, "Failure responding to request")
}
return
@@ -1531,31 +1680,31 @@
// CreateOrUpdateSiteVNETConnectionSlotPreparer prepares the CreateOrUpdateSiteVNETConnectionSlot request.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionSlotPreparer(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSiteVNETConnectionSlotSender sends the CreateOrUpdateSiteVNETConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) CreateOrUpdateSiteVNETConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// CreateOrUpdateSiteVNETConnectionSlotResponder handles the response to the CreateOrUpdateSiteVNETConnectionSlot request. The method always
@@ -1564,7 +1713,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1575,21 +1724,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup
-func (client SitesClient) DeleteBackup(resourceGroupName string, name string, backupID string) (result BackupItem, ae error) {
+func (client SitesClient) DeleteBackup(resourceGroupName string, name string, backupID string) (result BackupItem, err error) {
req, err := client.DeleteBackupPreparer(resourceGroupName, name, backupID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackup", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackup", nil, "Failure preparing request")
}
resp, err := client.DeleteBackupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackup", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackup", resp, "Failure sending request")
}
result, err = client.DeleteBackupResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackup", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackup", resp, "Failure responding to request")
}
return
@@ -1598,29 +1747,28 @@
// DeleteBackupPreparer prepares the DeleteBackup request.
func (client SitesClient) DeleteBackupPreparer(resourceGroupName string, name string, backupID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteBackupSender sends the DeleteBackup request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) DeleteBackupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteBackupResponder handles the response to the DeleteBackup request. The method always
@@ -1629,7 +1777,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -1641,21 +1789,21 @@
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup slot is name of web app slot. If not specified
// then will default to production slot.
-func (client SitesClient) DeleteBackupSlot(resourceGroupName string, name string, backupID string, slot string) (result BackupItem, ae error) {
+func (client SitesClient) DeleteBackupSlot(resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) {
req, err := client.DeleteBackupSlotPreparer(resourceGroupName, name, backupID, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackupSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackupSlot", nil, "Failure preparing request")
}
resp, err := client.DeleteBackupSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackupSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackupSlot", resp, "Failure sending request")
}
result, err = client.DeleteBackupSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteBackupSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteBackupSlot", resp, "Failure responding to request")
}
return
@@ -1664,30 +1812,29 @@
// DeleteBackupSlotPreparer prepares the DeleteBackupSlot request.
func (client SitesClient) DeleteBackupSlotPreparer(resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteBackupSlotSender sends the DeleteBackupSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) DeleteBackupSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteBackupSlotResponder handles the response to the DeleteBackupSlot request. The method always
@@ -1696,441 +1843,698 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSite sends the delete site request.
+// DeleteDeployment sends the delete deployment request.
//
-// resourceGroupName is name of resource group name is name of web app
-// deleteMetrics is if true, web app metrics are also deleted
-// deleteEmptyServerFarm is if true and App Service Plan is empty after web
-// app deletion, App Service Plan is also deleted skipDNSRegistration is if
-// true, DNS registration is skipped deleteAllSlots is if true, all slots
-// associated with web app are also deleted
-func (client SitesClient) DeleteSite(resourceGroupName string, name string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (result ObjectSet, ae error) {
- req, err := client.DeleteSitePreparer(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDNSRegistration, deleteAllSlots)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment
+func (client SitesClient) DeleteDeployment(resourceGroupName string, name string, id string) (result SetObject, err error) {
+ req, err := client.DeleteDeploymentPreparer(resourceGroupName, name, id)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeployment", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteSender(req)
+ resp, err := client.DeleteDeploymentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeployment", resp, "Failure sending request")
}
- result, err = client.DeleteSiteResponder(resp)
+ result, err = client.DeleteDeploymentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeployment", resp, "Failure responding to request")
}
return
}
-// DeleteSitePreparer prepares the DeleteSite request.
-func (client SitesClient) DeleteSitePreparer(resourceGroupName string, name string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (*http.Request, error) {
+// DeleteDeploymentPreparer prepares the DeleteDeployment request.
+func (client SitesClient) DeleteDeploymentPreparer(resourceGroupName string, name string, id string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(deleteMetrics) > 0 {
- queryParameters["deleteMetrics"] = deleteMetrics
- }
- if len(deleteEmptyServerFarm) > 0 {
- queryParameters["deleteEmptyServerFarm"] = deleteEmptyServerFarm
- }
- if len(skipDNSRegistration) > 0 {
- queryParameters["skipDnsRegistration"] = skipDNSRegistration
- }
- if len(deleteAllSlots) > 0 {
- queryParameters["deleteAllSlots"] = deleteAllSlots
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteSender sends the DeleteSite request. The method will close the
+// DeleteDeploymentSender sends the DeleteDeployment request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteResponder handles the response to the DeleteSite request. The method always
+// DeleteDeploymentResponder handles the response to the DeleteDeployment request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteDeploymentResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteHostNameBinding sends the delete site host name binding request.
+// DeleteDeploymentSlot sends the delete deployment slot request.
//
-// resourceGroupName is name of resource group name is name of web app
-// hostName is name of host
-func (client SitesClient) DeleteSiteHostNameBinding(resourceGroupName string, name string, hostName string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteHostNameBindingPreparer(resourceGroupName, name, hostName)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot.
+func (client SitesClient) DeleteDeploymentSlot(resourceGroupName string, name string, id string, slot string) (result SetObject, err error) {
+ req, err := client.DeleteDeploymentSlotPreparer(resourceGroupName, name, id, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBinding", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeploymentSlot", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteHostNameBindingSender(req)
+ resp, err := client.DeleteDeploymentSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBinding", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeploymentSlot", resp, "Failure sending request")
}
- result, err = client.DeleteSiteHostNameBindingResponder(resp)
+ result, err = client.DeleteDeploymentSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBinding", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteDeploymentSlot", resp, "Failure responding to request")
}
return
}
-// DeleteSiteHostNameBindingPreparer prepares the DeleteSiteHostNameBinding request.
-func (client SitesClient) DeleteSiteHostNameBindingPreparer(resourceGroupName string, name string, hostName string) (*http.Request, error) {
+// DeleteDeploymentSlotPreparer prepares the DeleteDeploymentSlot request.
+func (client SitesClient) DeleteDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteHostNameBindingSender sends the DeleteSiteHostNameBinding request. The method will close the
+// DeleteDeploymentSlotSender sends the DeleteDeploymentSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteHostNameBindingSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteHostNameBindingResponder handles the response to the DeleteSiteHostNameBinding request. The method always
+// DeleteDeploymentSlotResponder handles the response to the DeleteDeploymentSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteHostNameBindingResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteDeploymentSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteHostNameBindingSlot sends the delete site host name binding slot
-// request.
+// DeleteInstanceDeployment sends the delete instance deployment request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot. hostName is name of host
-func (client SitesClient) DeleteSiteHostNameBindingSlot(resourceGroupName string, name string, slot string, hostName string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteHostNameBindingSlotPreparer(resourceGroupName, name, slot, hostName)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment instanceID is id of web app instance
+func (client SitesClient) DeleteInstanceDeployment(resourceGroupName string, name string, id string, instanceID string) (result SetObject, err error) {
+ req, err := client.DeleteInstanceDeploymentPreparer(resourceGroupName, name, id, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBindingSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeployment", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteHostNameBindingSlotSender(req)
+ resp, err := client.DeleteInstanceDeploymentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBindingSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeployment", resp, "Failure sending request")
}
- result, err = client.DeleteSiteHostNameBindingSlotResponder(resp)
+ result, err = client.DeleteInstanceDeploymentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteHostNameBindingSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeployment", resp, "Failure responding to request")
}
return
}
-// DeleteSiteHostNameBindingSlotPreparer prepares the DeleteSiteHostNameBindingSlot request.
-func (client SitesClient) DeleteSiteHostNameBindingSlotPreparer(resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) {
+// DeleteInstanceDeploymentPreparer prepares the DeleteInstanceDeployment request.
+func (client SitesClient) DeleteInstanceDeploymentPreparer(resourceGroupName string, name string, id string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteHostNameBindingSlotSender sends the DeleteSiteHostNameBindingSlot request. The method will close the
+// DeleteInstanceDeploymentSender sends the DeleteInstanceDeployment request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteInstanceDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteHostNameBindingSlotResponder handles the response to the DeleteSiteHostNameBindingSlot request. The method always
+// DeleteInstanceDeploymentResponder handles the response to the DeleteInstanceDeployment request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteHostNameBindingSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteInstanceDeploymentResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSitePremierAddOn sends the delete site premier add on request.
+// DeleteInstanceDeploymentSlot sends the delete instance deployment slot
+// request.
//
-func (client SitesClient) DeleteSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string) (result ObjectSet, ae error) {
- req, err := client.DeleteSitePremierAddOnPreparer(resourceGroupName, name, premierAddOnName)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot. instanceID is id of web app instance
+func (client SitesClient) DeleteInstanceDeploymentSlot(resourceGroupName string, name string, id string, slot string, instanceID string) (result SetObject, err error) {
+ req, err := client.DeleteInstanceDeploymentSlotPreparer(resourceGroupName, name, id, slot, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOn", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeploymentSlot", nil, "Failure preparing request")
}
- resp, err := client.DeleteSitePremierAddOnSender(req)
+ resp, err := client.DeleteInstanceDeploymentSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOn", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeploymentSlot", resp, "Failure sending request")
}
- result, err = client.DeleteSitePremierAddOnResponder(resp)
+ result, err = client.DeleteInstanceDeploymentSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOn", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteInstanceDeploymentSlot", resp, "Failure responding to request")
}
return
}
-// DeleteSitePremierAddOnPreparer prepares the DeleteSitePremierAddOn request.
-func (client SitesClient) DeleteSitePremierAddOnPreparer(resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) {
+// DeleteInstanceDeploymentSlotPreparer prepares the DeleteInstanceDeploymentSlot request.
+func (client SitesClient) DeleteInstanceDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSitePremierAddOnSender sends the DeleteSitePremierAddOn request. The method will close the
+// DeleteInstanceDeploymentSlotSender sends the DeleteInstanceDeploymentSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSitePremierAddOnSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteInstanceDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSitePremierAddOnResponder handles the response to the DeleteSitePremierAddOn request. The method always
+// DeleteInstanceDeploymentSlotResponder handles the response to the DeleteInstanceDeploymentSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSitePremierAddOnResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteInstanceDeploymentSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSitePremierAddOnSlot sends the delete site premier add on slot
-// request.
+// DeleteSite sends the delete site request.
//
-func (client SitesClient) DeleteSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, slot string) (result ObjectSet, ae error) {
- req, err := client.DeleteSitePremierAddOnSlotPreparer(resourceGroupName, name, premierAddOnName, slot)
+// resourceGroupName is name of resource group name is name of web app
+// deleteMetrics is if true, web app metrics are also deleted
+// deleteEmptyServerFarm is if true and App Service Plan is empty after web
+// app deletion, App Service Plan is also deleted skipDNSRegistration is if
+// true, DNS registration is skipped deleteAllSlots is if true, all slots
+// associated with web app are also deleted
+func (client SitesClient) DeleteSite(resourceGroupName string, name string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (result SetObject, err error) {
+ req, err := client.DeleteSitePreparer(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDNSRegistration, deleteAllSlots)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOnSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSite", nil, "Failure preparing request")
}
- resp, err := client.DeleteSitePremierAddOnSlotSender(req)
+ resp, err := client.DeleteSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOnSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSite", resp, "Failure sending request")
}
- result, err = client.DeleteSitePremierAddOnSlotResponder(resp)
+ result, err = client.DeleteSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSitePremierAddOnSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSite", resp, "Failure responding to request")
}
return
}
-// DeleteSitePremierAddOnSlotPreparer prepares the DeleteSitePremierAddOnSlot request.
-func (client SitesClient) DeleteSitePremierAddOnSlotPreparer(resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) {
+// DeleteSitePreparer prepares the DeleteSite request.
+func (client SitesClient) DeleteSitePreparer(resourceGroupName string, name string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(deleteMetrics) > 0 {
+ queryParameters["deleteMetrics"] = autorest.Encode("query", deleteMetrics)
+ }
+ if len(deleteEmptyServerFarm) > 0 {
+ queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", deleteEmptyServerFarm)
+ }
+ if len(skipDNSRegistration) > 0 {
+ queryParameters["skipDnsRegistration"] = autorest.Encode("query", skipDNSRegistration)
+ }
+ if len(deleteAllSlots) > 0 {
+ queryParameters["deleteAllSlots"] = autorest.Encode("query", deleteAllSlots)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSitePremierAddOnSlotSender sends the DeleteSitePremierAddOnSlot request. The method will close the
+// DeleteSiteSender sends the DeleteSite request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSitePremierAddOnSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteSiteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSitePremierAddOnSlotResponder handles the response to the DeleteSitePremierAddOnSlot request. The method always
+// DeleteSiteResponder handles the response to the DeleteSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSitePremierAddOnSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteSiteResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteRelayServiceConnection sends the delete site relay service
-// connection request.
+// DeleteSiteHostNameBinding sends the delete site host name binding request.
//
-// resourceGroupName is the resource group name name is the name of the web
-// app entityName is the name by which the Hybrid Connection is identified
-func (client SitesClient) DeleteSiteRelayServiceConnection(resourceGroupName string, name string, entityName string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteRelayServiceConnectionPreparer(resourceGroupName, name, entityName)
+// resourceGroupName is name of resource group name is name of web app
+// hostName is name of host
+func (client SitesClient) DeleteSiteHostNameBinding(resourceGroupName string, name string, hostName string) (result SetObject, err error) {
+ req, err := client.DeleteSiteHostNameBindingPreparer(resourceGroupName, name, hostName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBinding", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteRelayServiceConnectionSender(req)
+ resp, err := client.DeleteSiteHostNameBindingSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBinding", resp, "Failure sending request")
}
- result, err = client.DeleteSiteRelayServiceConnectionResponder(resp)
+ result, err = client.DeleteSiteHostNameBindingResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBinding", resp, "Failure responding to request")
}
return
}
-// DeleteSiteRelayServiceConnectionPreparer prepares the DeleteSiteRelayServiceConnection request.
-func (client SitesClient) DeleteSiteRelayServiceConnectionPreparer(resourceGroupName string, name string, entityName string) (*http.Request, error) {
+// DeleteSiteHostNameBindingPreparer prepares the DeleteSiteHostNameBinding request.
+func (client SitesClient) DeleteSiteHostNameBindingPreparer(resourceGroupName string, name string, hostName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteRelayServiceConnectionSender sends the DeleteSiteRelayServiceConnection request. The method will close the
+// DeleteSiteHostNameBindingSender sends the DeleteSiteHostNameBinding request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DeleteSiteHostNameBindingSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteRelayServiceConnectionResponder handles the response to the DeleteSiteRelayServiceConnection request. The method always
+// DeleteSiteHostNameBindingResponder handles the response to the DeleteSiteHostNameBinding request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteRelayServiceConnectionResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteSiteHostNameBindingResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteRelayServiceConnectionSlot sends the delete site relay service
-// connection slot request.
+// DeleteSiteHostNameBindingSlot sends the delete site host name binding slot
+// request.
//
-// resourceGroupName is the resource group name name is the name of the web
-// app entityName is the name by which the Hybrid Connection is identified
-// slot is the name of the slot for the web app.
-func (client SitesClient) DeleteSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, slot string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteRelayServiceConnectionSlotPreparer(resourceGroupName, name, entityName, slot)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnectionSlot", "Failure preparing request")
- }
-
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot. hostName is name of host
+func (client SitesClient) DeleteSiteHostNameBindingSlot(resourceGroupName string, name string, slot string, hostName string) (result SetObject, err error) {
+ req, err := client.DeleteSiteHostNameBindingSlotPreparer(resourceGroupName, name, slot, hostName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBindingSlot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSiteHostNameBindingSlotSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBindingSlot", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSiteHostNameBindingSlotResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteHostNameBindingSlot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSiteHostNameBindingSlotPreparer prepares the DeleteSiteHostNameBindingSlot request.
+func (client SitesClient) DeleteSiteHostNameBindingSlotPreparer(resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteHostNameBindingSlotSender sends the DeleteSiteHostNameBindingSlot request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteHostNameBindingSlotResponder handles the response to the DeleteSiteHostNameBindingSlot request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteHostNameBindingSlotResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSitePremierAddOn sends the delete site premier add on request.
+//
+func (client SitesClient) DeleteSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string) (result SetObject, err error) {
+ req, err := client.DeleteSitePremierAddOnPreparer(resourceGroupName, name, premierAddOnName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOn", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSitePremierAddOnSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOn", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSitePremierAddOnResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOn", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSitePremierAddOnPreparer prepares the DeleteSitePremierAddOn request.
+func (client SitesClient) DeleteSitePremierAddOnPreparer(resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSitePremierAddOnSender sends the DeleteSitePremierAddOn request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSitePremierAddOnSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSitePremierAddOnResponder handles the response to the DeleteSitePremierAddOn request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSitePremierAddOnResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSitePremierAddOnSlot sends the delete site premier add on slot
+// request.
+//
+func (client SitesClient) DeleteSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, slot string) (result SetObject, err error) {
+ req, err := client.DeleteSitePremierAddOnSlotPreparer(resourceGroupName, name, premierAddOnName, slot)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOnSlot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSitePremierAddOnSlotSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOnSlot", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSitePremierAddOnSlotResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSitePremierAddOnSlot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSitePremierAddOnSlotPreparer prepares the DeleteSitePremierAddOnSlot request.
+func (client SitesClient) DeleteSitePremierAddOnSlotPreparer(resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSitePremierAddOnSlotSender sends the DeleteSitePremierAddOnSlot request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSitePremierAddOnSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSitePremierAddOnSlotResponder handles the response to the DeleteSitePremierAddOnSlot request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSitePremierAddOnSlotResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSiteRelayServiceConnection sends the delete site relay service
+// connection request.
+//
+// resourceGroupName is the resource group name name is the name of the web
+// app entityName is the name by which the Hybrid Connection is identified
+func (client SitesClient) DeleteSiteRelayServiceConnection(resourceGroupName string, name string, entityName string) (result SetObject, err error) {
+ req, err := client.DeleteSiteRelayServiceConnectionPreparer(resourceGroupName, name, entityName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnection", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSiteRelayServiceConnectionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnection", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSiteRelayServiceConnectionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnection", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSiteRelayServiceConnectionPreparer prepares the DeleteSiteRelayServiceConnection request.
+func (client SitesClient) DeleteSiteRelayServiceConnectionPreparer(resourceGroupName string, name string, entityName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteRelayServiceConnectionSender sends the DeleteSiteRelayServiceConnection request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteRelayServiceConnectionResponder handles the response to the DeleteSiteRelayServiceConnection request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteRelayServiceConnectionResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSiteRelayServiceConnectionSlot sends the delete site relay service
+// connection slot request.
+//
+// resourceGroupName is the resource group name name is the name of the web
+// app entityName is the name by which the Hybrid Connection is identified
+// slot is the name of the slot for the web app.
+func (client SitesClient) DeleteSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, slot string) (result SetObject, err error) {
+ req, err := client.DeleteSiteRelayServiceConnectionSlotPreparer(resourceGroupName, name, entityName, slot)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnectionSlot", nil, "Failure preparing request")
+ }
+
resp, err := client.DeleteSiteRelayServiceConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnectionSlot", resp, "Failure sending request")
}
result, err = client.DeleteSiteRelayServiceConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteRelayServiceConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteRelayServiceConnectionSlot", resp, "Failure responding to request")
}
return
@@ -2139,39 +2543,38 @@
// DeleteSiteRelayServiceConnectionSlotPreparer prepares the DeleteSiteRelayServiceConnectionSlot request.
func (client SitesClient) DeleteSiteRelayServiceConnectionSlotPreparer(resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSiteRelayServiceConnectionSlotSender sends the DeleteSiteRelayServiceConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) DeleteSiteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteSiteRelayServiceConnectionSlotResponder handles the response to the DeleteSiteRelayServiceConnectionSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteRelayServiceConnectionSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteSiteRelayServiceConnectionSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2187,21 +2590,21 @@
// app deletion, App Service Plan is also deleted skipDNSRegistration is if
// true, DNS registration is skipped deleteAllSlots is if true, all slots
// associated with web app are also deleted
-func (client SitesClient) DeleteSiteSlot(resourceGroupName string, name string, slot string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (result ObjectSet, ae error) {
+func (client SitesClient) DeleteSiteSlot(resourceGroupName string, name string, slot string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (result SetObject, err error) {
req, err := client.DeleteSiteSlotPreparer(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDNSRegistration, deleteAllSlots)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSlot", nil, "Failure preparing request")
}
resp, err := client.DeleteSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSlot", resp, "Failure sending request")
}
result, err = client.DeleteSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSlot", resp, "Failure responding to request")
}
return
@@ -2210,50 +2613,49 @@
// DeleteSiteSlotPreparer prepares the DeleteSiteSlot request.
func (client SitesClient) DeleteSiteSlotPreparer(resourceGroupName string, name string, slot string, deleteMetrics string, deleteEmptyServerFarm string, skipDNSRegistration string, deleteAllSlots string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(deleteMetrics) > 0 {
- queryParameters["deleteMetrics"] = deleteMetrics
+ queryParameters["deleteMetrics"] = autorest.Encode("query", deleteMetrics)
}
if len(deleteEmptyServerFarm) > 0 {
- queryParameters["deleteEmptyServerFarm"] = deleteEmptyServerFarm
+ queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", deleteEmptyServerFarm)
}
if len(skipDNSRegistration) > 0 {
- queryParameters["skipDnsRegistration"] = skipDNSRegistration
+ queryParameters["skipDnsRegistration"] = autorest.Encode("query", skipDNSRegistration)
}
if len(deleteAllSlots) > 0 {
- queryParameters["deleteAllSlots"] = deleteAllSlots
+ queryParameters["deleteAllSlots"] = autorest.Encode("query", deleteAllSlots)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// DeleteSiteSlotSender sends the DeleteSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) DeleteSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// DeleteSiteSlotResponder handles the response to the DeleteSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DeleteSiteSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -2263,21 +2665,21 @@
// DeleteSiteSourceControl sends the delete site source control request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) DeleteSiteSourceControl(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) DeleteSiteSourceControl(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.DeleteSiteSourceControlPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControl", nil, "Failure preparing request")
}
resp, err := client.DeleteSiteSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControl", resp, "Failure sending request")
}
result, err = client.DeleteSiteSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControl", resp, "Failure responding to request")
}
return
@@ -2286,966 +2688,1211 @@
// DeleteSiteSourceControlPreparer prepares the DeleteSiteSourceControl request.
func (client SitesClient) DeleteSiteSourceControlPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteSourceControlSender sends the DeleteSiteSourceControl request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteSourceControlSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteSourceControlResponder handles the response to the DeleteSiteSourceControl request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteSourceControlResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSiteSourceControlSlot sends the delete site source control slot
+// request.
+//
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot.
+func (client SitesClient) DeleteSiteSourceControlSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
+ req, err := client.DeleteSiteSourceControlSlotPreparer(resourceGroupName, name, slot)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControlSlot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSiteSourceControlSlotSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControlSlot", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSiteSourceControlSlotResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteSourceControlSlot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSiteSourceControlSlotPreparer prepares the DeleteSiteSourceControlSlot request.
+func (client SitesClient) DeleteSiteSourceControlSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteSourceControlSlotSender sends the DeleteSiteSourceControlSlot request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteSourceControlSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteSourceControlSlotResponder handles the response to the DeleteSiteSourceControlSlot request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteSourceControlSlotResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSiteVNETConnection sends the delete site vnet connection request.
+//
+// resourceGroupName is the resource group name name is the name of the web
+// app vnetName is the name of the Virtual Network
+func (client SitesClient) DeleteSiteVNETConnection(resourceGroupName string, name string, vnetName string) (result SetObject, err error) {
+ req, err := client.DeleteSiteVNETConnectionPreparer(resourceGroupName, name, vnetName)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnection", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSiteVNETConnectionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnection", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSiteVNETConnectionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnection", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSiteVNETConnectionPreparer prepares the DeleteSiteVNETConnection request.
+func (client SitesClient) DeleteSiteVNETConnectionPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteVNETConnectionSender sends the DeleteSiteVNETConnection request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteVNETConnectionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteVNETConnectionResponder handles the response to the DeleteSiteVNETConnection request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteVNETConnectionResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DeleteSiteVNETConnectionSlot sends the delete site vnet connection slot
+// request.
+//
+// resourceGroupName is the resource group name name is the name of the web
+// app vnetName is the name of the Virtual Network slot is the name of the
+// slot for this web app.
+func (client SitesClient) DeleteSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, slot string) (result SetObject, err error) {
+ req, err := client.DeleteSiteVNETConnectionSlotPreparer(resourceGroupName, name, vnetName, slot)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnectionSlot", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DeleteSiteVNETConnectionSlotSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnectionSlot", resp, "Failure sending request")
+ }
+
+ result, err = client.DeleteSiteVNETConnectionSlotResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DeleteSiteVNETConnectionSlot", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeleteSiteVNETConnectionSlotPreparer prepares the DeleteSiteVNETConnectionSlot request.
+func (client SitesClient) DeleteSiteVNETConnectionSlotPreparer(resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
+ }
+
+ queryParameters := map[string]interface{}{
+ "api-version": client.APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
+}
+
+// DeleteSiteVNETConnectionSlotSender sends the DeleteSiteVNETConnectionSlot request. The method will close the
+// http.Response Body if it receives an error.
+func (client SitesClient) DeleteSiteVNETConnectionSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
+}
+
+// DeleteSiteVNETConnectionSlotResponder handles the response to the DeleteSiteVNETConnectionSlot request. The method always
+// closes the http.Response Body.
+func (client SitesClient) DeleteSiteVNETConnectionSlotResponder(resp *http.Response) (result SetObject, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// DiscoverSiteRestore sends the discover site restore request.
+//
+// resourceGroupName is name of resource group name is name of web app request
+// is information on restore request
+func (client SitesClient) DiscoverSiteRestore(resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, err error) {
+ req, err := client.DiscoverSiteRestorePreparer(resourceGroupName, name, request)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestore", nil, "Failure preparing request")
+ }
+
+ resp, err := client.DiscoverSiteRestoreSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestore", resp, "Failure sending request")
+ }
+
+ result, err = client.DiscoverSiteRestoreResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestore", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DiscoverSiteRestorePreparer prepares the DiscoverSiteRestore request.
+func (client SitesClient) DiscoverSiteRestorePreparer(resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
- autorest.AsDelete(),
+ autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/discover", pathParameters),
+ autorest.WithJSON(request),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteSourceControlSender sends the DeleteSiteSourceControl request. The method will close the
+// DiscoverSiteRestoreSender sends the DiscoverSiteRestore request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DiscoverSiteRestoreSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteSourceControlResponder handles the response to the DeleteSiteSourceControl request. The method always
+// DiscoverSiteRestoreResponder handles the response to the DiscoverSiteRestore request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteSourceControlResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DiscoverSiteRestoreResponder(resp *http.Response) (result RestoreRequest, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteSourceControlSlot sends the delete site source control slot
-// request.
+// DiscoverSiteRestoreSlot sends the discover site restore slot request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) DeleteSiteSourceControlSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteSourceControlSlotPreparer(resourceGroupName, name, slot)
+// resourceGroupName is name of resource group name is name of web app request
+// is information on restore request slot is name of web app slot. If not
+// specified then will default to production slot.
+func (client SitesClient) DiscoverSiteRestoreSlot(resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, err error) {
+ req, err := client.DiscoverSiteRestoreSlotPreparer(resourceGroupName, name, request, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControlSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestoreSlot", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteSourceControlSlotSender(req)
+ resp, err := client.DiscoverSiteRestoreSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControlSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestoreSlot", resp, "Failure sending request")
}
- result, err = client.DeleteSiteSourceControlSlotResponder(resp)
+ result, err = client.DiscoverSiteRestoreSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteSourceControlSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "DiscoverSiteRestoreSlot", resp, "Failure responding to request")
}
return
}
-// DeleteSiteSourceControlSlotPreparer prepares the DeleteSiteSourceControlSlot request.
-func (client SitesClient) DeleteSiteSourceControlSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// DiscoverSiteRestoreSlotPreparer prepares the DiscoverSiteRestoreSlot request.
+func (client SitesClient) DiscoverSiteRestoreSlotPreparer(resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
- autorest.AsDelete(),
+ autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/discover", pathParameters),
+ autorest.WithJSON(request),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteSourceControlSlotSender sends the DeleteSiteSourceControlSlot request. The method will close the
+// DiscoverSiteRestoreSlotSender sends the DiscoverSiteRestoreSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteSourceControlSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) DiscoverSiteRestoreSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteSourceControlSlotResponder handles the response to the DeleteSiteSourceControlSlot request. The method always
+// DiscoverSiteRestoreSlotResponder handles the response to the DiscoverSiteRestoreSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteSourceControlSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) DiscoverSiteRestoreSlotResponder(resp *http.Response) (result RestoreRequest, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteVNETConnection sends the delete site vnet connection request.
+// GenerateNewSitePublishingPassword sends the generate new site publishing
+// password request.
//
-// resourceGroupName is the resource group name name is the name of the web
-// app vnetName is the name of the Virtual Network
-func (client SitesClient) DeleteSiteVNETConnection(resourceGroupName string, name string, vnetName string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteVNETConnectionPreparer(resourceGroupName, name, vnetName)
+// resourceGroupName is name of resource group name is name of web app
+func (client SitesClient) GenerateNewSitePublishingPassword(resourceGroupName string, name string) (result SetObject, err error) {
+ req, err := client.GenerateNewSitePublishingPasswordPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPassword", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteVNETConnectionSender(req)
+ resp, err := client.GenerateNewSitePublishingPasswordSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPassword", resp, "Failure sending request")
}
- result, err = client.DeleteSiteVNETConnectionResponder(resp)
+ result, err = client.GenerateNewSitePublishingPasswordResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPassword", resp, "Failure responding to request")
}
return
}
-// DeleteSiteVNETConnectionPreparer prepares the DeleteSiteVNETConnection request.
-func (client SitesClient) DeleteSiteVNETConnectionPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
+// GenerateNewSitePublishingPasswordPreparer prepares the GenerateNewSitePublishingPassword request.
+func (client SitesClient) GenerateNewSitePublishingPasswordPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteVNETConnectionSender sends the DeleteSiteVNETConnection request. The method will close the
+// GenerateNewSitePublishingPasswordSender sends the GenerateNewSitePublishingPassword request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteVNETConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GenerateNewSitePublishingPasswordSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteVNETConnectionResponder handles the response to the DeleteSiteVNETConnection request. The method always
+// GenerateNewSitePublishingPasswordResponder handles the response to the GenerateNewSitePublishingPassword request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteVNETConnectionResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GenerateNewSitePublishingPasswordResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DeleteSiteVNETConnectionSlot sends the delete site vnet connection slot
-// request.
+// GenerateNewSitePublishingPasswordSlot sends the generate new site
+// publishing password slot request.
//
-// resourceGroupName is the resource group name name is the name of the web
-// app vnetName is the name of the Virtual Network slot is the name of the
-// slot for this web app.
-func (client SitesClient) DeleteSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, slot string) (result ObjectSet, ae error) {
- req, err := client.DeleteSiteVNETConnectionSlotPreparer(resourceGroupName, name, vnetName, slot)
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot.
+func (client SitesClient) GenerateNewSitePublishingPasswordSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
+ req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPasswordSlot", nil, "Failure preparing request")
}
- resp, err := client.DeleteSiteVNETConnectionSlotSender(req)
+ resp, err := client.GenerateNewSitePublishingPasswordSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure sending request")
}
- result, err = client.DeleteSiteVNETConnectionSlotResponder(resp)
+ result, err = client.GenerateNewSitePublishingPasswordSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DeleteSiteVNETConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure responding to request")
}
return
}
-// DeleteSiteVNETConnectionSlotPreparer prepares the DeleteSiteVNETConnectionSlot request.
-func (client SitesClient) DeleteSiteVNETConnectionSlotPreparer(resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) {
+// GenerateNewSitePublishingPasswordSlotPreparer prepares the GenerateNewSitePublishingPasswordSlot request.
+func (client SitesClient) GenerateNewSitePublishingPasswordSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsDelete(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DeleteSiteVNETConnectionSlotSender sends the DeleteSiteVNETConnectionSlot request. The method will close the
+// GenerateNewSitePublishingPasswordSlotSender sends the GenerateNewSitePublishingPasswordSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DeleteSiteVNETConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GenerateNewSitePublishingPasswordSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DeleteSiteVNETConnectionSlotResponder handles the response to the DeleteSiteVNETConnectionSlot request. The method always
+// GenerateNewSitePublishingPasswordSlotResponder handles the response to the GenerateNewSitePublishingPasswordSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DeleteSiteVNETConnectionSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GenerateNewSitePublishingPasswordSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DiscoverSiteRestore sends the discover site restore request.
+// GetDeletedSites sends the get deleted sites request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on restore request
-func (client SitesClient) DiscoverSiteRestore(resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, ae error) {
- req, err := client.DiscoverSiteRestorePreparer(resourceGroupName, name, request)
+// resourceGroupName is name of resource group propertiesToInclude is
+// additional web app properties included in the response includeSiteTypes is
+// types of apps included in the response
+func (client SitesClient) GetDeletedSites(resourceGroupName string, propertiesToInclude string, includeSiteTypes string) (result DeletedSiteCollection, err error) {
+ req, err := client.GetDeletedSitesPreparer(resourceGroupName, propertiesToInclude, includeSiteTypes)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestore", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeletedSites", nil, "Failure preparing request")
}
- resp, err := client.DiscoverSiteRestoreSender(req)
+ resp, err := client.GetDeletedSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestore", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeletedSites", resp, "Failure sending request")
}
- result, err = client.DiscoverSiteRestoreResponder(resp)
+ result, err = client.GetDeletedSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestore", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetDeletedSites", resp, "Failure responding to request")
}
return
}
-// DiscoverSiteRestorePreparer prepares the DiscoverSiteRestore request.
-func (client SitesClient) DiscoverSiteRestorePreparer(resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) {
+// GetDeletedSitesPreparer prepares the GetDeletedSites request.
+func (client SitesClient) GetDeletedSitesPreparer(resourceGroupName string, propertiesToInclude string, includeSiteTypes string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(propertiesToInclude) > 0 {
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
+ }
+ if len(includeSiteTypes) > 0 {
+ queryParameters["includeSiteTypes"] = autorest.Encode("query", includeSiteTypes)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/discover"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/deletedSites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DiscoverSiteRestoreSender sends the DiscoverSiteRestore request. The method will close the
+// GetDeletedSitesSender sends the GetDeletedSites request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DiscoverSiteRestoreSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetDeletedSitesSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DiscoverSiteRestoreResponder handles the response to the DiscoverSiteRestore request. The method always
+// GetDeletedSitesResponder handles the response to the GetDeletedSites request. The method always
// closes the http.Response Body.
-func (client SitesClient) DiscoverSiteRestoreResponder(resp *http.Response) (result RestoreRequest, err error) {
+func (client SitesClient) GetDeletedSitesResponder(resp *http.Response) (result DeletedSiteCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DiscoverSiteRestoreDeprecated sends the discover site restore deprecated
-// request.
+// GetDeployment sends the get deployment request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on restore request
-func (client SitesClient) DiscoverSiteRestoreDeprecated(resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, ae error) {
- req, err := client.DiscoverSiteRestoreDeprecatedPreparer(resourceGroupName, name, request)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment
+func (client SitesClient) GetDeployment(resourceGroupName string, name string, id string) (result Deployment, err error) {
+ req, err := client.GetDeploymentPreparer(resourceGroupName, name, id)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecated", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployment", nil, "Failure preparing request")
}
- resp, err := client.DiscoverSiteRestoreDeprecatedSender(req)
+ resp, err := client.GetDeploymentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecated", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployment", resp, "Failure sending request")
}
- result, err = client.DiscoverSiteRestoreDeprecatedResponder(resp)
+ result, err = client.GetDeploymentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecated", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployment", resp, "Failure responding to request")
}
return
}
-// DiscoverSiteRestoreDeprecatedPreparer prepares the DiscoverSiteRestoreDeprecated request.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedPreparer(resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) {
+// GetDeploymentPreparer prepares the GetDeployment request.
+func (client SitesClient) GetDeploymentPreparer(resourceGroupName string, name string, id string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restore/discover"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DiscoverSiteRestoreDeprecatedSender sends the DiscoverSiteRestoreDeprecated request. The method will close the
+// GetDeploymentSender sends the GetDeployment request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DiscoverSiteRestoreDeprecatedResponder handles the response to the DiscoverSiteRestoreDeprecated request. The method always
+// GetDeploymentResponder handles the response to the GetDeployment request. The method always
// closes the http.Response Body.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedResponder(resp *http.Response) (result RestoreRequest, err error) {
+func (client SitesClient) GetDeploymentResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DiscoverSiteRestoreDeprecatedSlot sends the discover site restore
-// deprecated slot request.
+// GetDeployments sends the get deployments request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on restore request slot is name of web app slot. If not
-// specified then will default to production slot.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedSlot(resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, ae error) {
- req, err := client.DiscoverSiteRestoreDeprecatedSlotPreparer(resourceGroupName, name, request, slot)
+// resourceGroupName is name of resource group name is name of web app
+func (client SitesClient) GetDeployments(resourceGroupName string, name string) (result DeploymentCollection, err error) {
+ req, err := client.GetDeploymentsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecatedSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployments", nil, "Failure preparing request")
}
- resp, err := client.DiscoverSiteRestoreDeprecatedSlotSender(req)
+ resp, err := client.GetDeploymentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecatedSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployments", resp, "Failure sending request")
}
- result, err = client.DiscoverSiteRestoreDeprecatedSlotResponder(resp)
+ result, err = client.GetDeploymentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreDeprecatedSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetDeployments", resp, "Failure responding to request")
}
return
}
-// DiscoverSiteRestoreDeprecatedSlotPreparer prepares the DiscoverSiteRestoreDeprecatedSlot request.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedSlotPreparer(resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) {
+// GetDeploymentsPreparer prepares the GetDeployments request.
+func (client SitesClient) GetDeploymentsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restore/discover"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DiscoverSiteRestoreDeprecatedSlotSender sends the DiscoverSiteRestoreDeprecatedSlot request. The method will close the
+// GetDeploymentsSender sends the GetDeployments request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetDeploymentsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DiscoverSiteRestoreDeprecatedSlotResponder handles the response to the DiscoverSiteRestoreDeprecatedSlot request. The method always
+// GetDeploymentsResponder handles the response to the GetDeployments request. The method always
// closes the http.Response Body.
-func (client SitesClient) DiscoverSiteRestoreDeprecatedSlotResponder(resp *http.Response) (result RestoreRequest, err error) {
+func (client SitesClient) GetDeploymentsResponder(resp *http.Response) (result DeploymentCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// DiscoverSiteRestoreSlot sends the discover site restore slot request.
+// GetDeploymentSlot sends the get deployment slot request.
//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on restore request slot is name of web app slot. If not
-// specified then will default to production slot.
-func (client SitesClient) DiscoverSiteRestoreSlot(resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, ae error) {
- req, err := client.DiscoverSiteRestoreSlotPreparer(resourceGroupName, name, request, slot)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot.
+func (client SitesClient) GetDeploymentSlot(resourceGroupName string, name string, id string, slot string) (result Deployment, err error) {
+ req, err := client.GetDeploymentSlotPreparer(resourceGroupName, name, id, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentSlot", nil, "Failure preparing request")
}
- resp, err := client.DiscoverSiteRestoreSlotSender(req)
+ resp, err := client.GetDeploymentSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentSlot", resp, "Failure sending request")
}
- result, err = client.DiscoverSiteRestoreSlotResponder(resp)
+ result, err = client.GetDeploymentSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "DiscoverSiteRestoreSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentSlot", resp, "Failure responding to request")
}
return
}
-// DiscoverSiteRestoreSlotPreparer prepares the DiscoverSiteRestoreSlot request.
-func (client SitesClient) DiscoverSiteRestoreSlotPreparer(resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) {
+// GetDeploymentSlotPreparer prepares the GetDeploymentSlot request.
+func (client SitesClient) GetDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/discover"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// DiscoverSiteRestoreSlotSender sends the DiscoverSiteRestoreSlot request. The method will close the
+// GetDeploymentSlotSender sends the GetDeploymentSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) DiscoverSiteRestoreSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// DiscoverSiteRestoreSlotResponder handles the response to the DiscoverSiteRestoreSlot request. The method always
+// GetDeploymentSlotResponder handles the response to the GetDeploymentSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) DiscoverSiteRestoreSlotResponder(resp *http.Response) (result RestoreRequest, err error) {
+func (client SitesClient) GetDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GenerateNewSitePublishingPassword sends the generate new site publishing
-// password request.
+// GetDeploymentsSlot sends the get deployments slot request.
//
-// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GenerateNewSitePublishingPassword(resourceGroupName string, name string) (result ObjectSet, ae error) {
- req, err := client.GenerateNewSitePublishingPasswordPreparer(resourceGroupName, name)
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot.
+func (client SitesClient) GetDeploymentsSlot(resourceGroupName string, name string, slot string) (result DeploymentCollection, err error) {
+ req, err := client.GetDeploymentsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPassword", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentsSlot", nil, "Failure preparing request")
}
- resp, err := client.GenerateNewSitePublishingPasswordSender(req)
+ resp, err := client.GetDeploymentsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPassword", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentsSlot", resp, "Failure sending request")
}
- result, err = client.GenerateNewSitePublishingPasswordResponder(resp)
+ result, err = client.GetDeploymentsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPassword", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetDeploymentsSlot", resp, "Failure responding to request")
}
return
}
-// GenerateNewSitePublishingPasswordPreparer prepares the GenerateNewSitePublishingPassword request.
-func (client SitesClient) GenerateNewSitePublishingPasswordPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// GetDeploymentsSlotPreparer prepares the GetDeploymentsSlot request.
+func (client SitesClient) GetDeploymentsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GenerateNewSitePublishingPasswordSender sends the GenerateNewSitePublishingPassword request. The method will close the
+// GetDeploymentsSlotSender sends the GetDeploymentsSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GenerateNewSitePublishingPasswordSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetDeploymentsSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GenerateNewSitePublishingPasswordResponder handles the response to the GenerateNewSitePublishingPassword request. The method always
+// GetDeploymentsSlotResponder handles the response to the GetDeploymentsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GenerateNewSitePublishingPasswordResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetDeploymentsSlotResponder(resp *http.Response) (result DeploymentCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GenerateNewSitePublishingPasswordSlot sends the generate new site
-// publishing password slot request.
+// GetInstanceDeployment sends the get instance deployment request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) GenerateNewSitePublishingPasswordSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
- req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(resourceGroupName, name, slot)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment instanceID is id of web app instance
+func (client SitesClient) GetInstanceDeployment(resourceGroupName string, name string, id string, instanceID string) (result Deployment, err error) {
+ req, err := client.GetInstanceDeploymentPreparer(resourceGroupName, name, id, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPasswordSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployment", nil, "Failure preparing request")
}
- resp, err := client.GenerateNewSitePublishingPasswordSlotSender(req)
+ resp, err := client.GetInstanceDeploymentSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPasswordSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployment", resp, "Failure sending request")
}
- result, err = client.GenerateNewSitePublishingPasswordSlotResponder(resp)
+ result, err = client.GetInstanceDeploymentResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GenerateNewSitePublishingPasswordSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployment", resp, "Failure responding to request")
}
return
}
-// GenerateNewSitePublishingPasswordSlotPreparer prepares the GenerateNewSitePublishingPasswordSlot request.
-func (client SitesClient) GenerateNewSitePublishingPasswordSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// GetInstanceDeploymentPreparer prepares the GetInstanceDeployment request.
+func (client SitesClient) GetInstanceDeploymentPreparer(resourceGroupName string, name string, id string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GenerateNewSitePublishingPasswordSlotSender sends the GenerateNewSitePublishingPasswordSlot request. The method will close the
+// GetInstanceDeploymentSender sends the GetInstanceDeployment request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GenerateNewSitePublishingPasswordSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetInstanceDeploymentSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GenerateNewSitePublishingPasswordSlotResponder handles the response to the GenerateNewSitePublishingPasswordSlot request. The method always
+// GetInstanceDeploymentResponder handles the response to the GetInstanceDeployment request. The method always
// closes the http.Response Body.
-func (client SitesClient) GenerateNewSitePublishingPasswordSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetInstanceDeploymentResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetDeletedSites sends the get deleted sites request.
+// GetInstanceDeployments sends the get instance deployments request.
//
-// resourceGroupName is name of resource group propertiesToInclude is
-// additional web app properties included in the response includeSiteTypes is
-// types of apps included in the response
-func (client SitesClient) GetDeletedSites(resourceGroupName string, propertiesToInclude string, includeSiteTypes string) (result DeletedSiteCollection, ae error) {
- req, err := client.GetDeletedSitesPreparer(resourceGroupName, propertiesToInclude, includeSiteTypes)
+// resourceGroupName is name of resource group name is name of web app
+// instanceID is id of web app instance
+func (client SitesClient) GetInstanceDeployments(resourceGroupName string, name string, instanceID string) (result DeploymentCollection, err error) {
+ req, err := client.GetInstanceDeploymentsPreparer(resourceGroupName, name, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetDeletedSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployments", nil, "Failure preparing request")
}
- resp, err := client.GetDeletedSitesSender(req)
+ resp, err := client.GetInstanceDeploymentsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetDeletedSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployments", resp, "Failure sending request")
}
- result, err = client.GetDeletedSitesResponder(resp)
+ result, err = client.GetInstanceDeploymentsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetDeletedSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeployments", resp, "Failure responding to request")
}
return
}
-// GetDeletedSitesPreparer prepares the GetDeletedSites request.
-func (client SitesClient) GetDeletedSitesPreparer(resourceGroupName string, propertiesToInclude string, includeSiteTypes string) (*http.Request, error) {
+// GetInstanceDeploymentsPreparer prepares the GetInstanceDeployments request.
+func (client SitesClient) GetInstanceDeploymentsPreparer(resourceGroupName string, name string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
- }
- if len(includeSiteTypes) > 0 {
- queryParameters["includeSiteTypes"] = includeSiteTypes
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/deletedSites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/deployments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GetDeletedSitesSender sends the GetDeletedSites request. The method will close the
+// GetInstanceDeploymentsSender sends the GetInstanceDeployments request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GetDeletedSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetInstanceDeploymentsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GetDeletedSitesResponder handles the response to the GetDeletedSites request. The method always
+// GetInstanceDeploymentsResponder handles the response to the GetInstanceDeployments request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetDeletedSitesResponder(resp *http.Response) (result DeletedSiteCollection, err error) {
+func (client SitesClient) GetInstanceDeploymentsResponder(resp *http.Response) (result DeploymentCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetSite sends the get site request.
+// GetInstanceDeploymentSlot sends the get instance deployment slot request.
//
-// resourceGroupName is name of resource group name is name of web app
-// propertiesToInclude is additional web app properties included in the
-// response
-func (client SitesClient) GetSite(resourceGroupName string, name string, propertiesToInclude string) (result Site, ae error) {
- req, err := client.GetSitePreparer(resourceGroupName, name, propertiesToInclude)
+// resourceGroupName is name of resource group name is name of web app id is
+// id of the deployment slot is name of web app slot. If not specified then
+// will default to production slot. instanceID is id of web app instance
+func (client SitesClient) GetInstanceDeploymentSlot(resourceGroupName string, name string, id string, slot string, instanceID string) (result Deployment, err error) {
+ req, err := client.GetInstanceDeploymentSlotPreparer(resourceGroupName, name, id, slot, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentSlot", nil, "Failure preparing request")
}
- resp, err := client.GetSiteSender(req)
+ resp, err := client.GetInstanceDeploymentSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentSlot", resp, "Failure sending request")
}
- result, err = client.GetSiteResponder(resp)
+ result, err = client.GetInstanceDeploymentSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentSlot", resp, "Failure responding to request")
}
return
}
-// GetSitePreparer prepares the GetSite request.
-func (client SitesClient) GetSitePreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
+// GetInstanceDeploymentSlotPreparer prepares the GetInstanceDeploymentSlot request.
+func (client SitesClient) GetInstanceDeploymentSlotPreparer(resourceGroupName string, name string, id string, slot string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "id": autorest.Encode("path", id),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/deployments/{id}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GetSiteSender sends the GetSite request. The method will close the
+// GetInstanceDeploymentSlotSender sends the GetInstanceDeploymentSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetInstanceDeploymentSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GetSiteResponder handles the response to the GetSite request. The method always
+// GetInstanceDeploymentSlotResponder handles the response to the GetInstanceDeploymentSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteResponder(resp *http.Response) (result Site, err error) {
+func (client SitesClient) GetInstanceDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetSiteBackupConfiguration sends the get site backup configuration request.
+// GetInstanceDeploymentsSlot sends the get instance deployments slot request.
//
-// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteBackupConfiguration(resourceGroupName string, name string) (result BackupRequest, ae error) {
- req, err := client.GetSiteBackupConfigurationPreparer(resourceGroupName, name)
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot. instanceID is id of web app instance
+func (client SitesClient) GetInstanceDeploymentsSlot(resourceGroupName string, name string, slot string, instanceID string) (result DeploymentCollection, err error) {
+ req, err := client.GetInstanceDeploymentsSlotPreparer(resourceGroupName, name, slot, instanceID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfiguration", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentsSlot", nil, "Failure preparing request")
}
- resp, err := client.GetSiteBackupConfigurationSender(req)
+ resp, err := client.GetInstanceDeploymentsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfiguration", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentsSlot", resp, "Failure sending request")
}
- result, err = client.GetSiteBackupConfigurationResponder(resp)
+ result, err = client.GetInstanceDeploymentsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfiguration", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetInstanceDeploymentsSlot", resp, "Failure responding to request")
}
return
}
-// GetSiteBackupConfigurationPreparer prepares the GetSiteBackupConfiguration request.
-func (client SitesClient) GetSiteBackupConfigurationPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// GetInstanceDeploymentsSlotPreparer prepares the GetInstanceDeploymentsSlot request.
+func (client SitesClient) GetInstanceDeploymentsSlotPreparer(resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "instanceId": autorest.Encode("path", instanceID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/deployments", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GetSiteBackupConfigurationSender sends the GetSiteBackupConfiguration request. The method will close the
+// GetInstanceDeploymentsSlotSender sends the GetInstanceDeploymentsSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteBackupConfigurationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetInstanceDeploymentsSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GetSiteBackupConfigurationResponder handles the response to the GetSiteBackupConfiguration request. The method always
+// GetInstanceDeploymentsSlotResponder handles the response to the GetInstanceDeploymentsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) {
+func (client SitesClient) GetInstanceDeploymentsSlotResponder(resp *http.Response) (result DeploymentCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetSiteBackupConfigurationDeprecated sends the get site backup
-// configuration deprecated request.
+// GetSite sends the get site request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteBackupConfigurationDeprecated(resourceGroupName string, name string) (result BackupRequest, ae error) {
- req, err := client.GetSiteBackupConfigurationDeprecatedPreparer(resourceGroupName, name)
+// propertiesToInclude is additional web app properties included in the
+// response
+func (client SitesClient) GetSite(resourceGroupName string, name string, propertiesToInclude string) (result Site, err error) {
+ req, err := client.GetSitePreparer(resourceGroupName, name, propertiesToInclude)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecated", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSite", nil, "Failure preparing request")
}
- resp, err := client.GetSiteBackupConfigurationDeprecatedSender(req)
+ resp, err := client.GetSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecated", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSite", resp, "Failure sending request")
}
- result, err = client.GetSiteBackupConfigurationDeprecatedResponder(resp)
+ result, err = client.GetSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecated", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSite", resp, "Failure responding to request")
}
return
}
-// GetSiteBackupConfigurationDeprecatedPreparer prepares the GetSiteBackupConfigurationDeprecated request.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// GetSitePreparer prepares the GetSite request.
+func (client SitesClient) GetSitePreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
+ }
+ if len(propertiesToInclude) > 0 {
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup/config"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GetSiteBackupConfigurationDeprecatedSender sends the GetSiteBackupConfigurationDeprecated request. The method will close the
+// GetSiteSender sends the GetSite request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetSiteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GetSiteBackupConfigurationDeprecatedResponder handles the response to the GetSiteBackupConfigurationDeprecated request. The method always
+// GetSiteResponder handles the response to the GetSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedResponder(resp *http.Response) (result BackupRequest, err error) {
+func (client SitesClient) GetSiteResponder(resp *http.Response) (result Site, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// GetSiteBackupConfigurationDeprecatedSlot sends the get site backup
-// configuration deprecated slot request.
+// GetSiteBackupConfiguration sends the get site backup configuration request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedSlot(resourceGroupName string, name string, slot string) (result BackupRequest, ae error) {
- req, err := client.GetSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName, name, slot)
+// resourceGroupName is name of resource group name is name of web app
+func (client SitesClient) GetSiteBackupConfiguration(resourceGroupName string, name string) (result BackupRequest, err error) {
+ req, err := client.GetSiteBackupConfigurationPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecatedSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfiguration", nil, "Failure preparing request")
}
- resp, err := client.GetSiteBackupConfigurationDeprecatedSlotSender(req)
+ resp, err := client.GetSiteBackupConfigurationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecatedSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfiguration", resp, "Failure sending request")
}
- result, err = client.GetSiteBackupConfigurationDeprecatedSlotResponder(resp)
+ result, err = client.GetSiteBackupConfigurationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationDeprecatedSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfiguration", resp, "Failure responding to request")
}
return
}
-// GetSiteBackupConfigurationDeprecatedSlotPreparer prepares the GetSiteBackupConfigurationDeprecatedSlot request.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// GetSiteBackupConfigurationPreparer prepares the GetSiteBackupConfiguration request.
+func (client SitesClient) GetSiteBackupConfigurationPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup/config"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// GetSiteBackupConfigurationDeprecatedSlotSender sends the GetSiteBackupConfigurationDeprecatedSlot request. The method will close the
+// GetSiteBackupConfigurationSender sends the GetSiteBackupConfiguration request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) GetSiteBackupConfigurationSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// GetSiteBackupConfigurationDeprecatedSlotResponder handles the response to the GetSiteBackupConfigurationDeprecatedSlot request. The method always
+// GetSiteBackupConfigurationResponder handles the response to the GetSiteBackupConfiguration request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteBackupConfigurationDeprecatedSlotResponder(resp *http.Response) (result BackupRequest, err error) {
+func (client SitesClient) GetSiteBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3258,21 +3905,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteBackupConfigurationSlot(resourceGroupName string, name string, slot string) (result BackupRequest, ae error) {
+func (client SitesClient) GetSiteBackupConfigurationSlot(resourceGroupName string, name string, slot string) (result BackupRequest, err error) {
req, err := client.GetSiteBackupConfigurationSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfigurationSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteBackupConfigurationSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfigurationSlot", resp, "Failure sending request")
}
result, err = client.GetSiteBackupConfigurationSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupConfigurationSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupConfigurationSlot", resp, "Failure responding to request")
}
return
@@ -3281,29 +3928,28 @@
// GetSiteBackupConfigurationSlotPreparer prepares the GetSiteBackupConfigurationSlot request.
func (client SitesClient) GetSiteBackupConfigurationSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteBackupConfigurationSlotSender sends the GetSiteBackupConfigurationSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteBackupConfigurationSlotResponder handles the response to the GetSiteBackupConfigurationSlot request. The method always
@@ -3312,7 +3958,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3323,21 +3969,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup
-func (client SitesClient) GetSiteBackupStatus(resourceGroupName string, name string, backupID string) (result BackupItem, ae error) {
+func (client SitesClient) GetSiteBackupStatus(resourceGroupName string, name string, backupID string) (result BackupItem, err error) {
req, err := client.GetSiteBackupStatusPreparer(resourceGroupName, name, backupID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatus", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatus", nil, "Failure preparing request")
}
resp, err := client.GetSiteBackupStatusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatus", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatus", resp, "Failure sending request")
}
result, err = client.GetSiteBackupStatusResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatus", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatus", resp, "Failure responding to request")
}
return
@@ -3346,29 +3992,28 @@
// GetSiteBackupStatusPreparer prepares the GetSiteBackupStatus request.
func (client SitesClient) GetSiteBackupStatusPreparer(resourceGroupName string, name string, backupID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteBackupStatusSender sends the GetSiteBackupStatus request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteBackupStatusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteBackupStatusResponder handles the response to the GetSiteBackupStatus request. The method always
@@ -3377,7 +4022,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3388,21 +4033,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup request is information on backup request
-func (client SitesClient) GetSiteBackupStatusSecrets(resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, ae error) {
+func (client SitesClient) GetSiteBackupStatusSecrets(resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, err error) {
req, err := client.GetSiteBackupStatusSecretsPreparer(resourceGroupName, name, backupID, request)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecrets", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecrets", nil, "Failure preparing request")
}
resp, err := client.GetSiteBackupStatusSecretsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecrets", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecrets", resp, "Failure sending request")
}
result, err = client.GetSiteBackupStatusSecretsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecrets", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecrets", resp, "Failure responding to request")
}
return
@@ -3411,30 +4056,30 @@
// GetSiteBackupStatusSecretsPreparer prepares the GetSiteBackupStatusSecrets request.
func (client SitesClient) GetSiteBackupStatusSecretsPreparer(resourceGroupName string, name string, backupID string, request BackupRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteBackupStatusSecretsSender sends the GetSiteBackupStatusSecrets request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteBackupStatusSecretsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteBackupStatusSecretsResponder handles the response to the GetSiteBackupStatusSecrets request. The method always
@@ -3443,7 +4088,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3457,21 +4102,21 @@
// backupID is id of backup request is information on backup request slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteBackupStatusSecretsSlot(resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, ae error) {
+func (client SitesClient) GetSiteBackupStatusSecretsSlot(resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, err error) {
req, err := client.GetSiteBackupStatusSecretsSlotPreparer(resourceGroupName, name, backupID, request, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecretsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecretsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteBackupStatusSecretsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecretsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecretsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteBackupStatusSecretsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSecretsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSecretsSlot", resp, "Failure responding to request")
}
return
@@ -3480,31 +4125,31 @@
// GetSiteBackupStatusSecretsSlotPreparer prepares the GetSiteBackupStatusSecretsSlot request.
func (client SitesClient) GetSiteBackupStatusSecretsSlotPreparer(resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteBackupStatusSecretsSlotSender sends the GetSiteBackupStatusSecretsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteBackupStatusSecretsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteBackupStatusSecretsSlotResponder handles the response to the GetSiteBackupStatusSecretsSlot request. The method always
@@ -3513,7 +4158,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3525,21 +4170,21 @@
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup slot is name of web app slot. If not specified
// then will default to production slot.
-func (client SitesClient) GetSiteBackupStatusSlot(resourceGroupName string, name string, backupID string, slot string) (result BackupItem, ae error) {
+func (client SitesClient) GetSiteBackupStatusSlot(resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) {
req, err := client.GetSiteBackupStatusSlotPreparer(resourceGroupName, name, backupID, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteBackupStatusSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSlot", resp, "Failure sending request")
}
result, err = client.GetSiteBackupStatusSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteBackupStatusSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteBackupStatusSlot", resp, "Failure responding to request")
}
return
@@ -3548,30 +4193,29 @@
// GetSiteBackupStatusSlotPreparer prepares the GetSiteBackupStatusSlot request.
func (client SitesClient) GetSiteBackupStatusSlotPreparer(resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteBackupStatusSlotSender sends the GetSiteBackupStatusSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteBackupStatusSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteBackupStatusSlotResponder handles the response to the GetSiteBackupStatusSlot request. The method always
@@ -3580,7 +4224,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3590,21 +4234,21 @@
// GetSiteConfig sends the get site config request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteConfig(resourceGroupName string, name string) (result SiteConfig, ae error) {
+func (client SitesClient) GetSiteConfig(resourceGroupName string, name string) (result SiteConfig, err error) {
req, err := client.GetSiteConfigPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfig", nil, "Failure preparing request")
}
resp, err := client.GetSiteConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfig", resp, "Failure sending request")
}
result, err = client.GetSiteConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfig", resp, "Failure responding to request")
}
return
@@ -3613,28 +4257,27 @@
// GetSiteConfigPreparer prepares the GetSiteConfig request.
func (client SitesClient) GetSiteConfigPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteConfigSender sends the GetSiteConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteConfigResponder handles the response to the GetSiteConfig request. The method always
@@ -3643,7 +4286,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3655,21 +4298,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteConfigSlot(resourceGroupName string, name string, slot string) (result SiteConfig, ae error) {
+func (client SitesClient) GetSiteConfigSlot(resourceGroupName string, name string, slot string) (result SiteConfig, err error) {
req, err := client.GetSiteConfigSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfigSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfigSlot", resp, "Failure sending request")
}
result, err = client.GetSiteConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteConfigSlot", resp, "Failure responding to request")
}
return
@@ -3678,29 +4321,28 @@
// GetSiteConfigSlotPreparer prepares the GetSiteConfigSlot request.
func (client SitesClient) GetSiteConfigSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteConfigSlotSender sends the GetSiteConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteConfigSlotResponder handles the response to the GetSiteConfigSlot request. The method always
@@ -3709,7 +4351,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3720,21 +4362,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// hostName is name of host
-func (client SitesClient) GetSiteHostNameBinding(resourceGroupName string, name string, hostName string) (result HostNameBinding, ae error) {
+func (client SitesClient) GetSiteHostNameBinding(resourceGroupName string, name string, hostName string) (result HostNameBinding, err error) {
req, err := client.GetSiteHostNameBindingPreparer(resourceGroupName, name, hostName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBinding", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBinding", nil, "Failure preparing request")
}
resp, err := client.GetSiteHostNameBindingSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBinding", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBinding", resp, "Failure sending request")
}
result, err = client.GetSiteHostNameBindingResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBinding", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBinding", resp, "Failure responding to request")
}
return
@@ -3743,29 +4385,28 @@
// GetSiteHostNameBindingPreparer prepares the GetSiteHostNameBinding request.
func (client SitesClient) GetSiteHostNameBindingPreparer(resourceGroupName string, name string, hostName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteHostNameBindingSender sends the GetSiteHostNameBinding request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteHostNameBindingSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteHostNameBindingResponder handles the response to the GetSiteHostNameBinding request. The method always
@@ -3774,7 +4415,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3784,21 +4425,21 @@
// GetSiteHostNameBindings sends the get site host name bindings request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteHostNameBindings(resourceGroupName string, name string) (result HostNameBindingCollection, ae error) {
+func (client SitesClient) GetSiteHostNameBindings(resourceGroupName string, name string) (result HostNameBindingCollection, err error) {
req, err := client.GetSiteHostNameBindingsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindings", nil, "Failure preparing request")
}
resp, err := client.GetSiteHostNameBindingsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindings", resp, "Failure sending request")
}
result, err = client.GetSiteHostNameBindingsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindings", resp, "Failure responding to request")
}
return
@@ -3807,28 +4448,27 @@
// GetSiteHostNameBindingsPreparer prepares the GetSiteHostNameBindings request.
func (client SitesClient) GetSiteHostNameBindingsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteHostNameBindingsSender sends the GetSiteHostNameBindings request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteHostNameBindingsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteHostNameBindingsResponder handles the response to the GetSiteHostNameBindings request. The method always
@@ -3837,7 +4477,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3850,21 +4490,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot. hostName is name of host
-func (client SitesClient) GetSiteHostNameBindingSlot(resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, ae error) {
+func (client SitesClient) GetSiteHostNameBindingSlot(resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, err error) {
req, err := client.GetSiteHostNameBindingSlotPreparer(resourceGroupName, name, slot, hostName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteHostNameBindingSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingSlot", resp, "Failure sending request")
}
result, err = client.GetSiteHostNameBindingSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingSlot", resp, "Failure responding to request")
}
return
@@ -3873,30 +4513,29 @@
// GetSiteHostNameBindingSlotPreparer prepares the GetSiteHostNameBindingSlot request.
func (client SitesClient) GetSiteHostNameBindingSlotPreparer(resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "hostName": url.QueryEscape(hostName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "hostName": autorest.Encode("path", hostName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteHostNameBindingSlotSender sends the GetSiteHostNameBindingSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteHostNameBindingSlotResponder handles the response to the GetSiteHostNameBindingSlot request. The method always
@@ -3905,7 +4544,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3918,21 +4557,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteHostNameBindingsSlot(resourceGroupName string, name string, slot string) (result HostNameBindingCollection, ae error) {
+func (client SitesClient) GetSiteHostNameBindingsSlot(resourceGroupName string, name string, slot string) (result HostNameBindingCollection, err error) {
req, err := client.GetSiteHostNameBindingsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteHostNameBindingsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteHostNameBindingsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteHostNameBindingsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteHostNameBindingsSlot", resp, "Failure responding to request")
}
return
@@ -3941,29 +4580,28 @@
// GetSiteHostNameBindingsSlotPreparer prepares the GetSiteHostNameBindingsSlot request.
func (client SitesClient) GetSiteHostNameBindingsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteHostNameBindingsSlotSender sends the GetSiteHostNameBindingsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteHostNameBindingsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteHostNameBindingsSlotResponder handles the response to the GetSiteHostNameBindingsSlot request. The method always
@@ -3972,7 +4610,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -3982,21 +4620,21 @@
// GetSiteInstanceIdentifiers sends the get site instance identifiers request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteInstanceIdentifiers(resourceGroupName string, name string) (result SiteInstanceCollection, ae error) {
+func (client SitesClient) GetSiteInstanceIdentifiers(resourceGroupName string, name string) (result SiteInstanceCollection, err error) {
req, err := client.GetSiteInstanceIdentifiersPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiers", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiers", nil, "Failure preparing request")
}
resp, err := client.GetSiteInstanceIdentifiersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiers", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiers", resp, "Failure sending request")
}
result, err = client.GetSiteInstanceIdentifiersResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiers", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiers", resp, "Failure responding to request")
}
return
@@ -4005,28 +4643,27 @@
// GetSiteInstanceIdentifiersPreparer prepares the GetSiteInstanceIdentifiers request.
func (client SitesClient) GetSiteInstanceIdentifiersPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteInstanceIdentifiersSender sends the GetSiteInstanceIdentifiers request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteInstanceIdentifiersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteInstanceIdentifiersResponder handles the response to the GetSiteInstanceIdentifiers request. The method always
@@ -4035,7 +4672,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4048,21 +4685,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteInstanceIdentifiersSlot(resourceGroupName string, name string, slot string) (result SiteInstanceCollection, ae error) {
+func (client SitesClient) GetSiteInstanceIdentifiersSlot(resourceGroupName string, name string, slot string) (result SiteInstanceCollection, err error) {
req, err := client.GetSiteInstanceIdentifiersSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiersSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiersSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteInstanceIdentifiersSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiersSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiersSlot", resp, "Failure sending request")
}
result, err = client.GetSiteInstanceIdentifiersSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteInstanceIdentifiersSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteInstanceIdentifiersSlot", resp, "Failure responding to request")
}
return
@@ -4071,29 +4708,28 @@
// GetSiteInstanceIdentifiersSlotPreparer prepares the GetSiteInstanceIdentifiersSlot request.
func (client SitesClient) GetSiteInstanceIdentifiersSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteInstanceIdentifiersSlotSender sends the GetSiteInstanceIdentifiersSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteInstanceIdentifiersSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteInstanceIdentifiersSlotResponder handles the response to the GetSiteInstanceIdentifiersSlot request. The method always
@@ -4102,7 +4738,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4112,21 +4748,21 @@
// GetSiteLogsConfig sends the get site logs config request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteLogsConfig(resourceGroupName string, name string) (result SiteLogsConfig, ae error) {
+func (client SitesClient) GetSiteLogsConfig(resourceGroupName string, name string) (result SiteLogsConfig, err error) {
req, err := client.GetSiteLogsConfigPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfig", nil, "Failure preparing request")
}
resp, err := client.GetSiteLogsConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfig", resp, "Failure sending request")
}
result, err = client.GetSiteLogsConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfig", resp, "Failure responding to request")
}
return
@@ -4135,28 +4771,27 @@
// GetSiteLogsConfigPreparer prepares the GetSiteLogsConfig request.
func (client SitesClient) GetSiteLogsConfigPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteLogsConfigSender sends the GetSiteLogsConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteLogsConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteLogsConfigResponder handles the response to the GetSiteLogsConfig request. The method always
@@ -4165,7 +4800,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4177,21 +4812,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteLogsConfigSlot(resourceGroupName string, name string, slot string) (result SiteLogsConfig, ae error) {
+func (client SitesClient) GetSiteLogsConfigSlot(resourceGroupName string, name string, slot string) (result SiteLogsConfig, err error) {
req, err := client.GetSiteLogsConfigSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfigSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteLogsConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfigSlot", resp, "Failure sending request")
}
result, err = client.GetSiteLogsConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteLogsConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteLogsConfigSlot", resp, "Failure responding to request")
}
return
@@ -4200,29 +4835,28 @@
// GetSiteLogsConfigSlotPreparer prepares the GetSiteLogsConfigSlot request.
func (client SitesClient) GetSiteLogsConfigSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteLogsConfigSlotSender sends the GetSiteLogsConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteLogsConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteLogsConfigSlotResponder handles the response to the GetSiteLogsConfigSlot request. The method always
@@ -4231,7 +4865,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4241,21 +4875,21 @@
// GetSiteMetricDefinitions sends the get site metric definitions request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteMetricDefinitions(resourceGroupName string, name string) (result MetricDefinitionCollection, ae error) {
+func (client SitesClient) GetSiteMetricDefinitions(resourceGroupName string, name string) (result MetricDefinitionCollection, err error) {
req, err := client.GetSiteMetricDefinitionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitions", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitions", nil, "Failure preparing request")
}
resp, err := client.GetSiteMetricDefinitionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitions", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitions", resp, "Failure sending request")
}
result, err = client.GetSiteMetricDefinitionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitions", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitions", resp, "Failure responding to request")
}
return
@@ -4264,28 +4898,27 @@
// GetSiteMetricDefinitionsPreparer prepares the GetSiteMetricDefinitions request.
func (client SitesClient) GetSiteMetricDefinitionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteMetricDefinitionsSender sends the GetSiteMetricDefinitions request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteMetricDefinitionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteMetricDefinitionsResponder handles the response to the GetSiteMetricDefinitions request. The method always
@@ -4294,7 +4927,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4307,21 +4940,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteMetricDefinitionsSlot(resourceGroupName string, name string, slot string) (result MetricDefinitionCollection, ae error) {
+func (client SitesClient) GetSiteMetricDefinitionsSlot(resourceGroupName string, name string, slot string) (result MetricDefinitionCollection, err error) {
req, err := client.GetSiteMetricDefinitionsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitionsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitionsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteMetricDefinitionsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitionsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitionsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteMetricDefinitionsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricDefinitionsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricDefinitionsSlot", resp, "Failure responding to request")
}
return
@@ -4330,29 +4963,28 @@
// GetSiteMetricDefinitionsSlotPreparer prepares the GetSiteMetricDefinitionsSlot request.
func (client SitesClient) GetSiteMetricDefinitionsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteMetricDefinitionsSlotSender sends the GetSiteMetricDefinitionsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteMetricDefinitionsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteMetricDefinitionsSlotResponder handles the response to the GetSiteMetricDefinitionsSlot request. The method always
@@ -4361,7 +4993,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4376,21 +5008,21 @@
// Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and
// startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z'
// and timeGrain eq duration'[Hour|Minute|Day]'.
-func (client SitesClient) GetSiteMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client SitesClient) GetSiteMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetSiteMetricsPreparer(resourceGroupName, name, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetrics", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetrics", nil, "Failure preparing request")
}
resp, err := client.GetSiteMetricsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetrics", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetrics", resp, "Failure sending request")
}
result, err = client.GetSiteMetricsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetrics", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetrics", resp, "Failure responding to request")
}
return
@@ -4399,34 +5031,33 @@
// GetSiteMetricsPreparer prepares the GetSiteMetrics request.
func (client SitesClient) GetSiteMetricsPreparer(resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteMetricsSender sends the GetSiteMetrics request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteMetricsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteMetricsResponder handles the response to the GetSiteMetrics request. The method always
@@ -4435,7 +5066,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4451,21 +5082,21 @@
// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq
// 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq
// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
-func (client SitesClient) GetSiteMetricsSlot(resourceGroupName string, name string, slot string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
+func (client SitesClient) GetSiteMetricsSlot(resourceGroupName string, name string, slot string, details *bool, filter string) (result ResourceMetricCollection, err error) {
req, err := client.GetSiteMetricsSlotPreparer(resourceGroupName, name, slot, details, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteMetricsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteMetricsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteMetricsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteMetricsSlot", resp, "Failure responding to request")
}
return
@@ -4474,35 +5105,34 @@
// GetSiteMetricsSlotPreparer prepares the GetSiteMetricsSlot request.
func (client SitesClient) GetSiteMetricsSlotPreparer(resourceGroupName string, name string, slot string, details *bool, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if details != nil {
- queryParameters["details"] = details
+ queryParameters["details"] = autorest.Encode("query", *details)
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteMetricsSlotSender sends the GetSiteMetricsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteMetricsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteMetricsSlotResponder handles the response to the GetSiteMetricsSlot request. The method always
@@ -4511,7 +5141,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4522,21 +5152,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app view is the type of view. This can either be "summary" or "detailed".
-func (client SitesClient) GetSiteNetworkFeatures(resourceGroupName string, name string, view string) (result NetworkFeatures, ae error) {
+func (client SitesClient) GetSiteNetworkFeatures(resourceGroupName string, name string, view string) (result NetworkFeatures, err error) {
req, err := client.GetSiteNetworkFeaturesPreparer(resourceGroupName, name, view)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeatures", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeatures", nil, "Failure preparing request")
}
resp, err := client.GetSiteNetworkFeaturesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeatures", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeatures", resp, "Failure sending request")
}
result, err = client.GetSiteNetworkFeaturesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeatures", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeatures", resp, "Failure responding to request")
}
return
@@ -4545,29 +5175,28 @@
// GetSiteNetworkFeaturesPreparer prepares the GetSiteNetworkFeatures request.
func (client SitesClient) GetSiteNetworkFeaturesPreparer(resourceGroupName string, name string, view string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "view": url.QueryEscape(view),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "view": autorest.Encode("path", view),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteNetworkFeaturesSender sends the GetSiteNetworkFeatures request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteNetworkFeaturesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetSiteNetworkFeaturesResponder handles the response to the GetSiteNetworkFeatures request. The method always
@@ -4576,7 +5205,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4588,21 +5217,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app view is the type of view. This can either be "summary" or "detailed".
// slot is the name of the slot for this web app.
-func (client SitesClient) GetSiteNetworkFeaturesSlot(resourceGroupName string, name string, view string, slot string) (result NetworkFeatures, ae error) {
+func (client SitesClient) GetSiteNetworkFeaturesSlot(resourceGroupName string, name string, view string, slot string) (result NetworkFeatures, err error) {
req, err := client.GetSiteNetworkFeaturesSlotPreparer(resourceGroupName, name, view, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeaturesSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeaturesSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteNetworkFeaturesSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeaturesSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeaturesSlot", resp, "Failure sending request")
}
result, err = client.GetSiteNetworkFeaturesSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteNetworkFeaturesSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteNetworkFeaturesSlot", resp, "Failure responding to request")
}
return
@@ -4611,30 +5240,29 @@
// GetSiteNetworkFeaturesSlotPreparer prepares the GetSiteNetworkFeaturesSlot request.
func (client SitesClient) GetSiteNetworkFeaturesSlotPreparer(resourceGroupName string, name string, view string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "view": url.QueryEscape(view),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "view": autorest.Encode("path", view),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteNetworkFeaturesSlotSender sends the GetSiteNetworkFeaturesSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteNetworkFeaturesSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetSiteNetworkFeaturesSlotResponder handles the response to the GetSiteNetworkFeaturesSlot request. The method always
@@ -4643,7 +5271,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4654,21 +5282,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// operationID is id of an operation
-func (client SitesClient) GetSiteOperation(resourceGroupName string, name string, operationID string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSiteOperation(resourceGroupName string, name string, operationID string) (result SetObject, err error) {
req, err := client.GetSiteOperationPreparer(resourceGroupName, name, operationID)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperation", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperation", nil, "Failure preparing request")
}
resp, err := client.GetSiteOperationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperation", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperation", resp, "Failure sending request")
}
result, err = client.GetSiteOperationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperation", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperation", resp, "Failure responding to request")
}
return
@@ -4677,38 +5305,37 @@
// GetSiteOperationPreparer prepares the GetSiteOperation request.
func (client SitesClient) GetSiteOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/operationresults/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/operationresults/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteOperationSender sends the GetSiteOperation request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteOperationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteOperationResponder handles the response to the GetSiteOperation request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteOperationResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteOperationResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4720,21 +5347,21 @@
// resourceGroupName is name of resource group name is name of web app
// operationID is id of an operation slot is name of web app slot. If not
// specified then will default to production slot.
-func (client SitesClient) GetSiteOperationSlot(resourceGroupName string, name string, operationID string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSiteOperationSlot(resourceGroupName string, name string, operationID string, slot string) (result SetObject, err error) {
req, err := client.GetSiteOperationSlotPreparer(resourceGroupName, name, operationID, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperationSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperationSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteOperationSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperationSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperationSlot", resp, "Failure sending request")
}
result, err = client.GetSiteOperationSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteOperationSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteOperationSlot", resp, "Failure responding to request")
}
return
@@ -4743,39 +5370,38 @@
// GetSiteOperationSlotPreparer prepares the GetSiteOperationSlot request.
func (client SitesClient) GetSiteOperationSlotPreparer(resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "operationId": url.QueryEscape(operationID),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "operationId": autorest.Encode("path", operationID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/operationresults/{operationId}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/operationresults/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteOperationSlotSender sends the GetSiteOperationSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteOperationSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteOperationSlotResponder handles the response to the GetSiteOperationSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteOperationSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteOperationSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4784,21 +5410,21 @@
// GetSitePremierAddOn sends the get site premier add on request.
//
-func (client SitesClient) GetSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSitePremierAddOn(resourceGroupName string, name string, premierAddOnName string) (result SetObject, err error) {
req, err := client.GetSitePremierAddOnPreparer(resourceGroupName, name, premierAddOnName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOn", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOn", nil, "Failure preparing request")
}
resp, err := client.GetSitePremierAddOnSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOn", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOn", resp, "Failure sending request")
}
result, err = client.GetSitePremierAddOnResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOn", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOn", resp, "Failure responding to request")
}
return
@@ -4807,38 +5433,37 @@
// GetSitePremierAddOnPreparer prepares the GetSitePremierAddOn request.
func (client SitesClient) GetSitePremierAddOnPreparer(resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSitePremierAddOnSender sends the GetSitePremierAddOn request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSitePremierAddOnSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSitePremierAddOnResponder handles the response to the GetSitePremierAddOn request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSitePremierAddOnResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSitePremierAddOnResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4847,21 +5472,21 @@
// GetSitePremierAddOnSlot sends the get site premier add on slot request.
//
-func (client SitesClient) GetSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSitePremierAddOnSlot(resourceGroupName string, name string, premierAddOnName string, slot string) (result SetObject, err error) {
req, err := client.GetSitePremierAddOnSlotPreparer(resourceGroupName, name, premierAddOnName, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOnSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOnSlot", nil, "Failure preparing request")
}
resp, err := client.GetSitePremierAddOnSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOnSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOnSlot", resp, "Failure sending request")
}
result, err = client.GetSitePremierAddOnSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSitePremierAddOnSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSitePremierAddOnSlot", resp, "Failure responding to request")
}
return
@@ -4870,39 +5495,38 @@
// GetSitePremierAddOnSlotPreparer prepares the GetSitePremierAddOnSlot request.
func (client SitesClient) GetSitePremierAddOnSlotPreparer(resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "premierAddOnName": url.QueryEscape(premierAddOnName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "premierAddOnName": autorest.Encode("path", premierAddOnName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSitePremierAddOnSlotSender sends the GetSitePremierAddOnSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSitePremierAddOnSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSitePremierAddOnSlotResponder handles the response to the GetSitePremierAddOnSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSitePremierAddOnSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSitePremierAddOnSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4914,21 +5538,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app entityName is the name by which the Hybrid Connection is identified
-func (client SitesClient) GetSiteRelayServiceConnection(resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) GetSiteRelayServiceConnection(resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) {
req, err := client.GetSiteRelayServiceConnectionPreparer(resourceGroupName, name, entityName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnection", nil, "Failure preparing request")
}
resp, err := client.GetSiteRelayServiceConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnection", resp, "Failure sending request")
}
result, err = client.GetSiteRelayServiceConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnection", resp, "Failure responding to request")
}
return
@@ -4937,29 +5561,28 @@
// GetSiteRelayServiceConnectionPreparer prepares the GetSiteRelayServiceConnection request.
func (client SitesClient) GetSiteRelayServiceConnectionPreparer(resourceGroupName string, name string, entityName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteRelayServiceConnectionSender sends the GetSiteRelayServiceConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteRelayServiceConnectionResponder handles the response to the GetSiteRelayServiceConnection request. The method always
@@ -4968,7 +5591,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -4981,21 +5604,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app entityName is the name by which the Hybrid Connection is identified
// slot is the name of the slot for the web app.
-func (client SitesClient) GetSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) GetSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, err error) {
req, err := client.GetSiteRelayServiceConnectionSlotPreparer(resourceGroupName, name, entityName, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteRelayServiceConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnectionSlot", resp, "Failure sending request")
}
result, err = client.GetSiteRelayServiceConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteRelayServiceConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteRelayServiceConnectionSlot", resp, "Failure responding to request")
}
return
@@ -5004,30 +5627,29 @@
// GetSiteRelayServiceConnectionSlotPreparer prepares the GetSiteRelayServiceConnectionSlot request.
func (client SitesClient) GetSiteRelayServiceConnectionSlotPreparer(resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteRelayServiceConnectionSlotSender sends the GetSiteRelayServiceConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteRelayServiceConnectionSlotResponder handles the response to the GetSiteRelayServiceConnectionSlot request. The method always
@@ -5036,7 +5658,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5049,21 +5671,21 @@
// additional web app properties included in the response includeSiteTypes is
// types of apps included in the response includeSlots is whether or not to
// include deployments slots in results
-func (client SitesClient) GetSites(resourceGroupName string, propertiesToInclude string, includeSiteTypes string, includeSlots *bool) (result SiteCollection, ae error) {
+func (client SitesClient) GetSites(resourceGroupName string, propertiesToInclude string, includeSiteTypes string, includeSlots *bool) (result SiteCollection, err error) {
req, err := client.GetSitesPreparer(resourceGroupName, propertiesToInclude, includeSiteTypes, includeSlots)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSites", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSites", nil, "Failure preparing request")
}
resp, err := client.GetSitesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSites", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSites", resp, "Failure sending request")
}
result, err = client.GetSitesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSites", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSites", resp, "Failure responding to request")
}
return
@@ -5072,36 +5694,35 @@
// GetSitesPreparer prepares the GetSites request.
func (client SitesClient) GetSitesPreparer(resourceGroupName string, propertiesToInclude string, includeSiteTypes string, includeSlots *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
if len(includeSiteTypes) > 0 {
- queryParameters["includeSiteTypes"] = includeSiteTypes
+ queryParameters["includeSiteTypes"] = autorest.Encode("query", includeSiteTypes)
}
if includeSlots != nil {
- queryParameters["includeSlots"] = includeSlots
+ queryParameters["includeSlots"] = autorest.Encode("query", *includeSlots)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSitesSender sends the GetSites request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSitesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSitesResponder handles the response to the GetSites request. The method always
@@ -5110,7 +5731,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5123,21 +5744,21 @@
// name of web app slot. If not specified then will default to production
// slot. propertiesToInclude is additional web app properties included in the
// response
-func (client SitesClient) GetSiteSlot(resourceGroupName string, name string, slot string, propertiesToInclude string) (result Site, ae error) {
+func (client SitesClient) GetSiteSlot(resourceGroupName string, name string, slot string, propertiesToInclude string) (result Site, err error) {
req, err := client.GetSiteSlotPreparer(resourceGroupName, name, slot, propertiesToInclude)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlot", resp, "Failure sending request")
}
result, err = client.GetSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlot", resp, "Failure responding to request")
}
return
@@ -5146,32 +5767,31 @@
// GetSiteSlotPreparer prepares the GetSiteSlot request.
func (client SitesClient) GetSiteSlotPreparer(resourceGroupName string, name string, slot string, propertiesToInclude string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSlotSender sends the GetSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSlotResponder handles the response to the GetSiteSlot request. The method always
@@ -5180,7 +5800,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5191,21 +5811,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// propertiesToInclude is list of app properties to include in the response
-func (client SitesClient) GetSiteSlots(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, ae error) {
+func (client SitesClient) GetSiteSlots(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, err error) {
req, err := client.GetSiteSlotsPreparer(resourceGroupName, name, propertiesToInclude)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlots", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlots", nil, "Failure preparing request")
}
resp, err := client.GetSiteSlotsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlots", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlots", resp, "Failure sending request")
}
result, err = client.GetSiteSlotsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSlots", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSlots", resp, "Failure responding to request")
}
return
@@ -5214,31 +5834,30 @@
// GetSiteSlotsPreparer prepares the GetSiteSlots request.
func (client SitesClient) GetSiteSlotsPreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(propertiesToInclude) > 0 {
- queryParameters["propertiesToInclude"] = propertiesToInclude
+ queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSlotsSender sends the GetSiteSlots request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSlotsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSlotsResponder handles the response to the GetSiteSlots request. The method always
@@ -5247,7 +5866,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5256,197 +5875,60 @@
// GetSiteSnapshots sends the get site snapshots request.
//
-// subscriptionName is azure subscription webspaceName is webspace name is
-// website Name
-func (client SitesClient) GetSiteSnapshots(subscriptionName string, webspaceName string, name string, resourceGroupName string) (result ObjectSet, ae error) {
- req, err := client.GetSiteSnapshotsPreparer(subscriptionName, webspaceName, name, resourceGroupName)
+// resourceGroupName is webspace name is website Name
+func (client SitesClient) GetSiteSnapshots(resourceGroupName string, name string) (result SetObject, err error) {
+ req, err := client.GetSiteSnapshotsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshots", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshots", nil, "Failure preparing request")
}
resp, err := client.GetSiteSnapshotsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshots", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshots", resp, "Failure sending request")
}
result, err = client.GetSiteSnapshotsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshots", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshots", resp, "Failure responding to request")
}
return
}
// GetSiteSnapshotsPreparer prepares the GetSiteSnapshots request.
-func (client SitesClient) GetSiteSnapshotsPreparer(subscriptionName string, webspaceName string, name string, resourceGroupName string) (*http.Request, error) {
+func (client SitesClient) GetSiteSnapshotsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "subscriptionName": subscriptionName,
- "webspaceName": webspaceName,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSnapshotsSender sends the GetSiteSnapshots request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSnapshotsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSnapshotsResponder handles the response to the GetSiteSnapshots request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteSnapshotsResponder(resp *http.Response) (result ObjectSet, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetSiteSnapshotsOnSku sends the get site snapshots on sku request.
-//
-// subscriptionName is azure subscription webspaceName is webspace name is
-// website Name
-func (client SitesClient) GetSiteSnapshotsOnSku(subscriptionName string, webspaceName string, name string, resourceGroupName string) (result ObjectSet, ae error) {
- req, err := client.GetSiteSnapshotsOnSkuPreparer(subscriptionName, webspaceName, name, resourceGroupName)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSku", "Failure preparing request")
- }
-
- resp, err := client.GetSiteSnapshotsOnSkuSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSku", "Failure sending request")
- }
-
- result, err = client.GetSiteSnapshotsOnSkuResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSku", "Failure responding to request")
- }
-
- return
-}
-
-// GetSiteSnapshotsOnSkuPreparer prepares the GetSiteSnapshotsOnSku request.
-func (client SitesClient) GetSiteSnapshotsOnSkuPreparer(subscriptionName string, webspaceName string, name string, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "subscriptionName": subscriptionName,
- "webspaceName": webspaceName,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restorableSnapshots"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSiteSnapshotsOnSkuSender sends the GetSiteSnapshotsOnSku request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteSnapshotsOnSkuSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetSiteSnapshotsOnSkuResponder handles the response to the GetSiteSnapshotsOnSku request. The method always
-// closes the http.Response Body.
-func (client SitesClient) GetSiteSnapshotsOnSkuResponder(resp *http.Response) (result ObjectSet, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetSiteSnapshotsOnSkuSlot sends the get site snapshots on sku slot request.
-//
-// subscriptionName is azure subscription webspaceName is webspace name is
-// website Name
-func (client SitesClient) GetSiteSnapshotsOnSkuSlot(subscriptionName string, webspaceName string, name string, resourceGroupName string, slot string) (result ObjectSet, ae error) {
- req, err := client.GetSiteSnapshotsOnSkuSlotPreparer(subscriptionName, webspaceName, name, resourceGroupName, slot)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSkuSlot", "Failure preparing request")
- }
-
- resp, err := client.GetSiteSnapshotsOnSkuSlotSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSkuSlot", "Failure sending request")
- }
-
- result, err = client.GetSiteSnapshotsOnSkuSlotResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsOnSkuSlot", "Failure responding to request")
- }
-
- return
-}
-
-// GetSiteSnapshotsOnSkuSlotPreparer prepares the GetSiteSnapshotsOnSkuSlot request.
-func (client SitesClient) GetSiteSnapshotsOnSkuSlotPreparer(subscriptionName string, webspaceName string, name string, resourceGroupName string, slot string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "subscriptionName": subscriptionName,
- "webspaceName": webspaceName,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restorableSnapshots"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// GetSiteSnapshotsOnSkuSlotSender sends the GetSiteSnapshotsOnSkuSlot request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) GetSiteSnapshotsOnSkuSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// GetSiteSnapshotsOnSkuSlotResponder handles the response to the GetSiteSnapshotsOnSkuSlot request. The method always
-// closes the http.Response Body.
-func (client SitesClient) GetSiteSnapshotsOnSkuSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteSnapshotsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5455,65 +5937,61 @@
// GetSiteSnapshotsSlot sends the get site snapshots slot request.
//
-// subscriptionName is azure subscription webspaceName is webspace name is
-// website Name
-func (client SitesClient) GetSiteSnapshotsSlot(subscriptionName string, webspaceName string, name string, resourceGroupName string, slot string) (result ObjectSet, ae error) {
- req, err := client.GetSiteSnapshotsSlotPreparer(subscriptionName, webspaceName, name, resourceGroupName, slot)
+// resourceGroupName is webspace name is website Name slot is website Slot
+func (client SitesClient) GetSiteSnapshotsSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
+ req, err := client.GetSiteSnapshotsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshotsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteSnapshotsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshotsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteSnapshotsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSnapshotsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSnapshotsSlot", resp, "Failure responding to request")
}
return
}
// GetSiteSnapshotsSlotPreparer prepares the GetSiteSnapshotsSlot request.
-func (client SitesClient) GetSiteSnapshotsSlotPreparer(subscriptionName string, webspaceName string, name string, resourceGroupName string, slot string) (*http.Request, error) {
+func (client SitesClient) GetSiteSnapshotsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "subscriptionName": subscriptionName,
- "webspaceName": webspaceName,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSnapshotsSlotSender sends the GetSiteSnapshotsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSnapshotsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSnapshotsSlotResponder handles the response to the GetSiteSnapshotsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteSnapshotsSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteSnapshotsSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5523,21 +6001,21 @@
// GetSiteSourceControl sends the get site source control request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSiteSourceControl(resourceGroupName string, name string) (result SiteSourceControl, ae error) {
+func (client SitesClient) GetSiteSourceControl(resourceGroupName string, name string) (result SiteSourceControl, err error) {
req, err := client.GetSiteSourceControlPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControl", nil, "Failure preparing request")
}
resp, err := client.GetSiteSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControl", resp, "Failure sending request")
}
result, err = client.GetSiteSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControl", resp, "Failure responding to request")
}
return
@@ -5546,28 +6024,27 @@
// GetSiteSourceControlPreparer prepares the GetSiteSourceControl request.
func (client SitesClient) GetSiteSourceControlPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSourceControlSender sends the GetSiteSourceControl request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSourceControlResponder handles the response to the GetSiteSourceControl request. The method always
@@ -5576,7 +6053,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5588,21 +6065,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) GetSiteSourceControlSlot(resourceGroupName string, name string, slot string) (result SiteSourceControl, ae error) {
+func (client SitesClient) GetSiteSourceControlSlot(resourceGroupName string, name string, slot string) (result SiteSourceControl, err error) {
req, err := client.GetSiteSourceControlSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControlSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControlSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteSourceControlSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControlSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControlSlot", resp, "Failure sending request")
}
result, err = client.GetSiteSourceControlSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteSourceControlSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteSourceControlSlot", resp, "Failure responding to request")
}
return
@@ -5611,29 +6088,28 @@
// GetSiteSourceControlSlotPreparer prepares the GetSiteSourceControlSlot request.
func (client SitesClient) GetSiteSourceControlSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteSourceControlSlotSender sends the GetSiteSourceControlSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteSourceControlSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteSourceControlSlotResponder handles the response to the GetSiteSourceControlSlot request. The method always
@@ -5642,7 +6118,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5657,21 +6133,21 @@
// name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
// duration'[Hour|Minute|Day]'.
-func (client SitesClient) GetSiteUsages(resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollection, ae error) {
+func (client SitesClient) GetSiteUsages(resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollection, err error) {
req, err := client.GetSiteUsagesPreparer(resourceGroupName, name, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsages", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsages", nil, "Failure preparing request")
}
resp, err := client.GetSiteUsagesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsages", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsages", resp, "Failure sending request")
}
result, err = client.GetSiteUsagesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsages", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsages", resp, "Failure responding to request")
}
return
@@ -5680,31 +6156,30 @@
// GetSiteUsagesPreparer prepares the GetSiteUsages request.
func (client SitesClient) GetSiteUsagesPreparer(resourceGroupName string, name string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteUsagesSender sends the GetSiteUsages request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteUsagesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteUsagesResponder handles the response to the GetSiteUsages request. The method always
@@ -5713,7 +6188,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5729,21 +6204,21 @@
// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
// duration'[Hour|Minute|Day]'.
-func (client SitesClient) GetSiteUsagesSlot(resourceGroupName string, name string, slot string, filter string) (result CsmUsageQuotaCollection, ae error) {
+func (client SitesClient) GetSiteUsagesSlot(resourceGroupName string, name string, slot string, filter string) (result CsmUsageQuotaCollection, err error) {
req, err := client.GetSiteUsagesSlotPreparer(resourceGroupName, name, slot, filter)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsagesSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsagesSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteUsagesSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsagesSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsagesSlot", resp, "Failure sending request")
}
result, err = client.GetSiteUsagesSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteUsagesSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteUsagesSlot", resp, "Failure responding to request")
}
return
@@ -5752,32 +6227,31 @@
// GetSiteUsagesSlotPreparer prepares the GetSiteUsagesSlot request.
func (client SitesClient) GetSiteUsagesSlotPreparer(resourceGroupName string, name string, slot string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if len(filter) > 0 {
- queryParameters["$filter"] = filter
+ queryParameters["$filter"] = autorest.Encode("query", filter)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteUsagesSlotSender sends the GetSiteUsagesSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteUsagesSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteUsagesSlotResponder handles the response to the GetSiteUsagesSlot request. The method always
@@ -5786,7 +6260,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5797,21 +6271,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app vnetName is the name of the Virtual Network
-func (client SitesClient) GetSiteVNETConnection(resourceGroupName string, name string, vnetName string) (result VnetInfo, ae error) {
+func (client SitesClient) GetSiteVNETConnection(resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) {
req, err := client.GetSiteVNETConnectionPreparer(resourceGroupName, name, vnetName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnection", nil, "Failure preparing request")
}
resp, err := client.GetSiteVNETConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnection", resp, "Failure sending request")
}
result, err = client.GetSiteVNETConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnection", resp, "Failure responding to request")
}
return
@@ -5820,29 +6294,28 @@
// GetSiteVNETConnectionPreparer prepares the GetSiteVNETConnection request.
func (client SitesClient) GetSiteVNETConnectionPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVNETConnectionSender sends the GetSiteVNETConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVNETConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVNETConnectionResponder handles the response to the GetSiteVNETConnection request. The method always
@@ -5851,7 +6324,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5862,21 +6335,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app
-func (client SitesClient) GetSiteVNETConnections(resourceGroupName string, name string) (result VnetInfoList, ae error) {
+func (client SitesClient) GetSiteVNETConnections(resourceGroupName string, name string) (result ListVnetInfo, err error) {
req, err := client.GetSiteVNETConnectionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnections", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnections", nil, "Failure preparing request")
}
resp, err := client.GetSiteVNETConnectionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnections", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnections", resp, "Failure sending request")
}
result, err = client.GetSiteVNETConnectionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnections", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnections", resp, "Failure responding to request")
}
return
@@ -5885,37 +6358,36 @@
// GetSiteVNETConnectionsPreparer prepares the GetSiteVNETConnections request.
func (client SitesClient) GetSiteVNETConnectionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVNETConnectionsSender sends the GetSiteVNETConnections request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVNETConnectionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVNETConnectionsResponder handles the response to the GetSiteVNETConnections request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteVNETConnectionsResponder(resp *http.Response) (result VnetInfoList, err error) {
+func (client SitesClient) GetSiteVNETConnectionsResponder(resp *http.Response) (result ListVnetInfo, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5927,21 +6399,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app vnetName is the name of the Virtual Network slot is the name of the
// slot for this web app.
-func (client SitesClient) GetSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, slot string) (result VnetInfo, ae error) {
+func (client SitesClient) GetSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, slot string) (result VnetInfo, err error) {
req, err := client.GetSiteVNETConnectionSlotPreparer(resourceGroupName, name, vnetName, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteVNETConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionSlot", resp, "Failure sending request")
}
result, err = client.GetSiteVNETConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionSlot", resp, "Failure responding to request")
}
return
@@ -5950,30 +6422,29 @@
// GetSiteVNETConnectionSlotPreparer prepares the GetSiteVNETConnectionSlot request.
func (client SitesClient) GetSiteVNETConnectionSlotPreparer(resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVNETConnectionSlotSender sends the GetSiteVNETConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVNETConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVNETConnectionSlotResponder handles the response to the GetSiteVNETConnectionSlot request. The method always
@@ -5982,7 +6453,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -5993,21 +6464,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app slot is the name of the slot for this web app.
-func (client SitesClient) GetSiteVNETConnectionsSlot(resourceGroupName string, name string, slot string) (result VnetInfoList, ae error) {
+func (client SitesClient) GetSiteVNETConnectionsSlot(resourceGroupName string, name string, slot string) (result ListVnetInfo, err error) {
req, err := client.GetSiteVNETConnectionsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionsSlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteVNETConnectionsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionsSlot", resp, "Failure sending request")
}
result, err = client.GetSiteVNETConnectionsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVNETConnectionsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVNETConnectionsSlot", resp, "Failure responding to request")
}
return
@@ -6016,38 +6487,37 @@
// GetSiteVNETConnectionsSlotPreparer prepares the GetSiteVNETConnectionsSlot request.
func (client SitesClient) GetSiteVNETConnectionsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVNETConnectionsSlotSender sends the GetSiteVNETConnectionsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVNETConnectionsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVNETConnectionsSlotResponder handles the response to the GetSiteVNETConnectionsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteVNETConnectionsSlotResponder(resp *http.Response) (result VnetInfoList, err error) {
+func (client SitesClient) GetSiteVNETConnectionsSlotResponder(resp *http.Response) (result ListVnetInfo, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6059,21 +6529,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app vnetName is the name of the Virtual Network gatewayName is the name of
// the gateway. The only gateway that exists presently is "primary"
-func (client SitesClient) GetSiteVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSiteVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result SetObject, err error) {
req, err := client.GetSiteVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGateway", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGateway", nil, "Failure preparing request")
}
resp, err := client.GetSiteVnetGatewaySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGateway", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGateway", resp, "Failure sending request")
}
result, err = client.GetSiteVnetGatewayResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGateway", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGateway", resp, "Failure responding to request")
}
return
@@ -6082,39 +6552,38 @@
// GetSiteVnetGatewayPreparer prepares the GetSiteVnetGateway request.
func (client SitesClient) GetSiteVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVnetGatewaySender sends the GetSiteVnetGateway request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVnetGatewaySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVnetGatewayResponder handles the response to the GetSiteVnetGateway request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteVnetGatewayResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteVnetGatewayResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6127,21 +6596,21 @@
// app vnetName is the name of the Virtual Network gatewayName is the name of
// the gateway. The only gateway that exists presently is "primary" slot is
// the name of the slot for this web app.
-func (client SitesClient) GetSiteVnetGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) GetSiteVnetGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result SetObject, err error) {
req, err := client.GetSiteVnetGatewaySlotPreparer(resourceGroupName, name, vnetName, gatewayName, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGatewaySlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGatewaySlot", nil, "Failure preparing request")
}
resp, err := client.GetSiteVnetGatewaySlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGatewaySlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGatewaySlot", resp, "Failure sending request")
}
result, err = client.GetSiteVnetGatewaySlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSiteVnetGatewaySlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSiteVnetGatewaySlot", resp, "Failure responding to request")
}
return
@@ -6150,40 +6619,39 @@
// GetSiteVnetGatewaySlotPreparer prepares the GetSiteVnetGatewaySlot request.
func (client SitesClient) GetSiteVnetGatewaySlotPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSiteVnetGatewaySlotSender sends the GetSiteVnetGatewaySlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSiteVnetGatewaySlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusNotFound)
+ return autorest.SendWithSender(client, req)
}
// GetSiteVnetGatewaySlotResponder handles the response to the GetSiteVnetGatewaySlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) GetSiteVnetGatewaySlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) GetSiteVnetGatewaySlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6193,21 +6661,21 @@
// GetSlotConfigNames sends the get slot config names request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) GetSlotConfigNames(resourceGroupName string, name string) (result SlotConfigNamesResource, ae error) {
+func (client SitesClient) GetSlotConfigNames(resourceGroupName string, name string) (result SlotConfigNamesResource, err error) {
req, err := client.GetSlotConfigNamesPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotConfigNames", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotConfigNames", nil, "Failure preparing request")
}
resp, err := client.GetSlotConfigNamesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotConfigNames", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotConfigNames", resp, "Failure sending request")
}
result, err = client.GetSlotConfigNamesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotConfigNames", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotConfigNames", resp, "Failure responding to request")
}
return
@@ -6216,28 +6684,27 @@
// GetSlotConfigNamesPreparer prepares the GetSlotConfigNames request.
func (client SitesClient) GetSlotConfigNamesPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSlotConfigNamesSender sends the GetSlotConfigNames request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSlotConfigNamesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSlotConfigNamesResponder handles the response to the GetSlotConfigNames request. The method always
@@ -6246,7 +6713,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6258,21 +6725,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// slotSwapEntity is request body that contains the target slot name
-func (client SitesClient) GetSlotsDifferencesFromProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result SlotDifferenceCollection, ae error) {
+func (client SitesClient) GetSlotsDifferencesFromProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result SlotDifferenceCollection, err error) {
req, err := client.GetSlotsDifferencesFromProductionPreparer(resourceGroupName, name, slotSwapEntity)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesFromProduction", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesFromProduction", nil, "Failure preparing request")
}
resp, err := client.GetSlotsDifferencesFromProductionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesFromProduction", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesFromProduction", resp, "Failure sending request")
}
result, err = client.GetSlotsDifferencesFromProductionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesFromProduction", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesFromProduction", resp, "Failure responding to request")
}
return
@@ -6281,29 +6748,29 @@
// GetSlotsDifferencesFromProductionPreparer prepares the GetSlotsDifferencesFromProduction request.
func (client SitesClient) GetSlotsDifferencesFromProductionPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSlotsDifferencesFromProductionSender sends the GetSlotsDifferencesFromProduction request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSlotsDifferencesFromProductionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSlotsDifferencesFromProductionResponder handles the response to the GetSlotsDifferencesFromProduction request. The method always
@@ -6312,7 +6779,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6324,21 +6791,21 @@
// resourceGroupName is name of resource group name is name of web app
// slotSwapEntity is request body that contains the target slot name slot is
// name of the source slot
-func (client SitesClient) GetSlotsDifferencesSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SlotDifferenceCollection, ae error) {
+func (client SitesClient) GetSlotsDifferencesSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SlotDifferenceCollection, err error) {
req, err := client.GetSlotsDifferencesSlotPreparer(resourceGroupName, name, slotSwapEntity, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesSlot", nil, "Failure preparing request")
}
resp, err := client.GetSlotsDifferencesSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesSlot", resp, "Failure sending request")
}
result, err = client.GetSlotsDifferencesSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "GetSlotsDifferencesSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "GetSlotsDifferencesSlot", resp, "Failure responding to request")
}
return
@@ -6347,30 +6814,30 @@
// GetSlotsDifferencesSlotPreparer prepares the GetSlotsDifferencesSlot request.
func (client SitesClient) GetSlotsDifferencesSlotPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetSlotsDifferencesSlotSender sends the GetSlotsDifferencesSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) GetSlotsDifferencesSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetSlotsDifferencesSlotResponder handles the response to the GetSlotsDifferencesSlot request. The method always
@@ -6379,589 +6846,450 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListSiteAppSettings sends the list site app settings request.
-//
-// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteAppSettings(resourceGroupName string, name string) (result StringDictionary, ae error) {
- req, err := client.ListSiteAppSettingsPreparer(resourceGroupName, name)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettings", "Failure preparing request")
- }
-
- resp, err := client.ListSiteAppSettingsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettings", "Failure sending request")
- }
-
- result, err = client.ListSiteAppSettingsResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettings", "Failure responding to request")
- }
-
- return
-}
-
-// ListSiteAppSettingsPreparer prepares the ListSiteAppSettings request.
-func (client SitesClient) ListSiteAppSettingsPreparer(resourceGroupName string, name string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSiteAppSettingsSender sends the ListSiteAppSettings request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteAppSettingsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListSiteAppSettingsResponder handles the response to the ListSiteAppSettings request. The method always
-// closes the http.Response Body.
-func (client SitesClient) ListSiteAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListSiteAppSettingsSlot sends the list site app settings slot request.
-//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) ListSiteAppSettingsSlot(resourceGroupName string, name string, slot string) (result StringDictionary, ae error) {
- req, err := client.ListSiteAppSettingsSlotPreparer(resourceGroupName, name, slot)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettingsSlot", "Failure preparing request")
- }
-
- resp, err := client.ListSiteAppSettingsSlotSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettingsSlot", "Failure sending request")
- }
-
- result, err = client.ListSiteAppSettingsSlotResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAppSettingsSlot", "Failure responding to request")
- }
-
- return
-}
-
-// ListSiteAppSettingsSlotPreparer prepares the ListSiteAppSettingsSlot request.
-func (client SitesClient) ListSiteAppSettingsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list"),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// ListSiteAppSettingsSlotSender sends the ListSiteAppSettingsSlot request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteAppSettingsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// ListSiteAppSettingsSlotResponder handles the response to the ListSiteAppSettingsSlot request. The method always
-// closes the http.Response Body.
-func (client SitesClient) ListSiteAppSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteAuthSettings sends the list site auth settings request.
+// IsSiteCloneable sends the is site cloneable request.
//
-// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteAuthSettings(resourceGroupName string, name string) (result SiteAuthSettings, ae error) {
- req, err := client.ListSiteAuthSettingsPreparer(resourceGroupName, name)
+// resourceGroupName is name of the resource group name is name of the web app
+func (client SitesClient) IsSiteCloneable(resourceGroupName string, name string) (result SiteCloneability, err error) {
+ req, err := client.IsSiteCloneablePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneable", nil, "Failure preparing request")
}
- resp, err := client.ListSiteAuthSettingsSender(req)
+ resp, err := client.IsSiteCloneableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneable", resp, "Failure sending request")
}
- result, err = client.ListSiteAuthSettingsResponder(resp)
+ result, err = client.IsSiteCloneableResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneable", resp, "Failure responding to request")
}
return
}
-// ListSiteAuthSettingsPreparer prepares the ListSiteAuthSettings request.
-func (client SitesClient) ListSiteAuthSettingsPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// IsSiteCloneablePreparer prepares the IsSiteCloneable request.
+func (client SitesClient) IsSiteCloneablePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteAuthSettingsSender sends the ListSiteAuthSettings request. The method will close the
+// IsSiteCloneableSender sends the IsSiteCloneable request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteAuthSettingsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) IsSiteCloneableSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteAuthSettingsResponder handles the response to the ListSiteAuthSettings request. The method always
+// IsSiteCloneableResponder handles the response to the IsSiteCloneable request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) {
+func (client SitesClient) IsSiteCloneableResponder(resp *http.Response) (result SiteCloneability, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteAuthSettingsSlot sends the list site auth settings slot request.
+// IsSiteCloneableSlot sends the is site cloneable slot request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) ListSiteAuthSettingsSlot(resourceGroupName string, name string, slot string) (result SiteAuthSettings, ae error) {
- req, err := client.ListSiteAuthSettingsSlotPreparer(resourceGroupName, name, slot)
+// resourceGroupName is name of the resource group name is name of the web app
+// slot is name of web app slot. If not specified then will default to
+// production slot.
+func (client SitesClient) IsSiteCloneableSlot(resourceGroupName string, name string, slot string) (result SiteCloneability, err error) {
+ req, err := client.IsSiteCloneableSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettingsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneableSlot", nil, "Failure preparing request")
}
- resp, err := client.ListSiteAuthSettingsSlotSender(req)
+ resp, err := client.IsSiteCloneableSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettingsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneableSlot", resp, "Failure sending request")
}
- result, err = client.ListSiteAuthSettingsSlotResponder(resp)
+ result, err = client.IsSiteCloneableSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteAuthSettingsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "IsSiteCloneableSlot", resp, "Failure responding to request")
}
return
}
-// ListSiteAuthSettingsSlotPreparer prepares the ListSiteAuthSettingsSlot request.
-func (client SitesClient) ListSiteAuthSettingsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// IsSiteCloneableSlotPreparer prepares the IsSiteCloneableSlot request.
+func (client SitesClient) IsSiteCloneableSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteAuthSettingsSlotSender sends the ListSiteAuthSettingsSlot request. The method will close the
+// IsSiteCloneableSlotSender sends the IsSiteCloneableSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteAuthSettingsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) IsSiteCloneableSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteAuthSettingsSlotResponder handles the response to the ListSiteAuthSettingsSlot request. The method always
+// IsSiteCloneableSlotResponder handles the response to the IsSiteCloneableSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) {
+func (client SitesClient) IsSiteCloneableSlotResponder(resp *http.Response) (result SiteCloneability, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteBackupConfigurationDeprecated sends the list site backup
-// configuration deprecated request.
+// ListSiteAppSettings sends the list site app settings request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteBackupConfigurationDeprecated(resourceGroupName string, name string) (result BackupRequest, ae error) {
- req, err := client.ListSiteBackupConfigurationDeprecatedPreparer(resourceGroupName, name)
+func (client SitesClient) ListSiteAppSettings(resourceGroupName string, name string) (result StringDictionary, err error) {
+ req, err := client.ListSiteAppSettingsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecated", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettings", nil, "Failure preparing request")
}
- resp, err := client.ListSiteBackupConfigurationDeprecatedSender(req)
+ resp, err := client.ListSiteAppSettingsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecated", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettings", resp, "Failure sending request")
}
- result, err = client.ListSiteBackupConfigurationDeprecatedResponder(resp)
+ result, err = client.ListSiteAppSettingsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecated", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettings", resp, "Failure responding to request")
}
return
}
-// ListSiteBackupConfigurationDeprecatedPreparer prepares the ListSiteBackupConfigurationDeprecated request.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// ListSiteAppSettingsPreparer prepares the ListSiteAppSettings request.
+func (client SitesClient) ListSiteAppSettingsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup/config"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteBackupConfigurationDeprecatedSender sends the ListSiteBackupConfigurationDeprecated request. The method will close the
+// ListSiteAppSettingsSender sends the ListSiteAppSettings request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) ListSiteAppSettingsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteBackupConfigurationDeprecatedResponder handles the response to the ListSiteBackupConfigurationDeprecated request. The method always
+// ListSiteAppSettingsResponder handles the response to the ListSiteAppSettings request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedResponder(resp *http.Response) (result BackupRequest, err error) {
+func (client SitesClient) ListSiteAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteBackupConfigurationDeprecatedSlot sends the list site backup
-// configuration deprecated slot request.
+// ListSiteAppSettingsSlot sends the list site app settings slot request.
//
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedSlot(resourceGroupName string, name string, slot string) (result BackupRequest, ae error) {
- req, err := client.ListSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName, name, slot)
+func (client SitesClient) ListSiteAppSettingsSlot(resourceGroupName string, name string, slot string) (result StringDictionary, err error) {
+ req, err := client.ListSiteAppSettingsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecatedSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettingsSlot", nil, "Failure preparing request")
}
- resp, err := client.ListSiteBackupConfigurationDeprecatedSlotSender(req)
+ resp, err := client.ListSiteAppSettingsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecatedSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettingsSlot", resp, "Failure sending request")
}
- result, err = client.ListSiteBackupConfigurationDeprecatedSlotResponder(resp)
+ result, err = client.ListSiteAppSettingsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupConfigurationDeprecatedSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAppSettingsSlot", resp, "Failure responding to request")
}
return
}
-// ListSiteBackupConfigurationDeprecatedSlotPreparer prepares the ListSiteBackupConfigurationDeprecatedSlot request.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// ListSiteAppSettingsSlotPreparer prepares the ListSiteAppSettingsSlot request.
+func (client SitesClient) ListSiteAppSettingsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup/config"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteBackupConfigurationDeprecatedSlotSender sends the ListSiteBackupConfigurationDeprecatedSlot request. The method will close the
+// ListSiteAppSettingsSlotSender sends the ListSiteAppSettingsSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) ListSiteAppSettingsSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteBackupConfigurationDeprecatedSlotResponder handles the response to the ListSiteBackupConfigurationDeprecatedSlot request. The method always
+// ListSiteAppSettingsSlotResponder handles the response to the ListSiteAppSettingsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteBackupConfigurationDeprecatedSlotResponder(resp *http.Response) (result BackupRequest, err error) {
+func (client SitesClient) ListSiteAppSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteBackups sends the list site backups request.
+// ListSiteAuthSettings sends the list site auth settings request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteBackups(resourceGroupName string, name string) (result BackupItemCollection, ae error) {
- req, err := client.ListSiteBackupsPreparer(resourceGroupName, name)
+func (client SitesClient) ListSiteAuthSettings(resourceGroupName string, name string) (result SiteAuthSettings, err error) {
+ req, err := client.ListSiteAuthSettingsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackups", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettings", nil, "Failure preparing request")
}
- resp, err := client.ListSiteBackupsSender(req)
+ resp, err := client.ListSiteAuthSettingsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackups", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettings", resp, "Failure sending request")
}
- result, err = client.ListSiteBackupsResponder(resp)
+ result, err = client.ListSiteAuthSettingsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackups", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettings", resp, "Failure responding to request")
}
return
}
-// ListSiteBackupsPreparer prepares the ListSiteBackups request.
-func (client SitesClient) ListSiteBackupsPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// ListSiteAuthSettingsPreparer prepares the ListSiteAuthSettings request.
+func (client SitesClient) ListSiteAuthSettingsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteBackupsSender sends the ListSiteBackups request. The method will close the
+// ListSiteAuthSettingsSender sends the ListSiteAuthSettings request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteBackupsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) ListSiteAuthSettingsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteBackupsResponder handles the response to the ListSiteBackups request. The method always
+// ListSiteAuthSettingsResponder handles the response to the ListSiteAuthSettings request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) {
+func (client SitesClient) ListSiteAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteBackupsDeprecated sends the list site backups deprecated request.
+// ListSiteAuthSettingsSlot sends the list site auth settings slot request.
//
-// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteBackupsDeprecated(resourceGroupName string, name string) (result BackupItemCollection, ae error) {
- req, err := client.ListSiteBackupsDeprecatedPreparer(resourceGroupName, name)
+// resourceGroupName is name of resource group name is name of web app slot is
+// name of web app slot. If not specified then will default to production
+// slot.
+func (client SitesClient) ListSiteAuthSettingsSlot(resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) {
+ req, err := client.ListSiteAuthSettingsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecated", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettingsSlot", nil, "Failure preparing request")
}
- resp, err := client.ListSiteBackupsDeprecatedSender(req)
+ resp, err := client.ListSiteAuthSettingsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecated", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettingsSlot", resp, "Failure sending request")
}
- result, err = client.ListSiteBackupsDeprecatedResponder(resp)
+ result, err = client.ListSiteAuthSettingsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecated", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteAuthSettingsSlot", resp, "Failure responding to request")
}
return
}
-// ListSiteBackupsDeprecatedPreparer prepares the ListSiteBackupsDeprecated request.
-func (client SitesClient) ListSiteBackupsDeprecatedPreparer(resourceGroupName string, name string) (*http.Request, error) {
+// ListSiteAuthSettingsSlotPreparer prepares the ListSiteAuthSettingsSlot request.
+func (client SitesClient) ListSiteAuthSettingsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsGet(),
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restore"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteBackupsDeprecatedSender sends the ListSiteBackupsDeprecated request. The method will close the
+// ListSiteAuthSettingsSlotSender sends the ListSiteAuthSettingsSlot request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteBackupsDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) ListSiteAuthSettingsSlotSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteBackupsDeprecatedResponder handles the response to the ListSiteBackupsDeprecated request. The method always
+// ListSiteAuthSettingsSlotResponder handles the response to the ListSiteAuthSettingsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteBackupsDeprecatedResponder(resp *http.Response) (result BackupItemCollection, err error) {
+func (client SitesClient) ListSiteAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// ListSiteBackupsDeprecatedSlot sends the list site backups deprecated slot
-// request.
+// ListSiteBackups sends the list site backups request.
//
-// resourceGroupName is name of resource group name is name of web app slot is
-// name of web app slot. If not specified then will default to production
-// slot.
-func (client SitesClient) ListSiteBackupsDeprecatedSlot(resourceGroupName string, name string, slot string) (result BackupItemCollection, ae error) {
- req, err := client.ListSiteBackupsDeprecatedSlotPreparer(resourceGroupName, name, slot)
+// resourceGroupName is name of resource group name is name of web app
+func (client SitesClient) ListSiteBackups(resourceGroupName string, name string) (result BackupItemCollection, err error) {
+ req, err := client.ListSiteBackupsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecatedSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackups", nil, "Failure preparing request")
}
- resp, err := client.ListSiteBackupsDeprecatedSlotSender(req)
+ resp, err := client.ListSiteBackupsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecatedSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackups", resp, "Failure sending request")
}
- result, err = client.ListSiteBackupsDeprecatedSlotResponder(resp)
+ result, err = client.ListSiteBackupsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsDeprecatedSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackups", resp, "Failure responding to request")
}
return
}
-// ListSiteBackupsDeprecatedSlotPreparer prepares the ListSiteBackupsDeprecatedSlot request.
-func (client SitesClient) ListSiteBackupsDeprecatedSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+// ListSiteBackupsPreparer prepares the ListSiteBackups request.
+func (client SitesClient) ListSiteBackupsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restore"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
-// ListSiteBackupsDeprecatedSlotSender sends the ListSiteBackupsDeprecatedSlot request. The method will close the
+// ListSiteBackupsSender sends the ListSiteBackups request. The method will close the
// http.Response Body if it receives an error.
-func (client SitesClient) ListSiteBackupsDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+func (client SitesClient) ListSiteBackupsSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req)
}
-// ListSiteBackupsDeprecatedSlotResponder handles the response to the ListSiteBackupsDeprecatedSlot request. The method always
+// ListSiteBackupsResponder handles the response to the ListSiteBackups request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSiteBackupsDeprecatedSlotResponder(resp *http.Response) (result BackupItemCollection, err error) {
+func (client SitesClient) ListSiteBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -6973,21 +7301,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ListSiteBackupsSlot(resourceGroupName string, name string, slot string) (result BackupItemCollection, ae error) {
+func (client SitesClient) ListSiteBackupsSlot(resourceGroupName string, name string, slot string) (result BackupItemCollection, err error) {
req, err := client.ListSiteBackupsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackupsSlot", nil, "Failure preparing request")
}
resp, err := client.ListSiteBackupsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackupsSlot", resp, "Failure sending request")
}
result, err = client.ListSiteBackupsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteBackupsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteBackupsSlot", resp, "Failure responding to request")
}
return
@@ -6996,29 +7324,28 @@
// ListSiteBackupsSlotPreparer prepares the ListSiteBackupsSlot request.
func (client SitesClient) ListSiteBackupsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteBackupsSlotSender sends the ListSiteBackupsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteBackupsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteBackupsSlotResponder handles the response to the ListSiteBackupsSlot request. The method always
@@ -7027,7 +7354,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7037,21 +7364,21 @@
// ListSiteConnectionStrings sends the list site connection strings request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteConnectionStrings(resourceGroupName string, name string) (result ConnectionStringDictionary, ae error) {
+func (client SitesClient) ListSiteConnectionStrings(resourceGroupName string, name string) (result ConnectionStringDictionary, err error) {
req, err := client.ListSiteConnectionStringsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStrings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStrings", nil, "Failure preparing request")
}
resp, err := client.ListSiteConnectionStringsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStrings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStrings", resp, "Failure sending request")
}
result, err = client.ListSiteConnectionStringsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStrings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStrings", resp, "Failure responding to request")
}
return
@@ -7060,28 +7387,27 @@
// ListSiteConnectionStringsPreparer prepares the ListSiteConnectionStrings request.
func (client SitesClient) ListSiteConnectionStringsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteConnectionStringsSender sends the ListSiteConnectionStrings request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteConnectionStringsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteConnectionStringsResponder handles the response to the ListSiteConnectionStrings request. The method always
@@ -7090,7 +7416,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7103,21 +7429,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ListSiteConnectionStringsSlot(resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, ae error) {
+func (client SitesClient) ListSiteConnectionStringsSlot(resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, err error) {
req, err := client.ListSiteConnectionStringsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStringsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStringsSlot", nil, "Failure preparing request")
}
resp, err := client.ListSiteConnectionStringsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStringsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStringsSlot", resp, "Failure sending request")
}
result, err = client.ListSiteConnectionStringsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteConnectionStringsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteConnectionStringsSlot", resp, "Failure responding to request")
}
return
@@ -7126,29 +7452,28 @@
// ListSiteConnectionStringsSlotPreparer prepares the ListSiteConnectionStringsSlot request.
func (client SitesClient) ListSiteConnectionStringsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteConnectionStringsSlotSender sends the ListSiteConnectionStringsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteConnectionStringsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteConnectionStringsSlotResponder handles the response to the ListSiteConnectionStringsSlot request. The method always
@@ -7157,7 +7482,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7167,21 +7492,21 @@
// ListSiteMetadata sends the list site metadata request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSiteMetadata(resourceGroupName string, name string) (result StringDictionary, ae error) {
+func (client SitesClient) ListSiteMetadata(resourceGroupName string, name string) (result StringDictionary, err error) {
req, err := client.ListSiteMetadataPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadata", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadata", nil, "Failure preparing request")
}
resp, err := client.ListSiteMetadataSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadata", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadata", resp, "Failure sending request")
}
result, err = client.ListSiteMetadataResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadata", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadata", resp, "Failure responding to request")
}
return
@@ -7190,28 +7515,27 @@
// ListSiteMetadataPreparer prepares the ListSiteMetadata request.
func (client SitesClient) ListSiteMetadataPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteMetadataSender sends the ListSiteMetadata request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteMetadataSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteMetadataResponder handles the response to the ListSiteMetadata request. The method always
@@ -7220,7 +7544,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7232,21 +7556,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ListSiteMetadataSlot(resourceGroupName string, name string, slot string) (result StringDictionary, ae error) {
+func (client SitesClient) ListSiteMetadataSlot(resourceGroupName string, name string, slot string) (result StringDictionary, err error) {
req, err := client.ListSiteMetadataSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadataSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadataSlot", nil, "Failure preparing request")
}
resp, err := client.ListSiteMetadataSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadataSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadataSlot", resp, "Failure sending request")
}
result, err = client.ListSiteMetadataSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteMetadataSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteMetadataSlot", resp, "Failure responding to request")
}
return
@@ -7255,29 +7579,28 @@
// ListSiteMetadataSlotPreparer prepares the ListSiteMetadataSlot request.
func (client SitesClient) ListSiteMetadataSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteMetadataSlotSender sends the ListSiteMetadataSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteMetadataSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteMetadataSlotResponder handles the response to the ListSiteMetadataSlot request. The method always
@@ -7286,7 +7609,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7295,21 +7618,21 @@
// ListSitePremierAddOns sends the list site premier add ons request.
//
-func (client SitesClient) ListSitePremierAddOns(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) ListSitePremierAddOns(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.ListSitePremierAddOnsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOns", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOns", nil, "Failure preparing request")
}
resp, err := client.ListSitePremierAddOnsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOns", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOns", resp, "Failure sending request")
}
result, err = client.ListSitePremierAddOnsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOns", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOns", resp, "Failure responding to request")
}
return
@@ -7318,37 +7641,36 @@
// ListSitePremierAddOnsPreparer prepares the ListSitePremierAddOns request.
func (client SitesClient) ListSitePremierAddOnsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSitePremierAddOnsSender sends the ListSitePremierAddOns request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePremierAddOnsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSitePremierAddOnsResponder handles the response to the ListSitePremierAddOns request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePremierAddOnsResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ListSitePremierAddOnsResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7357,21 +7679,21 @@
// ListSitePremierAddOnsSlot sends the list site premier add ons slot request.
//
-func (client SitesClient) ListSitePremierAddOnsSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) ListSitePremierAddOnsSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
req, err := client.ListSitePremierAddOnsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOnsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOnsSlot", nil, "Failure preparing request")
}
resp, err := client.ListSitePremierAddOnsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOnsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOnsSlot", resp, "Failure sending request")
}
result, err = client.ListSitePremierAddOnsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePremierAddOnsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePremierAddOnsSlot", resp, "Failure responding to request")
}
return
@@ -7380,38 +7702,37 @@
// ListSitePremierAddOnsSlotPreparer prepares the ListSitePremierAddOnsSlot request.
func (client SitesClient) ListSitePremierAddOnsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSitePremierAddOnsSlotSender sends the ListSitePremierAddOnsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePremierAddOnsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSitePremierAddOnsSlotResponder handles the response to the ListSitePremierAddOnsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePremierAddOnsSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ListSitePremierAddOnsSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7419,133 +7740,137 @@
}
// ListSitePublishingCredentials sends the list site publishing credentials
-// request.
+// request. This method may poll for completion. Polling can be canceled by
+// passing the cancel channel argument. The channel will be used to cancel
+// polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ListSitePublishingCredentials(resourceGroupName string, name string) (result User, ae error) {
- req, err := client.ListSitePublishingCredentialsPreparer(resourceGroupName, name)
+func (client SitesClient) ListSitePublishingCredentials(resourceGroupName string, name string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ListSitePublishingCredentialsPreparer(resourceGroupName, name, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentials", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentials", nil, "Failure preparing request")
}
resp, err := client.ListSitePublishingCredentialsSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentials", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentials", resp, "Failure sending request")
}
result, err = client.ListSitePublishingCredentialsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentials", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentials", resp, "Failure responding to request")
}
return
}
// ListSitePublishingCredentialsPreparer prepares the ListSitePublishingCredentials request.
-func (client SitesClient) ListSitePublishingCredentialsPreparer(resourceGroupName string, name string) (*http.Request, error) {
+func (client SitesClient) ListSitePublishingCredentialsPreparer(resourceGroupName string, name string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListSitePublishingCredentialsSender sends the ListSitePublishingCredentials request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePublishingCredentialsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListSitePublishingCredentialsResponder handles the response to the ListSitePublishingCredentials request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePublishingCredentialsResponder(resp *http.Response) (result User, err error) {
+func (client SitesClient) ListSitePublishingCredentialsResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// ListSitePublishingCredentialsSlot sends the list site publishing
-// credentials slot request.
+// credentials slot request. This method may poll for completion. Polling can
+// be canceled by passing the cancel channel argument. The channel will be
+// used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ListSitePublishingCredentialsSlot(resourceGroupName string, name string, slot string) (result User, ae error) {
- req, err := client.ListSitePublishingCredentialsSlotPreparer(resourceGroupName, name, slot)
+func (client SitesClient) ListSitePublishingCredentialsSlot(resourceGroupName string, name string, slot string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.ListSitePublishingCredentialsSlotPreparer(resourceGroupName, name, slot, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentialsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentialsSlot", nil, "Failure preparing request")
}
resp, err := client.ListSitePublishingCredentialsSlotSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentialsSlot", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentialsSlot", resp, "Failure sending request")
}
result, err = client.ListSitePublishingCredentialsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingCredentialsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingCredentialsSlot", resp, "Failure responding to request")
}
return
}
// ListSitePublishingCredentialsSlotPreparer prepares the ListSitePublishingCredentialsSlot request.
-func (client SitesClient) ListSitePublishingCredentialsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
+func (client SitesClient) ListSitePublishingCredentialsSlotPreparer(resourceGroupName string, name string, slot string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListSitePublishingCredentialsSlotSender sends the ListSitePublishingCredentialsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePublishingCredentialsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListSitePublishingCredentialsSlotResponder handles the response to the ListSitePublishingCredentialsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePublishingCredentialsSlotResponder(resp *http.Response) (result User, err error) {
+func (client SitesClient) ListSitePublishingCredentialsSlotResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
@@ -7555,21 +7880,21 @@
// resourceGroupName is name of resource group name is name of web app options
// is specifies options for publishing profile. Pass
// CsmPublishingProfileOptions.Format=FileZilla3 for FileZilla FTP format.
-func (client SitesClient) ListSitePublishingProfileXML(resourceGroupName string, name string, options CsmPublishingProfileOptions) (result autorest.Response, ae error) {
+func (client SitesClient) ListSitePublishingProfileXML(resourceGroupName string, name string, options CsmPublishingProfileOptions) (result ReadCloser, err error) {
req, err := client.ListSitePublishingProfileXMLPreparer(resourceGroupName, name, options)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXML", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXML", nil, "Failure preparing request")
}
resp, err := client.ListSitePublishingProfileXMLSender(req)
if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXML", "Failure sending request")
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXML", resp, "Failure sending request")
}
result, err = client.ListSitePublishingProfileXMLResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXML", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXML", resp, "Failure responding to request")
}
return
@@ -7578,39 +7903,40 @@
// ListSitePublishingProfileXMLPreparer prepares the ListSitePublishingProfileXML request.
func (client SitesClient) ListSitePublishingProfileXMLPreparer(resourceGroupName string, name string, options CsmPublishingProfileOptions) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml", pathParameters),
autorest.WithJSON(options),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSitePublishingProfileXMLSender sends the ListSitePublishingProfileXML request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePublishingProfileXMLSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSitePublishingProfileXMLResponder handles the response to the ListSitePublishingProfileXML request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePublishingProfileXMLResponder(resp *http.Response) (result autorest.Response, err error) {
+func (client SitesClient) ListSitePublishingProfileXMLResponder(resp *http.Response) (result ReadCloser, err error) {
+ result.Value = &resp.Body
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = resp
+ azure.WithErrorUnlessStatusCode(http.StatusOK))
+ result.Response = autorest.Response{Response: resp}
return
}
@@ -7622,21 +7948,21 @@
// CsmPublishingProfileOptions.Format=FileZilla3 for FileZilla FTP format.
// slot is name of web app slot. If not specified then will default to
// production slot.
-func (client SitesClient) ListSitePublishingProfileXMLSlot(resourceGroupName string, name string, options CsmPublishingProfileOptions, slot string) (result autorest.Response, ae error) {
+func (client SitesClient) ListSitePublishingProfileXMLSlot(resourceGroupName string, name string, options CsmPublishingProfileOptions, slot string) (result ReadCloser, err error) {
req, err := client.ListSitePublishingProfileXMLSlotPreparer(resourceGroupName, name, options, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXMLSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXMLSlot", nil, "Failure preparing request")
}
resp, err := client.ListSitePublishingProfileXMLSlotSender(req)
if err != nil {
- result.Response = resp
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXMLSlot", "Failure sending request")
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXMLSlot", resp, "Failure sending request")
}
result, err = client.ListSitePublishingProfileXMLSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSitePublishingProfileXMLSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSitePublishingProfileXMLSlot", resp, "Failure responding to request")
}
return
@@ -7645,40 +7971,41 @@
// ListSitePublishingProfileXMLSlotPreparer prepares the ListSitePublishingProfileXMLSlot request.
func (client SitesClient) ListSitePublishingProfileXMLSlotPreparer(resourceGroupName string, name string, options CsmPublishingProfileOptions, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml", pathParameters),
autorest.WithJSON(options),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSitePublishingProfileXMLSlotSender sends the ListSitePublishingProfileXMLSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSitePublishingProfileXMLSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSitePublishingProfileXMLSlotResponder handles the response to the ListSitePublishingProfileXMLSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ListSitePublishingProfileXMLSlotResponder(resp *http.Response) (result autorest.Response, err error) {
+func (client SitesClient) ListSitePublishingProfileXMLSlotResponder(resp *http.Response) (result ReadCloser, err error) {
+ result.Value = &resp.Body
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK))
- result.Response = resp
+ azure.WithErrorUnlessStatusCode(http.StatusOK))
+ result.Response = autorest.Response{Response: resp}
return
}
@@ -7687,21 +8014,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app
-func (client SitesClient) ListSiteRelayServiceConnections(resourceGroupName string, name string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) ListSiteRelayServiceConnections(resourceGroupName string, name string) (result RelayServiceConnectionEntity, err error) {
req, err := client.ListSiteRelayServiceConnectionsPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnections", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnections", nil, "Failure preparing request")
}
resp, err := client.ListSiteRelayServiceConnectionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnections", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnections", resp, "Failure sending request")
}
result, err = client.ListSiteRelayServiceConnectionsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnections", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnections", resp, "Failure responding to request")
}
return
@@ -7710,28 +8037,27 @@
// ListSiteRelayServiceConnectionsPreparer prepares the ListSiteRelayServiceConnections request.
func (client SitesClient) ListSiteRelayServiceConnectionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteRelayServiceConnectionsSender sends the ListSiteRelayServiceConnections request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteRelayServiceConnectionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteRelayServiceConnectionsResponder handles the response to the ListSiteRelayServiceConnections request. The method always
@@ -7740,7 +8066,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -7752,21 +8078,21 @@
//
// resourceGroupName is the resource group name name is the name of the web
// app slot is the name of the slot for the web app.
-func (client SitesClient) ListSiteRelayServiceConnectionsSlot(resourceGroupName string, name string, slot string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) ListSiteRelayServiceConnectionsSlot(resourceGroupName string, name string, slot string) (result RelayServiceConnectionEntity, err error) {
req, err := client.ListSiteRelayServiceConnectionsSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnectionsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnectionsSlot", nil, "Failure preparing request")
}
resp, err := client.ListSiteRelayServiceConnectionsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnectionsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnectionsSlot", resp, "Failure sending request")
}
result, err = client.ListSiteRelayServiceConnectionsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ListSiteRelayServiceConnectionsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ListSiteRelayServiceConnectionsSlot", resp, "Failure responding to request")
}
return
@@ -7775,29 +8101,28 @@
// ListSiteRelayServiceConnectionsSlotPreparer prepares the ListSiteRelayServiceConnectionsSlot request.
func (client SitesClient) ListSiteRelayServiceConnectionsSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListSiteRelayServiceConnectionsSlotSender sends the ListSiteRelayServiceConnectionsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ListSiteRelayServiceConnectionsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListSiteRelayServiceConnectionsSlotResponder handles the response to the ListSiteRelayServiceConnectionsSlot request. The method always
@@ -7806,165 +8131,175 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// RecoverSite sends the recover site request.
+// RecoverSite sends the recover site request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
-// snapshot is snapshot data used for web app recovery. Snapshot information
-// can be obtained by call GetDeletedSites API.
-func (client SitesClient) RecoverSite(resourceGroupName string, name string, snapshot CsmSiteRecoveryEntity) (result ObjectSet, ae error) {
- req, err := client.RecoverSitePreparer(resourceGroupName, name, snapshot)
+// recoveryEntity is snapshot data used for web app recovery. Snapshot
+// information can be obtained by calling GetDeletedSites or GetSiteSnapshots
+// API.
+func (client SitesClient) RecoverSite(resourceGroupName string, name string, recoveryEntity CsmSiteRecoveryEntity, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RecoverSitePreparer(resourceGroupName, name, recoveryEntity, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSite", nil, "Failure preparing request")
}
resp, err := client.RecoverSiteSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSite", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSite", resp, "Failure sending request")
}
result, err = client.RecoverSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSite", resp, "Failure responding to request")
}
return
}
// RecoverSitePreparer prepares the RecoverSite request.
-func (client SitesClient) RecoverSitePreparer(resourceGroupName string, name string, snapshot CsmSiteRecoveryEntity) (*http.Request, error) {
+func (client SitesClient) RecoverSitePreparer(resourceGroupName string, name string, recoveryEntity CsmSiteRecoveryEntity, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover"),
- autorest.WithJSON(snapshot),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover", pathParameters),
+ autorest.WithJSON(recoveryEntity),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RecoverSiteSender sends the RecoverSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RecoverSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RecoverSiteResponder handles the response to the RecoverSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) RecoverSiteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) RecoverSiteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// RecoverSiteSlot sends the recover site slot request.
+// RecoverSiteSlot sends the recover site slot request. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
-// snapshot is snapshot data used for web app recovery. Snapshot information
-// can be obtained by call GetDeletedSites API. slot is name of web app slot.
-// If not specified then will default to production slot.
-func (client SitesClient) RecoverSiteSlot(resourceGroupName string, name string, snapshot CsmSiteRecoveryEntity, slot string) (result ObjectSet, ae error) {
- req, err := client.RecoverSiteSlotPreparer(resourceGroupName, name, snapshot, slot)
+// recoveryEntity is snapshot data used for web app recovery. Snapshot
+// information can be obtained by calling GetDeletedSites or GetSiteSnapshots
+// API. slot is name of web app slot. If not specified then will default to
+// production slot.
+func (client SitesClient) RecoverSiteSlot(resourceGroupName string, name string, recoveryEntity CsmSiteRecoveryEntity, slot string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RecoverSiteSlotPreparer(resourceGroupName, name, recoveryEntity, slot, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSiteSlot", nil, "Failure preparing request")
}
resp, err := client.RecoverSiteSlotSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSiteSlot", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSiteSlot", resp, "Failure sending request")
}
result, err = client.RecoverSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RecoverSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RecoverSiteSlot", resp, "Failure responding to request")
}
return
}
// RecoverSiteSlotPreparer prepares the RecoverSiteSlot request.
-func (client SitesClient) RecoverSiteSlotPreparer(resourceGroupName string, name string, snapshot CsmSiteRecoveryEntity, slot string) (*http.Request, error) {
+func (client SitesClient) RecoverSiteSlotPreparer(resourceGroupName string, name string, recoveryEntity CsmSiteRecoveryEntity, slot string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover"),
- autorest.WithJSON(snapshot),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover", pathParameters),
+ autorest.WithJSON(recoveryEntity),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RecoverSiteSlotSender sends the RecoverSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RecoverSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RecoverSiteSlotResponder handles the response to the RecoverSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) RecoverSiteSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) RecoverSiteSlotResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// ResetProductionSlotConfig sends the reset production slot config request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) ResetProductionSlotConfig(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) ResetProductionSlotConfig(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.ResetProductionSlotConfigPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ResetProductionSlotConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ResetProductionSlotConfig", nil, "Failure preparing request")
}
resp, err := client.ResetProductionSlotConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ResetProductionSlotConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ResetProductionSlotConfig", resp, "Failure sending request")
}
result, err = client.ResetProductionSlotConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ResetProductionSlotConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ResetProductionSlotConfig", resp, "Failure responding to request")
}
return
@@ -7973,37 +8308,36 @@
// ResetProductionSlotConfigPreparer prepares the ResetProductionSlotConfig request.
func (client SitesClient) ResetProductionSlotConfigPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ResetProductionSlotConfigSender sends the ResetProductionSlotConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ResetProductionSlotConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ResetProductionSlotConfigResponder handles the response to the ResetProductionSlotConfig request. The method always
// closes the http.Response Body.
-func (client SitesClient) ResetProductionSlotConfigResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ResetProductionSlotConfigResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8015,21 +8349,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) ResetSlotConfigSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) ResetSlotConfigSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
req, err := client.ResetSlotConfigSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ResetSlotConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ResetSlotConfigSlot", nil, "Failure preparing request")
}
resp, err := client.ResetSlotConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "ResetSlotConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "ResetSlotConfigSlot", resp, "Failure sending request")
}
result, err = client.ResetSlotConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "ResetSlotConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "ResetSlotConfigSlot", resp, "Failure responding to request")
}
return
@@ -8038,38 +8372,37 @@
// ResetSlotConfigSlotPreparer prepares the ResetSlotConfigSlot request.
func (client SitesClient) ResetSlotConfigSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ResetSlotConfigSlotSender sends the ResetSlotConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) ResetSlotConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ResetSlotConfigSlotResponder handles the response to the ResetSlotConfigSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) ResetSlotConfigSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) ResetSlotConfigSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8083,21 +8416,21 @@
// restarts the app if necessary. Hard restart always restarts and
// reprovisions the app synchronous is if true then the API will block until
// the app has been restarted
-func (client SitesClient) RestartSite(resourceGroupName string, name string, softRestart *bool, synchronous *bool) (result ObjectSet, ae error) {
+func (client SitesClient) RestartSite(resourceGroupName string, name string, softRestart *bool, synchronous *bool) (result SetObject, err error) {
req, err := client.RestartSitePreparer(resourceGroupName, name, softRestart, synchronous)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestartSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestartSite", nil, "Failure preparing request")
}
resp, err := client.RestartSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestartSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestartSite", resp, "Failure sending request")
}
result, err = client.RestartSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RestartSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RestartSite", resp, "Failure responding to request")
}
return
@@ -8106,43 +8439,42 @@
// RestartSitePreparer prepares the RestartSite request.
func (client SitesClient) RestartSitePreparer(resourceGroupName string, name string, softRestart *bool, synchronous *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if softRestart != nil {
- queryParameters["softRestart"] = softRestart
+ queryParameters["softRestart"] = autorest.Encode("query", *softRestart)
}
if synchronous != nil {
- queryParameters["synchronous"] = synchronous
+ queryParameters["synchronous"] = autorest.Encode("query", *synchronous)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RestartSiteSender sends the RestartSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RestartSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RestartSiteResponder handles the response to the RestartSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) RestartSiteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) RestartSiteResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8157,21 +8489,21 @@
// restarts the app if necessary. Hard restart always restarts and
// reprovisions the app synchronous is if true then the API will block until
// the app has been restarted
-func (client SitesClient) RestartSiteSlot(resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (result ObjectSet, ae error) {
+func (client SitesClient) RestartSiteSlot(resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (result SetObject, err error) {
req, err := client.RestartSiteSlotPreparer(resourceGroupName, name, slot, softRestart, synchronous)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestartSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestartSiteSlot", nil, "Failure preparing request")
}
resp, err := client.RestartSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestartSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestartSiteSlot", resp, "Failure sending request")
}
result, err = client.RestartSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RestartSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RestartSiteSlot", resp, "Failure responding to request")
}
return
@@ -8180,204 +8512,211 @@
// RestartSiteSlotPreparer prepares the RestartSiteSlot request.
func (client SitesClient) RestartSiteSlotPreparer(resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
if softRestart != nil {
- queryParameters["softRestart"] = softRestart
+ queryParameters["softRestart"] = autorest.Encode("query", *softRestart)
}
if synchronous != nil {
- queryParameters["synchronous"] = synchronous
+ queryParameters["synchronous"] = autorest.Encode("query", *synchronous)
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// RestartSiteSlotSender sends the RestartSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RestartSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// RestartSiteSlotResponder handles the response to the RestartSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) RestartSiteSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) RestartSiteSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// RestoreSite sends the restore site request.
+// RestoreSite sends the restore site request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup to restore request is information on restore
// request
-func (client SitesClient) RestoreSite(resourceGroupName string, name string, backupID string, request RestoreRequest) (result RestoreResponse, ae error) {
- req, err := client.RestoreSitePreparer(resourceGroupName, name, backupID, request)
+func (client SitesClient) RestoreSite(resourceGroupName string, name string, backupID string, request RestoreRequest, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RestoreSitePreparer(resourceGroupName, name, backupID, request, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSite", nil, "Failure preparing request")
}
resp, err := client.RestoreSiteSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSite", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSite", resp, "Failure sending request")
}
result, err = client.RestoreSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSite", resp, "Failure responding to request")
}
return
}
// RestoreSitePreparer prepares the RestoreSite request.
-func (client SitesClient) RestoreSitePreparer(resourceGroupName string, name string, backupID string, request RestoreRequest) (*http.Request, error) {
+func (client SitesClient) RestoreSitePreparer(resourceGroupName string, name string, backupID string, request RestoreRequest, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestoreSiteSender sends the RestoreSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RestoreSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RestoreSiteResponder handles the response to the RestoreSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) RestoreSiteResponder(resp *http.Response) (result RestoreResponse, err error) {
+func (client SitesClient) RestoreSiteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// RestoreSiteSlot sends the restore site slot request.
+// RestoreSiteSlot sends the restore site slot request. This method may poll
+// for completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
// backupID is id of backup to restore request is information on restore
// request slot is name of web app slot. If not specified then will default
// to production slot.
-func (client SitesClient) RestoreSiteSlot(resourceGroupName string, name string, backupID string, request RestoreRequest, slot string) (result RestoreResponse, ae error) {
- req, err := client.RestoreSiteSlotPreparer(resourceGroupName, name, backupID, request, slot)
+func (client SitesClient) RestoreSiteSlot(resourceGroupName string, name string, backupID string, request RestoreRequest, slot string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.RestoreSiteSlotPreparer(resourceGroupName, name, backupID, request, slot, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSiteSlot", nil, "Failure preparing request")
}
resp, err := client.RestoreSiteSlotSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSiteSlot", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSiteSlot", resp, "Failure sending request")
}
result, err = client.RestoreSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "RestoreSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "RestoreSiteSlot", resp, "Failure responding to request")
}
return
}
// RestoreSiteSlotPreparer prepares the RestoreSiteSlot request.
-func (client SitesClient) RestoreSiteSlotPreparer(resourceGroupName string, name string, backupID string, request RestoreRequest, slot string) (*http.Request, error) {
+func (client SitesClient) RestoreSiteSlotPreparer(resourceGroupName string, name string, backupID string, request RestoreRequest, slot string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "backupId": url.QueryEscape(backupID),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "backupId": autorest.Encode("path", backupID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestoreSiteSlotSender sends the RestoreSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) RestoreSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// RestoreSiteSlotResponder handles the response to the RestoreSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) RestoreSiteSlotResponder(resp *http.Response) (result RestoreResponse, err error) {
+func (client SitesClient) RestoreSiteSlotResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// StartSite sends the start site request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) StartSite(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) StartSite(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.StartSitePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StartSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StartSite", nil, "Failure preparing request")
}
resp, err := client.StartSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StartSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StartSite", resp, "Failure sending request")
}
result, err = client.StartSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "StartSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "StartSite", resp, "Failure responding to request")
}
return
@@ -8386,37 +8725,36 @@
// StartSitePreparer prepares the StartSite request.
func (client SitesClient) StartSitePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// StartSiteSender sends the StartSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) StartSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// StartSiteResponder handles the response to the StartSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) StartSiteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) StartSiteResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8428,21 +8766,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) StartSiteSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) StartSiteSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
req, err := client.StartSiteSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StartSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StartSiteSlot", nil, "Failure preparing request")
}
resp, err := client.StartSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StartSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StartSiteSlot", resp, "Failure sending request")
}
result, err = client.StartSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "StartSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "StartSiteSlot", resp, "Failure responding to request")
}
return
@@ -8451,38 +8789,37 @@
// StartSiteSlotPreparer prepares the StartSiteSlot request.
func (client SitesClient) StartSiteSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// StartSiteSlotSender sends the StartSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) StartSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// StartSiteSlotResponder handles the response to the StartSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) StartSiteSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) StartSiteSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8492,21 +8829,21 @@
// StopSite sends the stop site request.
//
// resourceGroupName is name of resource group name is name of web app
-func (client SitesClient) StopSite(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) StopSite(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.StopSitePreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StopSite", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StopSite", nil, "Failure preparing request")
}
resp, err := client.StopSiteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StopSite", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StopSite", resp, "Failure sending request")
}
result, err = client.StopSiteResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "StopSite", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "StopSite", resp, "Failure responding to request")
}
return
@@ -8515,37 +8852,36 @@
// StopSitePreparer prepares the StopSite request.
func (client SitesClient) StopSitePreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// StopSiteSender sends the StopSite request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) StopSiteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// StopSiteResponder handles the response to the StopSite request. The method always
// closes the http.Response Body.
-func (client SitesClient) StopSiteResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) StopSiteResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8557,21 +8893,21 @@
// resourceGroupName is name of resource group name is name of web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) StopSiteSlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) StopSiteSlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
req, err := client.StopSiteSlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StopSiteSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StopSiteSlot", nil, "Failure preparing request")
}
resp, err := client.StopSiteSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "StopSiteSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "StopSiteSlot", resp, "Failure sending request")
}
result, err = client.StopSiteSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "StopSiteSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "StopSiteSlot", resp, "Failure responding to request")
}
return
@@ -8580,193 +8916,200 @@
// StopSiteSlotPreparer prepares the StopSiteSlot request.
func (client SitesClient) StopSiteSlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// StopSiteSlotSender sends the StopSiteSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) StopSiteSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// StopSiteSlotResponder handles the response to the StopSiteSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) StopSiteSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) StopSiteSlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
-// SwapSlotsSlot sends the swap slots slot request.
+// SwapSlotsSlot sends the swap slots slot request. This method may poll for
+// completion. Polling can be canceled by passing the cancel channel
+// argument. The channel will be used to cancel polling and any outstanding
+// HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
// slotSwapEntity is request body that contains the target slot name slot is
// name of source slot for the swap
-func (client SitesClient) SwapSlotsSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result ObjectSet, ae error) {
- req, err := client.SwapSlotsSlotPreparer(resourceGroupName, name, slotSwapEntity, slot)
+func (client SitesClient) SwapSlotsSlot(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.SwapSlotsSlotPreparer(resourceGroupName, name, slotSwapEntity, slot, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotsSlot", nil, "Failure preparing request")
}
resp, err := client.SwapSlotsSlotSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotsSlot", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotsSlot", resp, "Failure sending request")
}
result, err = client.SwapSlotsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotsSlot", resp, "Failure responding to request")
}
return
}
// SwapSlotsSlotPreparer prepares the SwapSlotsSlot request.
-func (client SitesClient) SwapSlotsSlotPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) {
+func (client SitesClient) SwapSlotsSlotPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// SwapSlotsSlotSender sends the SwapSlotsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) SwapSlotsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// SwapSlotsSlotResponder handles the response to the SwapSlotsSlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) SwapSlotsSlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) SwapSlotsSlotResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
-// SwapSlotWithProduction sends the swap slot with production request.
+// SwapSlotWithProduction sends the swap slot with production request. This
+// method may poll for completion. Polling can be canceled by passing the
+// cancel channel argument. The channel will be used to cancel polling and
+// any outstanding HTTP requests.
//
// resourceGroupName is name of resource group name is name of web app
// slotSwapEntity is request body that contains the target slot name
-func (client SitesClient) SwapSlotWithProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result ObjectSet, ae error) {
- req, err := client.SwapSlotWithProductionPreparer(resourceGroupName, name, slotSwapEntity)
+func (client SitesClient) SwapSlotWithProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, cancel <-chan struct{}) (result autorest.Response, err error) {
+ req, err := client.SwapSlotWithProductionPreparer(resourceGroupName, name, slotSwapEntity, cancel)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotWithProduction", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotWithProduction", nil, "Failure preparing request")
}
resp, err := client.SwapSlotWithProductionSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotWithProduction", "Failure sending request")
+ result.Response = resp
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotWithProduction", resp, "Failure sending request")
}
result, err = client.SwapSlotWithProductionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "SwapSlotWithProduction", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "SwapSlotWithProduction", resp, "Failure responding to request")
}
return
}
// SwapSlotWithProductionPreparer prepares the SwapSlotWithProduction request.
-func (client SitesClient) SwapSlotWithProductionPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) {
+func (client SitesClient) SwapSlotWithProductionPreparer(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap", pathParameters),
autorest.WithJSON(slotSwapEntity),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{Cancel: cancel})
}
// SwapSlotWithProductionSender sends the SwapSlotWithProduction request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) SwapSlotWithProductionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK, http.StatusAccepted)
+ return autorest.SendWithSender(client,
+ req,
+ azure.DoPollForAsynchronous(client.PollingDelay))
}
// SwapSlotWithProductionResponder handles the response to the SwapSlotWithProduction request. The method always
// closes the http.Response Body.
-func (client SitesClient) SwapSlotWithProductionResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) SwapSlotWithProductionResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result.Value),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
+ result.Response = resp
return
}
// SyncSiteRepository sends the sync site repository request.
//
-func (client SitesClient) SyncSiteRepository(resourceGroupName string, name string) (result ObjectSet, ae error) {
+func (client SitesClient) SyncSiteRepository(resourceGroupName string, name string) (result SetObject, err error) {
req, err := client.SyncSiteRepositoryPreparer(resourceGroupName, name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepository", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepository", nil, "Failure preparing request")
}
resp, err := client.SyncSiteRepositorySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepository", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepository", resp, "Failure sending request")
}
result, err = client.SyncSiteRepositoryResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepository", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepository", resp, "Failure responding to request")
}
return
@@ -8775,37 +9118,36 @@
// SyncSiteRepositoryPreparer prepares the SyncSiteRepository request.
func (client SitesClient) SyncSiteRepositoryPreparer(resourceGroupName string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// SyncSiteRepositorySender sends the SyncSiteRepository request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) SyncSiteRepositorySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// SyncSiteRepositoryResponder handles the response to the SyncSiteRepository request. The method always
// closes the http.Response Body.
-func (client SitesClient) SyncSiteRepositoryResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) SyncSiteRepositoryResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8814,21 +9156,21 @@
// SyncSiteRepositorySlot sends the sync site repository slot request.
//
-func (client SitesClient) SyncSiteRepositorySlot(resourceGroupName string, name string, slot string) (result ObjectSet, ae error) {
+func (client SitesClient) SyncSiteRepositorySlot(resourceGroupName string, name string, slot string) (result SetObject, err error) {
req, err := client.SyncSiteRepositorySlotPreparer(resourceGroupName, name, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepositorySlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepositorySlot", nil, "Failure preparing request")
}
resp, err := client.SyncSiteRepositorySlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepositorySlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepositorySlot", resp, "Failure sending request")
}
result, err = client.SyncSiteRepositorySlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "SyncSiteRepositorySlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "SyncSiteRepositorySlot", resp, "Failure responding to request")
}
return
@@ -8837,38 +9179,37 @@
// SyncSiteRepositorySlotPreparer prepares the SyncSiteRepositorySlot request.
func (client SitesClient) SyncSiteRepositorySlotPreparer(resourceGroupName string, name string, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// SyncSiteRepositorySlotSender sends the SyncSiteRepositorySlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) SyncSiteRepositorySlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// SyncSiteRepositorySlotResponder handles the response to the SyncSiteRepositorySlot request. The method always
// closes the http.Response Body.
-func (client SitesClient) SyncSiteRepositorySlotResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client SitesClient) SyncSiteRepositorySlotResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8879,21 +9220,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// appSettings is application settings of web app
-func (client SitesClient) UpdateSiteAppSettings(resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, ae error) {
+func (client SitesClient) UpdateSiteAppSettings(resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) {
req, err := client.UpdateSiteAppSettingsPreparer(resourceGroupName, name, appSettings)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettings", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteAppSettingsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettings", resp, "Failure sending request")
}
result, err = client.UpdateSiteAppSettingsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettings", resp, "Failure responding to request")
}
return
@@ -8902,29 +9243,29 @@
// UpdateSiteAppSettingsPreparer prepares the UpdateSiteAppSettings request.
func (client SitesClient) UpdateSiteAppSettingsPreparer(resourceGroupName string, name string, appSettings StringDictionary) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings", pathParameters),
autorest.WithJSON(appSettings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteAppSettingsSender sends the UpdateSiteAppSettings request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteAppSettingsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteAppSettingsResponder handles the response to the UpdateSiteAppSettings request. The method always
@@ -8933,7 +9274,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -8945,21 +9286,21 @@
// resourceGroupName is name of resource group name is name of web app
// appSettings is application settings of web app slot is name of web app
// slot. If not specified then will default to production slot.
-func (client SitesClient) UpdateSiteAppSettingsSlot(resourceGroupName string, name string, appSettings StringDictionary, slot string) (result StringDictionary, ae error) {
+func (client SitesClient) UpdateSiteAppSettingsSlot(resourceGroupName string, name string, appSettings StringDictionary, slot string) (result StringDictionary, err error) {
req, err := client.UpdateSiteAppSettingsSlotPreparer(resourceGroupName, name, appSettings, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettingsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettingsSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteAppSettingsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettingsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettingsSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteAppSettingsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAppSettingsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAppSettingsSlot", resp, "Failure responding to request")
}
return
@@ -8968,30 +9309,30 @@
// UpdateSiteAppSettingsSlotPreparer prepares the UpdateSiteAppSettingsSlot request.
func (client SitesClient) UpdateSiteAppSettingsSlotPreparer(resourceGroupName string, name string, appSettings StringDictionary, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings", pathParameters),
autorest.WithJSON(appSettings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteAppSettingsSlotSender sends the UpdateSiteAppSettingsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteAppSettingsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteAppSettingsSlotResponder handles the response to the UpdateSiteAppSettingsSlot request. The method always
@@ -9000,7 +9341,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9011,21 +9352,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// siteAuthSettings is auth settings associated with web app
-func (client SitesClient) UpdateSiteAuthSettings(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings) (result SiteAuthSettings, ae error) {
+func (client SitesClient) UpdateSiteAuthSettings(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings) (result SiteAuthSettings, err error) {
req, err := client.UpdateSiteAuthSettingsPreparer(resourceGroupName, name, siteAuthSettings)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettings", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteAuthSettingsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettings", resp, "Failure sending request")
}
result, err = client.UpdateSiteAuthSettingsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettings", resp, "Failure responding to request")
}
return
@@ -9034,29 +9375,29 @@
// UpdateSiteAuthSettingsPreparer prepares the UpdateSiteAuthSettings request.
func (client SitesClient) UpdateSiteAuthSettingsPreparer(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings", pathParameters),
autorest.WithJSON(siteAuthSettings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteAuthSettingsSender sends the UpdateSiteAuthSettings request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteAuthSettingsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteAuthSettingsResponder handles the response to the UpdateSiteAuthSettings request. The method always
@@ -9065,7 +9406,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9077,21 +9418,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteAuthSettings is auth settings associated with web app slot is name of
// web app slot. If not specified then will default to production slot.
-func (client SitesClient) UpdateSiteAuthSettingsSlot(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (result SiteAuthSettings, ae error) {
+func (client SitesClient) UpdateSiteAuthSettingsSlot(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (result SiteAuthSettings, err error) {
req, err := client.UpdateSiteAuthSettingsSlotPreparer(resourceGroupName, name, siteAuthSettings, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettingsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettingsSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteAuthSettingsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettingsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettingsSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteAuthSettingsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteAuthSettingsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteAuthSettingsSlot", resp, "Failure responding to request")
}
return
@@ -9100,30 +9441,30 @@
// UpdateSiteAuthSettingsSlotPreparer prepares the UpdateSiteAuthSettingsSlot request.
func (client SitesClient) UpdateSiteAuthSettingsSlotPreparer(resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings", pathParameters),
autorest.WithJSON(siteAuthSettings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteAuthSettingsSlotSender sends the UpdateSiteAuthSettingsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteAuthSettingsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteAuthSettingsSlotResponder handles the response to the UpdateSiteAuthSettingsSlot request. The method always
@@ -9132,7 +9473,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9144,21 +9485,21 @@
//
// resourceGroupName is name of resource group name is name of web app request
// is information on backup request
-func (client SitesClient) UpdateSiteBackupConfiguration(resourceGroupName string, name string, request BackupRequest) (result BackupRequest, ae error) {
+func (client SitesClient) UpdateSiteBackupConfiguration(resourceGroupName string, name string, request BackupRequest) (result BackupRequest, err error) {
req, err := client.UpdateSiteBackupConfigurationPreparer(resourceGroupName, name, request)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfiguration", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfiguration", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteBackupConfigurationSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfiguration", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfiguration", resp, "Failure sending request")
}
result, err = client.UpdateSiteBackupConfigurationResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfiguration", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfiguration", resp, "Failure responding to request")
}
return
@@ -9167,29 +9508,29 @@
// UpdateSiteBackupConfigurationPreparer prepares the UpdateSiteBackupConfiguration request.
func (client SitesClient) UpdateSiteBackupConfigurationPreparer(resourceGroupName string, name string, request BackupRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteBackupConfigurationSender sends the UpdateSiteBackupConfiguration request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteBackupConfigurationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteBackupConfigurationResponder handles the response to the UpdateSiteBackupConfiguration request. The method always
@@ -9198,141 +9539,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateSiteBackupConfigurationDeprecated sends the update site backup
-// configuration deprecated request.
-//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on backup request
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecated(resourceGroupName string, name string, request BackupRequest) (result BackupRequest, ae error) {
- req, err := client.UpdateSiteBackupConfigurationDeprecatedPreparer(resourceGroupName, name, request)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecated", "Failure preparing request")
- }
-
- resp, err := client.UpdateSiteBackupConfigurationDeprecatedSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecated", "Failure sending request")
- }
-
- result, err = client.UpdateSiteBackupConfigurationDeprecatedResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecated", "Failure responding to request")
- }
-
- return
-}
-
-// UpdateSiteBackupConfigurationDeprecatedPreparer prepares the UpdateSiteBackupConfigurationDeprecated request.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedPreparer(resourceGroupName string, name string, request BackupRequest) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup/config"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// UpdateSiteBackupConfigurationDeprecatedSender sends the UpdateSiteBackupConfigurationDeprecated request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// UpdateSiteBackupConfigurationDeprecatedResponder handles the response to the UpdateSiteBackupConfigurationDeprecated request. The method always
-// closes the http.Response Body.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedResponder(resp *http.Response) (result BackupRequest, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateSiteBackupConfigurationDeprecatedSlot sends the update site backup
-// configuration deprecated slot request.
-//
-// resourceGroupName is name of resource group name is name of web app request
-// is information on backup request slot is name of web app slot. If not
-// specified then will default to production slot.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupRequest, ae error) {
- req, err := client.UpdateSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName, name, request, slot)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecatedSlot", "Failure preparing request")
- }
-
- resp, err := client.UpdateSiteBackupConfigurationDeprecatedSlotSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecatedSlot", "Failure sending request")
- }
-
- result, err = client.UpdateSiteBackupConfigurationDeprecatedSlotResponder(resp)
- if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationDeprecatedSlot", "Failure responding to request")
- }
-
- return
-}
-
-// UpdateSiteBackupConfigurationDeprecatedSlotPreparer prepares the UpdateSiteBackupConfigurationDeprecatedSlot request.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedSlotPreparer(resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup/config"),
- autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
- autorest.WithQueryParameters(queryParameters))
-}
-
-// UpdateSiteBackupConfigurationDeprecatedSlotSender sends the UpdateSiteBackupConfigurationDeprecatedSlot request. The method will close the
-// http.Response Body if it receives an error.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
-}
-
-// UpdateSiteBackupConfigurationDeprecatedSlotResponder handles the response to the UpdateSiteBackupConfigurationDeprecatedSlot request. The method always
-// closes the http.Response Body.
-func (client SitesClient) UpdateSiteBackupConfigurationDeprecatedSlotResponder(resp *http.Response) (result BackupRequest, err error) {
- err = autorest.Respond(
- resp,
- client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9345,21 +9552,21 @@
// resourceGroupName is name of resource group name is name of web app request
// is information on backup request slot is name of web app slot. If not
// specified then will default to production slot.
-func (client SitesClient) UpdateSiteBackupConfigurationSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupRequest, ae error) {
+func (client SitesClient) UpdateSiteBackupConfigurationSlot(resourceGroupName string, name string, request BackupRequest, slot string) (result BackupRequest, err error) {
req, err := client.UpdateSiteBackupConfigurationSlotPreparer(resourceGroupName, name, request, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfigurationSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteBackupConfigurationSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfigurationSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteBackupConfigurationSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteBackupConfigurationSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteBackupConfigurationSlot", resp, "Failure responding to request")
}
return
@@ -9368,30 +9575,30 @@
// UpdateSiteBackupConfigurationSlotPreparer prepares the UpdateSiteBackupConfigurationSlot request.
func (client SitesClient) UpdateSiteBackupConfigurationSlotPreparer(resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", pathParameters),
autorest.WithJSON(request),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteBackupConfigurationSlotSender sends the UpdateSiteBackupConfigurationSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteBackupConfigurationSlotResponder handles the response to the UpdateSiteBackupConfigurationSlot request. The method always
@@ -9400,7 +9607,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9412,21 +9619,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteConfig is request body that contains the configuraiton setting for the
// web app
-func (client SitesClient) UpdateSiteConfig(resourceGroupName string, name string, siteConfig SiteConfig) (result SiteConfig, ae error) {
+func (client SitesClient) UpdateSiteConfig(resourceGroupName string, name string, siteConfig SiteConfig) (result SiteConfig, err error) {
req, err := client.UpdateSiteConfigPreparer(resourceGroupName, name, siteConfig)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfig", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfig", resp, "Failure sending request")
}
result, err = client.UpdateSiteConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfig", resp, "Failure responding to request")
}
return
@@ -9435,29 +9642,29 @@
// UpdateSiteConfigPreparer prepares the UpdateSiteConfig request.
func (client SitesClient) UpdateSiteConfigPreparer(resourceGroupName string, name string, siteConfig SiteConfig) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters),
autorest.WithJSON(siteConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteConfigSender sends the UpdateSiteConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteConfigResponder handles the response to the UpdateSiteConfig request. The method always
@@ -9466,7 +9673,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9479,21 +9686,21 @@
// siteConfig is request body that contains the configuraiton setting for the
// web app slot is name of web app slot. If not specified then will default
// to production slot.
-func (client SitesClient) UpdateSiteConfigSlot(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (result SiteConfig, ae error) {
+func (client SitesClient) UpdateSiteConfigSlot(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (result SiteConfig, err error) {
req, err := client.UpdateSiteConfigSlotPreparer(resourceGroupName, name, siteConfig, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfigSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfigSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConfigSlot", resp, "Failure responding to request")
}
return
@@ -9502,30 +9709,30 @@
// UpdateSiteConfigSlotPreparer prepares the UpdateSiteConfigSlot request.
func (client SitesClient) UpdateSiteConfigSlotPreparer(resourceGroupName string, name string, siteConfig SiteConfig, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters),
autorest.WithJSON(siteConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteConfigSlotSender sends the UpdateSiteConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteConfigSlotResponder handles the response to the UpdateSiteConfigSlot request. The method always
@@ -9534,7 +9741,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9546,21 +9753,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// connectionStrings is connection strings associated with web app
-func (client SitesClient) UpdateSiteConnectionStrings(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary) (result ConnectionStringDictionary, ae error) {
+func (client SitesClient) UpdateSiteConnectionStrings(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary) (result ConnectionStringDictionary, err error) {
req, err := client.UpdateSiteConnectionStringsPreparer(resourceGroupName, name, connectionStrings)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStrings", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStrings", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteConnectionStringsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStrings", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStrings", resp, "Failure sending request")
}
result, err = client.UpdateSiteConnectionStringsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStrings", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStrings", resp, "Failure responding to request")
}
return
@@ -9569,29 +9776,29 @@
// UpdateSiteConnectionStringsPreparer prepares the UpdateSiteConnectionStrings request.
func (client SitesClient) UpdateSiteConnectionStringsPreparer(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings", pathParameters),
autorest.WithJSON(connectionStrings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteConnectionStringsSender sends the UpdateSiteConnectionStrings request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteConnectionStringsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteConnectionStringsResponder handles the response to the UpdateSiteConnectionStrings request. The method always
@@ -9600,7 +9807,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9614,21 +9821,21 @@
// connectionStrings is connection strings associated with web app slot is
// name of web app slot. If not specified then will default to production
// slot.
-func (client SitesClient) UpdateSiteConnectionStringsSlot(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (result ConnectionStringDictionary, ae error) {
+func (client SitesClient) UpdateSiteConnectionStringsSlot(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (result ConnectionStringDictionary, err error) {
req, err := client.UpdateSiteConnectionStringsSlotPreparer(resourceGroupName, name, connectionStrings, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStringsSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStringsSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteConnectionStringsSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStringsSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStringsSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteConnectionStringsSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteConnectionStringsSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteConnectionStringsSlot", resp, "Failure responding to request")
}
return
@@ -9637,30 +9844,30 @@
// UpdateSiteConnectionStringsSlotPreparer prepares the UpdateSiteConnectionStringsSlot request.
func (client SitesClient) UpdateSiteConnectionStringsSlotPreparer(resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings", pathParameters),
autorest.WithJSON(connectionStrings),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteConnectionStringsSlotSender sends the UpdateSiteConnectionStringsSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteConnectionStringsSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteConnectionStringsSlotResponder handles the response to the UpdateSiteConnectionStringsSlot request. The method always
@@ -9669,7 +9876,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9680,21 +9887,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// siteLogsConfig is site logs configuration
-func (client SitesClient) UpdateSiteLogsConfig(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (result SiteLogsConfig, ae error) {
+func (client SitesClient) UpdateSiteLogsConfig(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (result SiteLogsConfig, err error) {
req, err := client.UpdateSiteLogsConfigPreparer(resourceGroupName, name, siteLogsConfig)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfig", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfig", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteLogsConfigSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfig", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfig", resp, "Failure sending request")
}
result, err = client.UpdateSiteLogsConfigResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfig", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfig", resp, "Failure responding to request")
}
return
@@ -9703,29 +9910,29 @@
// UpdateSiteLogsConfigPreparer prepares the UpdateSiteLogsConfig request.
func (client SitesClient) UpdateSiteLogsConfigPreparer(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters),
autorest.WithJSON(siteLogsConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteLogsConfigSender sends the UpdateSiteLogsConfig request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteLogsConfigSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteLogsConfigResponder handles the response to the UpdateSiteLogsConfig request. The method always
@@ -9734,7 +9941,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9746,21 +9953,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteLogsConfig is site logs configuration slot is name of web app slot. If
// not specified then will default to production slot.
-func (client SitesClient) UpdateSiteLogsConfigSlot(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (result SiteLogsConfig, ae error) {
+func (client SitesClient) UpdateSiteLogsConfigSlot(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (result SiteLogsConfig, err error) {
req, err := client.UpdateSiteLogsConfigSlotPreparer(resourceGroupName, name, siteLogsConfig, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfigSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfigSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteLogsConfigSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfigSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfigSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteLogsConfigSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteLogsConfigSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteLogsConfigSlot", resp, "Failure responding to request")
}
return
@@ -9769,30 +9976,30 @@
// UpdateSiteLogsConfigSlotPreparer prepares the UpdateSiteLogsConfigSlot request.
func (client SitesClient) UpdateSiteLogsConfigSlotPreparer(resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters),
autorest.WithJSON(siteLogsConfig),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteLogsConfigSlotSender sends the UpdateSiteLogsConfigSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteLogsConfigSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteLogsConfigSlotResponder handles the response to the UpdateSiteLogsConfigSlot request. The method always
@@ -9801,7 +10008,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9812,21 +10019,21 @@
//
// resourceGroupName is name of resource group name is name of web app
// metadata is meta data of web app
-func (client SitesClient) UpdateSiteMetadata(resourceGroupName string, name string, metadata StringDictionary) (result StringDictionary, ae error) {
+func (client SitesClient) UpdateSiteMetadata(resourceGroupName string, name string, metadata StringDictionary) (result StringDictionary, err error) {
req, err := client.UpdateSiteMetadataPreparer(resourceGroupName, name, metadata)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadata", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadata", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteMetadataSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadata", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadata", resp, "Failure sending request")
}
result, err = client.UpdateSiteMetadataResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadata", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadata", resp, "Failure responding to request")
}
return
@@ -9835,29 +10042,29 @@
// UpdateSiteMetadataPreparer prepares the UpdateSiteMetadata request.
func (client SitesClient) UpdateSiteMetadataPreparer(resourceGroupName string, name string, metadata StringDictionary) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata", pathParameters),
autorest.WithJSON(metadata),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteMetadataSender sends the UpdateSiteMetadata request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteMetadataSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteMetadataResponder handles the response to the UpdateSiteMetadata request. The method always
@@ -9866,7 +10073,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9878,21 +10085,21 @@
// resourceGroupName is name of resource group name is name of web app
// metadata is meta data of web app slot is name of web app slot. If not
// specified then will default to production slot.
-func (client SitesClient) UpdateSiteMetadataSlot(resourceGroupName string, name string, metadata StringDictionary, slot string) (result StringDictionary, ae error) {
+func (client SitesClient) UpdateSiteMetadataSlot(resourceGroupName string, name string, metadata StringDictionary, slot string) (result StringDictionary, err error) {
req, err := client.UpdateSiteMetadataSlotPreparer(resourceGroupName, name, metadata, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadataSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadataSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteMetadataSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadataSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadataSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteMetadataSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteMetadataSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteMetadataSlot", resp, "Failure responding to request")
}
return
@@ -9901,30 +10108,30 @@
// UpdateSiteMetadataSlotPreparer prepares the UpdateSiteMetadataSlot request.
func (client SitesClient) UpdateSiteMetadataSlotPreparer(resourceGroupName string, name string, metadata StringDictionary, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata", pathParameters),
autorest.WithJSON(metadata),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteMetadataSlotSender sends the UpdateSiteMetadataSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteMetadataSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteMetadataSlotResponder handles the response to the UpdateSiteMetadataSlot request. The method always
@@ -9933,7 +10140,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -9946,21 +10153,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app entityName is the name by which the Hybrid Connection is identified
// connectionEnvelope is the details of the Hybrid Connection
-func (client SitesClient) UpdateSiteRelayServiceConnection(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) UpdateSiteRelayServiceConnection(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) {
req, err := client.UpdateSiteRelayServiceConnectionPreparer(resourceGroupName, name, entityName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnection", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteRelayServiceConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnection", resp, "Failure sending request")
}
result, err = client.UpdateSiteRelayServiceConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnection", resp, "Failure responding to request")
}
return
@@ -9969,30 +10176,30 @@
// UpdateSiteRelayServiceConnectionPreparer prepares the UpdateSiteRelayServiceConnection request.
func (client SitesClient) UpdateSiteRelayServiceConnectionPreparer(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteRelayServiceConnectionSender sends the UpdateSiteRelayServiceConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteRelayServiceConnectionResponder handles the response to the UpdateSiteRelayServiceConnection request. The method always
@@ -10001,7 +10208,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10015,21 +10222,21 @@
// app entityName is the name by which the Hybrid Connection is identified
// connectionEnvelope is the details of the Hybrid Connection slot is the
// name of the slot for the web app.
-func (client SitesClient) UpdateSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, ae error) {
+func (client SitesClient) UpdateSiteRelayServiceConnectionSlot(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) {
req, err := client.UpdateSiteRelayServiceConnectionSlotPreparer(resourceGroupName, name, entityName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteRelayServiceConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnectionSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteRelayServiceConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteRelayServiceConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteRelayServiceConnectionSlot", resp, "Failure responding to request")
}
return
@@ -10038,31 +10245,31 @@
// UpdateSiteRelayServiceConnectionSlotPreparer prepares the UpdateSiteRelayServiceConnectionSlot request.
func (client SitesClient) UpdateSiteRelayServiceConnectionSlotPreparer(resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "entityName": url.QueryEscape(entityName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "entityName": autorest.Encode("path", entityName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteRelayServiceConnectionSlotSender sends the UpdateSiteRelayServiceConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteRelayServiceConnectionSlotResponder handles the response to the UpdateSiteRelayServiceConnectionSlot request. The method always
@@ -10071,7 +10278,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10083,21 +10290,21 @@
// resourceGroupName is name of resource group name is name of web app
// siteSourceControl is request body that contains the source control
// parameters
-func (client SitesClient) UpdateSiteSourceControl(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result SiteSourceControl, ae error) {
+func (client SitesClient) UpdateSiteSourceControl(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result SiteSourceControl, err error) {
req, err := client.UpdateSiteSourceControlPreparer(resourceGroupName, name, siteSourceControl)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControl", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControl", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteSourceControlSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControl", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControl", resp, "Failure sending request")
}
result, err = client.UpdateSiteSourceControlResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControl", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControl", resp, "Failure responding to request")
}
return
@@ -10106,29 +10313,29 @@
// UpdateSiteSourceControlPreparer prepares the UpdateSiteSourceControl request.
func (client SitesClient) UpdateSiteSourceControlPreparer(resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters),
autorest.WithJSON(siteSourceControl),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteSourceControlSender sends the UpdateSiteSourceControl request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteSourceControlSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteSourceControlResponder handles the response to the UpdateSiteSourceControl request. The method always
@@ -10137,7 +10344,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10151,21 +10358,21 @@
// siteSourceControl is request body that contains the source control
// parameters slot is name of web app slot. If not specified then will
// default to production slot.
-func (client SitesClient) UpdateSiteSourceControlSlot(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, ae error) {
+func (client SitesClient) UpdateSiteSourceControlSlot(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, err error) {
req, err := client.UpdateSiteSourceControlSlotPreparer(resourceGroupName, name, siteSourceControl, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControlSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControlSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteSourceControlSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControlSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControlSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteSourceControlSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteSourceControlSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteSourceControlSlot", resp, "Failure responding to request")
}
return
@@ -10174,30 +10381,30 @@
// UpdateSiteSourceControlSlotPreparer prepares the UpdateSiteSourceControlSlot request.
func (client SitesClient) UpdateSiteSourceControlSlotPreparer(resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters),
autorest.WithJSON(siteSourceControl),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteSourceControlSlotSender sends the UpdateSiteSourceControlSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteSourceControlSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteSourceControlSlotResponder handles the response to the UpdateSiteSourceControlSlot request. The method always
@@ -10206,7 +10413,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10218,21 +10425,21 @@
// resourceGroupName is the resource group name name is the name of the web
// app vnetName is the name of the Virtual Network connectionEnvelope is the
// properties of this Virtual Network Connection
-func (client SitesClient) UpdateSiteVNETConnection(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, ae error) {
+func (client SitesClient) UpdateSiteVNETConnection(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) {
req, err := client.UpdateSiteVNETConnectionPreparer(resourceGroupName, name, vnetName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnection", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnection", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteVNETConnectionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnection", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnection", resp, "Failure sending request")
}
result, err = client.UpdateSiteVNETConnectionResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnection", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnection", resp, "Failure responding to request")
}
return
@@ -10241,30 +10448,30 @@
// UpdateSiteVNETConnectionPreparer prepares the UpdateSiteVNETConnection request.
func (client SitesClient) UpdateSiteVNETConnectionPreparer(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteVNETConnectionSender sends the UpdateSiteVNETConnection request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteVNETConnectionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteVNETConnectionResponder handles the response to the UpdateSiteVNETConnection request. The method always
@@ -10273,7 +10480,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10287,21 +10494,21 @@
// app vnetName is the name of the Virtual Network gatewayName is the name of
// the gateway. The only gateway that exists presently is "primary"
// connectionEnvelope is the properties to update this gateway with.
-func (client SitesClient) UpdateSiteVNETConnectionGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, ae error) {
+func (client SitesClient) UpdateSiteVNETConnectionGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) {
req, err := client.UpdateSiteVNETConnectionGatewayPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGateway", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGateway", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteVNETConnectionGatewaySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGateway", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGateway", resp, "Failure sending request")
}
result, err = client.UpdateSiteVNETConnectionGatewayResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGateway", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGateway", resp, "Failure responding to request")
}
return
@@ -10310,31 +10517,31 @@
// UpdateSiteVNETConnectionGatewayPreparer prepares the UpdateSiteVNETConnectionGateway request.
func (client SitesClient) UpdateSiteVNETConnectionGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteVNETConnectionGatewaySender sends the UpdateSiteVNETConnectionGateway request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteVNETConnectionGatewaySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteVNETConnectionGatewayResponder handles the response to the UpdateSiteVNETConnectionGateway request. The method always
@@ -10343,7 +10550,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10358,21 +10565,21 @@
// the gateway. The only gateway that exists presently is "primary"
// connectionEnvelope is the properties to update this gateway with. slot is
// the name of the slot for this web app.
-func (client SitesClient) UpdateSiteVNETConnectionGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, ae error) {
+func (client SitesClient) UpdateSiteVNETConnectionGatewaySlot(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) {
req, err := client.UpdateSiteVNETConnectionGatewaySlotPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGatewaySlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGatewaySlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteVNETConnectionGatewaySlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGatewaySlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGatewaySlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteVNETConnectionGatewaySlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionGatewaySlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionGatewaySlot", resp, "Failure responding to request")
}
return
@@ -10381,32 +10588,32 @@
// UpdateSiteVNETConnectionGatewaySlotPreparer prepares the UpdateSiteVNETConnectionGatewaySlot request.
func (client SitesClient) UpdateSiteVNETConnectionGatewaySlotPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "gatewayName": url.QueryEscape(gatewayName),
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "gatewayName": autorest.Encode("path", gatewayName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteVNETConnectionGatewaySlotSender sends the UpdateSiteVNETConnectionGatewaySlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteVNETConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteVNETConnectionGatewaySlotResponder handles the response to the UpdateSiteVNETConnectionGatewaySlot request. The method always
@@ -10415,7 +10622,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10429,21 +10636,21 @@
// app vnetName is the name of the Virtual Network connectionEnvelope is the
// properties of this Virtual Network Connection slot is the name of the slot
// for this web app.
-func (client SitesClient) UpdateSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, ae error) {
+func (client SitesClient) UpdateSiteVNETConnectionSlot(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) {
req, err := client.UpdateSiteVNETConnectionSlotPreparer(resourceGroupName, name, vnetName, connectionEnvelope, slot)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionSlot", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionSlot", nil, "Failure preparing request")
}
resp, err := client.UpdateSiteVNETConnectionSlotSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionSlot", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionSlot", resp, "Failure sending request")
}
result, err = client.UpdateSiteVNETConnectionSlotResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSiteVNETConnectionSlot", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSiteVNETConnectionSlot", resp, "Failure responding to request")
}
return
@@ -10452,31 +10659,31 @@
// UpdateSiteVNETConnectionSlotPreparer prepares the UpdateSiteVNETConnectionSlot request.
func (client SitesClient) UpdateSiteVNETConnectionSlotPreparer(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "slot": url.QueryEscape(slot),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
- "vnetName": url.QueryEscape(vnetName),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "slot": autorest.Encode("path", slot),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "vnetName": autorest.Encode("path", vnetName),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters),
autorest.WithJSON(connectionEnvelope),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSiteVNETConnectionSlotSender sends the UpdateSiteVNETConnectionSlot request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSiteVNETConnectionSlotSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSiteVNETConnectionSlotResponder handles the response to the UpdateSiteVNETConnectionSlot request. The method always
@@ -10485,7 +10692,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -10497,21 +10704,21 @@
// resourceGroupName is name of resource group name is name of web app
// slotConfigNames is request body containing the names of application
// settings and connection strings
-func (client SitesClient) UpdateSlotConfigNames(resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource) (result SlotConfigNamesResource, ae error) {
+func (client SitesClient) UpdateSlotConfigNames(resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource) (result SlotConfigNamesResource, err error) {
req, err := client.UpdateSlotConfigNamesPreparer(resourceGroupName, name, slotConfigNames)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSlotConfigNames", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSlotConfigNames", nil, "Failure preparing request")
}
resp, err := client.UpdateSlotConfigNamesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSlotConfigNames", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSlotConfigNames", resp, "Failure sending request")
}
result, err = client.UpdateSlotConfigNamesResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/SitesClient", "UpdateSlotConfigNames", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.SitesClient", "UpdateSlotConfigNames", resp, "Failure responding to request")
}
return
@@ -10520,29 +10727,29 @@
// UpdateSlotConfigNamesPreparer prepares the UpdateSlotConfigNames request.
func (client SitesClient) UpdateSlotConfigNamesPreparer(resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", pathParameters),
autorest.WithJSON(slotConfigNames),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// UpdateSlotConfigNamesSender sends the UpdateSlotConfigNames request. The method will close the
// http.Response Body if it receives an error.
func (client SitesClient) UpdateSlotConfigNamesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// UpdateSlotConfigNamesResponder handles the response to the UpdateSlotConfigNames request. The method always
@@ -10551,7 +10758,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/topleveldomains.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/topleveldomains.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/topleveldomains.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/topleveldomains.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// TopLevelDomainsClient is the use these APIs to manage Azure Websites
@@ -49,21 +49,21 @@
}
// GetGetTopLevelDomains sends the get get top level domains request.
-func (client TopLevelDomainsClient) GetGetTopLevelDomains() (result TopLevelDomainCollection, ae error) {
+func (client TopLevelDomainsClient) GetGetTopLevelDomains() (result TopLevelDomainCollection, err error) {
req, err := client.GetGetTopLevelDomainsPreparer()
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetGetTopLevelDomains", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetGetTopLevelDomains", nil, "Failure preparing request")
}
resp, err := client.GetGetTopLevelDomainsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetGetTopLevelDomains", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetGetTopLevelDomains", resp, "Failure sending request")
}
result, err = client.GetGetTopLevelDomainsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetGetTopLevelDomains", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetGetTopLevelDomains", resp, "Failure responding to request")
}
return
@@ -72,26 +72,25 @@
// GetGetTopLevelDomainsPreparer prepares the GetGetTopLevelDomains request.
func (client TopLevelDomainsClient) GetGetTopLevelDomainsPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetGetTopLevelDomainsSender sends the GetGetTopLevelDomains request. The method will close the
// http.Response Body if it receives an error.
func (client TopLevelDomainsClient) GetGetTopLevelDomainsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetGetTopLevelDomainsResponder handles the response to the GetGetTopLevelDomains request. The method always
@@ -100,7 +99,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -110,21 +109,21 @@
// GetTopLevelDomain sends the get top level domain request.
//
// name is name of the top level domain
-func (client TopLevelDomainsClient) GetTopLevelDomain(name string) (result TopLevelDomain, ae error) {
+func (client TopLevelDomainsClient) GetTopLevelDomain(name string) (result TopLevelDomain, err error) {
req, err := client.GetTopLevelDomainPreparer(name)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetTopLevelDomain", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetTopLevelDomain", nil, "Failure preparing request")
}
resp, err := client.GetTopLevelDomainSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetTopLevelDomain", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetTopLevelDomain", resp, "Failure sending request")
}
result, err = client.GetTopLevelDomainResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "GetTopLevelDomain", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "GetTopLevelDomain", resp, "Failure responding to request")
}
return
@@ -133,27 +132,26 @@
// GetTopLevelDomainPreparer prepares the GetTopLevelDomain request.
func (client TopLevelDomainsClient) GetTopLevelDomainPreparer(name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetTopLevelDomainSender sends the GetTopLevelDomain request. The method will close the
// http.Response Body if it receives an error.
func (client TopLevelDomainsClient) GetTopLevelDomainSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetTopLevelDomainResponder handles the response to the GetTopLevelDomain request. The method always
@@ -162,7 +160,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@@ -174,21 +172,21 @@
//
// name is name of the top level domain agreementOption is domain agreement
// options
-func (client TopLevelDomainsClient) ListTopLevelDomainAgreements(name string, agreementOption TopLevelDomainAgreementOption) (result TldLegalAgreementCollection, ae error) {
+func (client TopLevelDomainsClient) ListTopLevelDomainAgreements(name string, agreementOption TopLevelDomainAgreementOption) (result TldLegalAgreementCollection, err error) {
req, err := client.ListTopLevelDomainAgreementsPreparer(name, agreementOption)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "ListTopLevelDomainAgreements", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListTopLevelDomainAgreements", nil, "Failure preparing request")
}
resp, err := client.ListTopLevelDomainAgreementsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "ListTopLevelDomainAgreements", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListTopLevelDomainAgreements", resp, "Failure sending request")
}
result, err = client.ListTopLevelDomainAgreementsResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/TopLevelDomainsClient", "ListTopLevelDomainAgreements", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListTopLevelDomainAgreements", resp, "Failure responding to request")
}
return
@@ -197,28 +195,28 @@
// ListTopLevelDomainAgreementsPreparer prepares the ListTopLevelDomainAgreements request.
func (client TopLevelDomainsClient) ListTopLevelDomainAgreementsPreparer(name string, agreementOption TopLevelDomainAgreementOption) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "name": url.QueryEscape(name),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "name": autorest.Encode("path", name),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
+ "api-version": client.APIVersion,
}
- return autorest.Prepare(&http.Request{},
+ preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements"),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements", pathParameters),
autorest.WithJSON(agreementOption),
- autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// ListTopLevelDomainAgreementsSender sends the ListTopLevelDomainAgreements request. The method will close the
// http.Response Body if it receives an error.
func (client TopLevelDomainsClient) ListTopLevelDomainAgreementsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// ListTopLevelDomainAgreementsResponder handles the response to the ListTopLevelDomainAgreements request. The method always
@@ -227,7 +225,7 @@
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/usageoperations.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/usageoperations.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/usageoperations.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/usageoperations.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,14 +14,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
- "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
"net/http"
- "net/url"
)
// UsageOperationsClient is the use these APIs to manage Azure Websites
@@ -53,62 +53,61 @@
// resourceGroupName is name of resource group environmentName is environment
// name lastID is last marker that was returned from the batch batchSize is
// size of the batch to be returned.
-func (client UsageOperationsClient) GetUsage(resourceGroupName string, environmentName string, lastID string, batchSize int) (result ObjectSet, ae error) {
+func (client UsageOperationsClient) GetUsage(resourceGroupName string, environmentName string, lastID string, batchSize int32) (result SetObject, err error) {
req, err := client.GetUsagePreparer(resourceGroupName, environmentName, lastID, batchSize)
if err != nil {
- return result, autorest.NewErrorWithError(err, "web/UsageOperationsClient", "GetUsage", "Failure preparing request")
+ return result, autorest.NewErrorWithError(err, "web.UsageOperationsClient", "GetUsage", nil, "Failure preparing request")
}
resp, err := client.GetUsageSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "web/UsageOperationsClient", "GetUsage", "Failure sending request")
+ return result, autorest.NewErrorWithError(err, "web.UsageOperationsClient", "GetUsage", resp, "Failure sending request")
}
result, err = client.GetUsageResponder(resp)
if err != nil {
- ae = autorest.NewErrorWithError(err, "web/UsageOperationsClient", "GetUsage", "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "web.UsageOperationsClient", "GetUsage", resp, "Failure responding to request")
}
return
}
// GetUsagePreparer prepares the GetUsage request.
-func (client UsageOperationsClient) GetUsagePreparer(resourceGroupName string, environmentName string, lastID string, batchSize int) (*http.Request, error) {
+func (client UsageOperationsClient) GetUsagePreparer(resourceGroupName string, environmentName string, lastID string, batchSize int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "environmentName": url.QueryEscape(environmentName),
- "resourceGroupName": url.QueryEscape(resourceGroupName),
- "subscriptionId": url.QueryEscape(client.SubscriptionID),
+ "environmentName": autorest.Encode("path", environmentName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "batchSize": batchSize,
- "lastId": lastID,
+ "api-version": client.APIVersion,
+ "batchSize": autorest.Encode("query", batchSize),
+ "lastId": autorest.Encode("query", lastID),
}
- return autorest.Prepare(&http.Request{},
- autorest.AsJSON(),
+ preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web.Admin/environments/{environmentName}/usage"),
- autorest.WithPathParameters(pathParameters),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web.Admin/environments/{environmentName}/usage", pathParameters),
autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare(&http.Request{})
}
// GetUsageSender sends the GetUsage request. The method will close the
// http.Response Body if it receives an error.
func (client UsageOperationsClient) GetUsageSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, http.StatusOK)
+ return autorest.SendWithSender(client, req)
}
// GetUsageResponder handles the response to the GetUsage request. The method always
// closes the http.Response Body.
-func (client UsageOperationsClient) GetUsageResponder(resp *http.Response) (result ObjectSet, err error) {
+func (client UsageOperationsClient) GetUsageResponder(resp *http.Response) (result SetObject, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
- autorest.WithErrorUnlessStatusCode(http.StatusOK),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/version.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/version.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/arm/web/version.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/arm/web/version.go 2016-10-13 14:32:06.000000000 +0000
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
+// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
@@ -23,13 +23,13 @@
)
const (
- major = "0"
- minor = "3"
+ major = "3"
+ minor = "1"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
- userAgentFormat = "Azure-SDK-for-Go/%s;Package arm/%s;API %s"
+ userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/CHANGELOG.md juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/CHANGELOG.md
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/CHANGELOG.md 2016-10-13 14:32:06.000000000 +0000
@@ -0,0 +1,205 @@
+# CHANGELOG
+
+-----
+
+## `v3.1.0-beta`
+
+- Added a new arm/compute/containerservice (2016-03-30) package
+- Reintroduced NewxxClientWithBaseURI method.
+- Uses go-autorest version - v7.0.7.
+
+
+## `v3.0.0-beta`
+
+This release brings the Go SDK ARM packages up-to-date with Azure ARM Swagger files for most
+services. Since the underlying [Swagger files](https://github.com/Azure/azure-rest-api-specs)
+continue to change substantially, the ARM packages are still in *beta* status.
+
+The ARM packages now align with the following API versions (*highlighted* packages are new or
+updated in this release):
+
+| api | version | note |
+|:----------------------------|:--------------------|:----------|
+| arm/authorization | 2015-07-01 | no change |
+| arm/intune | 2015-01-14-preview | no change |
+| arm/notificationhubs | 2014-09-01 | no change |
+| arm/resources/features | 2015-12-01 | no change |
+| arm/resources/subscriptions | 2015-11-01 | no change |
+| arm/web | 2015-08-01 | no change |
+| arm/cdn | 2016-04-02 | updated |
+| arm/compute | 2016-03-30 | updated |
+| arm/dns | 2016-04-01 | updated |
+| arm/logic | 2015-08-01-preview | updated |
+| arm/network | 2016-03-30 | updated |
+| arm/redis | 2016-04-01 | updated |
+| arm/resources/resources | 2016-02-01 | updated |
+| arm/resources/policy | 2015-10-01-preview | updated |
+| arm/resources/locks | 2015-01-01 | updated (resources/authorization earlier)|
+| arm/scheduler | 2016-03-01 | updated |
+| arm/storage | 2016-01-01 | updated |
+| arm/search | 2015-02-28 | updated |
+| arm/batch | 2015-12-01 | new |
+| arm/cognitiveservices | 2016-02-01-preview | new |
+| arm/devtestlabs | 2016-05-15 | new |
+| arm/machinelearning | 2016-05-01-preview | new |
+| arm/powerbiembedded | 2016-01-29 | new |
+| arm/mobileengagement | 2014-12-01 | new |
+| arm/servicebus | 2014-09-01 | new |
+| arm/sql | 2015-05-01 | new |
+| arm/trafficmanager | 2015-11-01 | new |
+
+
+Below are some design changes.
+- Removed Api version from method arguments.
+- Removed New...ClientWithBaseURI() method in all clients. BaseURI value is set in client.go.
+- Uses go-autorest version v7.0.6.
+
+
+## `v2.2.0-beta`
+
+- Uses go-autorest version v7.0.5.
+- Update version of pacakges "jwt-go" and "crypto" in glide.lock.
+
+
+## `v2.1.1-beta`
+
+- arm: Better error messages for long running operation failures (Uses go-autorest version v7.0.4).
+
+
+## `v2.1.0-beta`
+
+- arm: Uses go-autorest v7.0.3 (polling related updates).
+- arm: Cancel channel argument added in long-running calls.
+- storage: Allow caller to provide headers for DeleteBlob methods.
+- storage: Enables connection sharing with http keepalive.
+- storage: Add BlobPrefixes and Delimiter to BlobListResponse
+
+
+## `v2.0.0-beta`
+
+- Uses go-autorest v6.0.0 (Polling and Asynchronous requests related changes).
+
+
+## `v0.5.0-beta`
+
+Updated following packages to new API versions:
+- arm/resources/features 2015-12-01
+- arm/resources/resources 2015-11-01
+- arm/resources/subscriptions 2015-11-01
+
+
+### Changes
+
+ - SDK now uses go-autorest v3.0.0.
+
+
+
+## `v0.4.0-beta`
+
+This release brings the Go SDK ARM packages up-to-date with Azure ARM Swagger files for most
+services. Since the underlying [Swagger files](https://github.com/Azure/azure-rest-api-specs)
+continue to change substantially, the ARM packages are still in *beta* status.
+
+The ARM packages now align with the following API versions (*highlighted* packages are new or
+updated in this release):
+
+- *arm/authorization 2015-07-01*
+- *arm/cdn 2015-06-01*
+- arm/compute 2015-06-15
+- arm/dns 2015-05-04-preview
+- *arm/intune 2015-01-14-preview*
+- arm/logic 2015-02-01-preview
+- *arm/network 2015-06-15*
+- *arm/notificationhubs 2014-09-01*
+- arm/redis 2015-08-01
+- *arm/resources/authorization 2015-01-01*
+- *arm/resources/features 2014-08-01-preview*
+- *arm/resources/resources 2014-04-01-preview*
+- *arm/resources/subscriptions 2014-04-01-preview*
+- *arm/scheduler 2016-01-01*
+- arm/storage 2015-06-15
+- arm/web 2015-08-01
+
+### Changes
+
+- Moved the arm/authorization, arm/features, arm/resources, and arm/subscriptions packages under a new, resources, package (to reflect the corresponding Swagger structure)
+- Added a new arm/authoriation (2015-07-01) package
+- Added a new arm/cdn (2015-06-01) package
+- Added a new arm/intune (2015-01-14-preview) package
+- Udated arm/network (2015-06-01)
+- Added a new arm/notificationhubs (2014-09-01) package
+- Updated arm/scheduler (2016-01-01) package
+
+
+-----
+
+## `v0.3.0-beta`
+
+- Corrected unintentional struct field renaming and client renaming in v0.2.0-beta
+
+-----
+
+## `v0.2.0-beta`
+
+- Added support for DNS, Redis, and Web site services
+- Updated Storage service to API version 2015-06-15
+- Updated Network to include routing table support
+- Address https://github.com/Azure/azure-sdk-for-go/issues/232
+- Address https://github.com/Azure/azure-sdk-for-go/issues/231
+- Address https://github.com/Azure/azure-sdk-for-go/issues/230
+- Address https://github.com/Azure/azure-sdk-for-go/issues/224
+- Address https://github.com/Azure/azure-sdk-for-go/issues/184
+- Address https://github.com/Azure/azure-sdk-for-go/issues/183
+
+------
+
+## `v0.1.1-beta`
+
+- Improves the UserAgent string to disambiguate arm packages from others in the SDK
+- Improves setting the http.Response into generated results (reduces likelihood of a nil reference)
+- Adds gofmt, golint, and govet to Travis CI for the arm packages
+
+##### Fixed Issues
+
+- https://github.com/Azure/azure-sdk-for-go/issues/196
+- https://github.com/Azure/azure-sdk-for-go/issues/213
+
+------
+
+## v0.1.0-beta
+
+This release addresses the issues raised against the alpha release and adds more features. Most
+notably, to address the challenges of encoding JSON
+(see the [comments](https://github.com/Azure/go-autorest#handling-empty-values) in the
+[go-autorest](https://github.com/Azure/go-autorest) package) by using pointers for *all* structure
+fields (with the exception of enumerations). The
+[go-autorest/autorest/to](https://github.com/Azure/go-autorest/tree/master/autorest/to) package
+provides helpers to convert to / from pointers. The examples demonstrate their usage.
+
+Additionally, the packages now align with Go coding standards and pass both `golint` and `govet`.
+Accomplishing this required renaming various fields and parameters (such as changing Url to URL).
+
+##### Changes
+
+- Changed request / response structures to use pointer fields.
+- Changed methods to return `error` instead of `autorest.Error`.
+- Re-divided methods to ease asynchronous requests.
+- Added paged results support.
+- Added a UserAgent string.
+- Added changes necessary to pass golint and govet.
+- Updated README.md with details on asynchronous requests and paging.
+- Saved package dependencies through Godep (for the entire SDK).
+
+##### Fixed Issues:
+
+- https://github.com/Azure/azure-sdk-for-go/issues/205
+- https://github.com/Azure/azure-sdk-for-go/issues/206
+- https://github.com/Azure/azure-sdk-for-go/issues/211
+- https://github.com/Azure/azure-sdk-for-go/issues/212
+
+-----
+
+## v0.1.0-alpha
+
+This release introduces the Azure Resource Manager packages generated from the corresponding
+[Swagger API](http://swagger.io) [definitions](https://github.com/Azure/azure-rest-api-specs).
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,206 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file implements CGI from the perspective of a child
-// process.
-
-package cgi
-
-import (
- "bufio"
- "crypto/tls"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "net/http"
- "net/url"
- "os"
- "strconv"
- "strings"
-)
-
-// Request returns the HTTP request as represented in the current
-// environment. This assumes the current program is being run
-// by a web server in a CGI environment.
-// The returned Request's Body is populated, if applicable.
-func Request() (*http.Request, error) {
- r, err := RequestFromMap(envMap(os.Environ()))
- if err != nil {
- return nil, err
- }
- if r.ContentLength > 0 {
- r.Body = ioutil.NopCloser(io.LimitReader(os.Stdin, r.ContentLength))
- }
- return r, nil
-}
-
-func envMap(env []string) map[string]string {
- m := make(map[string]string)
- for _, kv := range env {
- if idx := strings.Index(kv, "="); idx != -1 {
- m[kv[:idx]] = kv[idx+1:]
- }
- }
- return m
-}
-
-// RequestFromMap creates an http.Request from CGI variables.
-// The returned Request's Body field is not populated.
-func RequestFromMap(params map[string]string) (*http.Request, error) {
- r := new(http.Request)
- r.Method = params["REQUEST_METHOD"]
- if r.Method == "" {
- return nil, errors.New("cgi: no REQUEST_METHOD in environment")
- }
-
- r.Proto = params["SERVER_PROTOCOL"]
- var ok bool
- r.ProtoMajor, r.ProtoMinor, ok = http.ParseHTTPVersion(r.Proto)
- if !ok {
- return nil, errors.New("cgi: invalid SERVER_PROTOCOL version")
- }
-
- r.Close = true
- r.Trailer = http.Header{}
- r.Header = http.Header{}
-
- r.Host = params["HTTP_HOST"]
-
- if lenstr := params["CONTENT_LENGTH"]; lenstr != "" {
- clen, err := strconv.ParseInt(lenstr, 10, 64)
- if err != nil {
- return nil, errors.New("cgi: bad CONTENT_LENGTH in environment: " + lenstr)
- }
- r.ContentLength = clen
- }
-
- if ct := params["CONTENT_TYPE"]; ct != "" {
- r.Header.Set("Content-Type", ct)
- }
-
- // Copy "HTTP_FOO_BAR" variables to "Foo-Bar" Headers
- for k, v := range params {
- if !strings.HasPrefix(k, "HTTP_") || k == "HTTP_HOST" {
- continue
- }
- r.Header.Add(strings.Replace(k[5:], "_", "-", -1), v)
- }
-
- // TODO: cookies. parsing them isn't exported, though.
-
- uriStr := params["REQUEST_URI"]
- if uriStr == "" {
- // Fallback to SCRIPT_NAME, PATH_INFO and QUERY_STRING.
- uriStr = params["SCRIPT_NAME"] + params["PATH_INFO"]
- s := params["QUERY_STRING"]
- if s != "" {
- uriStr += "?" + s
- }
- }
-
- // There's apparently a de-facto standard for this.
- // http://docstore.mik.ua/orelly/linux/cgi/ch03_02.htm#ch03-35636
- if s := params["HTTPS"]; s == "on" || s == "ON" || s == "1" {
- r.TLS = &tls.ConnectionState{HandshakeComplete: true}
- }
-
- if r.Host != "" {
- // Hostname is provided, so we can reasonably construct a URL.
- rawurl := r.Host + uriStr
- if r.TLS == nil {
- rawurl = "http://" + rawurl
- } else {
- rawurl = "https://" + rawurl
- }
- url, err := url.Parse(rawurl)
- if err != nil {
- return nil, errors.New("cgi: failed to parse host and REQUEST_URI into a URL: " + rawurl)
- }
- r.URL = url
- }
- // Fallback logic if we don't have a Host header or the URL
- // failed to parse
- if r.URL == nil {
- url, err := url.Parse(uriStr)
- if err != nil {
- return nil, errors.New("cgi: failed to parse REQUEST_URI into a URL: " + uriStr)
- }
- r.URL = url
- }
-
- // Request.RemoteAddr has its port set by Go's standard http
- // server, so we do here too. We don't have one, though, so we
- // use a dummy one.
- r.RemoteAddr = net.JoinHostPort(params["REMOTE_ADDR"], "0")
-
- return r, nil
-}
-
-// Serve executes the provided Handler on the currently active CGI
-// request, if any. If there's no current CGI environment
-// an error is returned. The provided handler may be nil to use
-// http.DefaultServeMux.
-func Serve(handler http.Handler) error {
- req, err := Request()
- if err != nil {
- return err
- }
- if handler == nil {
- handler = http.DefaultServeMux
- }
- rw := &response{
- req: req,
- header: make(http.Header),
- bufw: bufio.NewWriter(os.Stdout),
- }
- handler.ServeHTTP(rw, req)
- rw.Write(nil) // make sure a response is sent
- if err = rw.bufw.Flush(); err != nil {
- return err
- }
- return nil
-}
-
-type response struct {
- req *http.Request
- header http.Header
- bufw *bufio.Writer
- headerSent bool
-}
-
-func (r *response) Flush() {
- r.bufw.Flush()
-}
-
-func (r *response) Header() http.Header {
- return r.header
-}
-
-func (r *response) Write(p []byte) (n int, err error) {
- if !r.headerSent {
- r.WriteHeader(http.StatusOK)
- }
- return r.bufw.Write(p)
-}
-
-func (r *response) WriteHeader(code int) {
- if r.headerSent {
- // Note: explicitly using Stderr, as Stdout is our HTTP output.
- fmt.Fprintf(os.Stderr, "CGI attempted to write header twice on request for %s", r.req.URL)
- return
- }
- r.headerSent = true
- fmt.Fprintf(r.bufw, "Status: %d %s\r\n", code, http.StatusText(code))
-
- // Set a default Content-Type
- if _, hasType := r.header["Content-Type"]; !hasType {
- r.header.Add("Content-Type", "text/html; charset=utf-8")
- }
-
- r.header.Write(r.bufw)
- r.bufw.WriteString("\r\n")
- r.bufw.Flush()
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/child_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,131 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Tests for CGI (the child process perspective)
-
-package cgi
-
-import (
- "testing"
-)
-
-func TestRequest(t *testing.T) {
- env := map[string]string{
- "SERVER_PROTOCOL": "HTTP/1.1",
- "REQUEST_METHOD": "GET",
- "HTTP_HOST": "example.com",
- "HTTP_REFERER": "elsewhere",
- "HTTP_USER_AGENT": "goclient",
- "HTTP_FOO_BAR": "baz",
- "REQUEST_URI": "/path?a=b",
- "CONTENT_LENGTH": "123",
- "CONTENT_TYPE": "text/xml",
- "REMOTE_ADDR": "5.6.7.8",
- }
- req, err := RequestFromMap(env)
- if err != nil {
- t.Fatalf("RequestFromMap: %v", err)
- }
- if g, e := req.UserAgent(), "goclient"; e != g {
- t.Errorf("expected UserAgent %q; got %q", e, g)
- }
- if g, e := req.Method, "GET"; e != g {
- t.Errorf("expected Method %q; got %q", e, g)
- }
- if g, e := req.Header.Get("Content-Type"), "text/xml"; e != g {
- t.Errorf("expected Content-Type %q; got %q", e, g)
- }
- if g, e := req.ContentLength, int64(123); e != g {
- t.Errorf("expected ContentLength %d; got %d", e, g)
- }
- if g, e := req.Referer(), "elsewhere"; e != g {
- t.Errorf("expected Referer %q; got %q", e, g)
- }
- if req.Header == nil {
- t.Fatalf("unexpected nil Header")
- }
- if g, e := req.Header.Get("Foo-Bar"), "baz"; e != g {
- t.Errorf("expected Foo-Bar %q; got %q", e, g)
- }
- if g, e := req.URL.String(), "http://example.com/path?a=b"; e != g {
- t.Errorf("expected URL %q; got %q", e, g)
- }
- if g, e := req.FormValue("a"), "b"; e != g {
- t.Errorf("expected FormValue(a) %q; got %q", e, g)
- }
- if req.Trailer == nil {
- t.Errorf("unexpected nil Trailer")
- }
- if req.TLS != nil {
- t.Errorf("expected nil TLS")
- }
- if e, g := "5.6.7.8:0", req.RemoteAddr; e != g {
- t.Errorf("RemoteAddr: got %q; want %q", g, e)
- }
-}
-
-func TestRequestWithTLS(t *testing.T) {
- env := map[string]string{
- "SERVER_PROTOCOL": "HTTP/1.1",
- "REQUEST_METHOD": "GET",
- "HTTP_HOST": "example.com",
- "HTTP_REFERER": "elsewhere",
- "REQUEST_URI": "/path?a=b",
- "CONTENT_TYPE": "text/xml",
- "HTTPS": "1",
- "REMOTE_ADDR": "5.6.7.8",
- }
- req, err := RequestFromMap(env)
- if err != nil {
- t.Fatalf("RequestFromMap: %v", err)
- }
- if g, e := req.URL.String(), "https://example.com/path?a=b"; e != g {
- t.Errorf("expected URL %q; got %q", e, g)
- }
- if req.TLS == nil {
- t.Errorf("expected non-nil TLS")
- }
-}
-
-func TestRequestWithoutHost(t *testing.T) {
- env := map[string]string{
- "SERVER_PROTOCOL": "HTTP/1.1",
- "HTTP_HOST": "",
- "REQUEST_METHOD": "GET",
- "REQUEST_URI": "/path?a=b",
- "CONTENT_LENGTH": "123",
- }
- req, err := RequestFromMap(env)
- if err != nil {
- t.Fatalf("RequestFromMap: %v", err)
- }
- if req.URL == nil {
- t.Fatalf("unexpected nil URL")
- }
- if g, e := req.URL.String(), "/path?a=b"; e != g {
- t.Errorf("URL = %q; want %q", g, e)
- }
-}
-
-func TestRequestWithoutRequestURI(t *testing.T) {
- env := map[string]string{
- "SERVER_PROTOCOL": "HTTP/1.1",
- "HTTP_HOST": "example.com",
- "REQUEST_METHOD": "GET",
- "SCRIPT_NAME": "/dir/scriptname",
- "PATH_INFO": "/p1/p2",
- "QUERY_STRING": "a=1&b=2",
- "CONTENT_LENGTH": "123",
- }
- req, err := RequestFromMap(env)
- if err != nil {
- t.Fatalf("RequestFromMap: %v", err)
- }
- if req.URL == nil {
- t.Fatalf("unexpected nil URL")
- }
- if g, e := req.URL.String(), "http://example.com/dir/scriptname/p1/p2?a=1&b=2"; e != g {
- t.Errorf("URL = %q; want %q", g, e)
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,377 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file implements the host side of CGI (being the webserver
-// parent process).
-
-// Package cgi implements CGI (Common Gateway Interface) as specified
-// in RFC 3875.
-//
-// Note that using CGI means starting a new process to handle each
-// request, which is typically less efficient than using a
-// long-running server. This package is intended primarily for
-// compatibility with existing systems.
-package cgi
-
-import (
- "bufio"
- "fmt"
- "io"
- "log"
- "net/http"
- "os"
- "os/exec"
- "path/filepath"
- "regexp"
- "runtime"
- "strconv"
- "strings"
-)
-
-var trailingPort = regexp.MustCompile(`:([0-9]+)$`)
-
-var osDefaultInheritEnv = map[string][]string{
- "darwin": {"DYLD_LIBRARY_PATH"},
- "freebsd": {"LD_LIBRARY_PATH"},
- "hpux": {"LD_LIBRARY_PATH", "SHLIB_PATH"},
- "irix": {"LD_LIBRARY_PATH", "LD_LIBRARYN32_PATH", "LD_LIBRARY64_PATH"},
- "linux": {"LD_LIBRARY_PATH"},
- "openbsd": {"LD_LIBRARY_PATH"},
- "solaris": {"LD_LIBRARY_PATH", "LD_LIBRARY_PATH_32", "LD_LIBRARY_PATH_64"},
- "windows": {"SystemRoot", "COMSPEC", "PATHEXT", "WINDIR"},
-}
-
-// Handler runs an executable in a subprocess with a CGI environment.
-type Handler struct {
- Path string // path to the CGI executable
- Root string // root URI prefix of handler or empty for "/"
-
- // Dir specifies the CGI executable's working directory.
- // If Dir is empty, the base directory of Path is used.
- // If Path has no base directory, the current working
- // directory is used.
- Dir string
-
- Env []string // extra environment variables to set, if any, as "key=value"
- InheritEnv []string // environment variables to inherit from host, as "key"
- Logger *log.Logger // optional log for errors or nil to use log.Print
- Args []string // optional arguments to pass to child process
-
- // PathLocationHandler specifies the root http Handler that
- // should handle internal redirects when the CGI process
- // returns a Location header value starting with a "/", as
- // specified in RFC 3875 § 6.3.2. This will likely be
- // http.DefaultServeMux.
- //
- // If nil, a CGI response with a local URI path is instead sent
- // back to the client and not redirected internally.
- PathLocationHandler http.Handler
-}
-
-// removeLeadingDuplicates remove leading duplicate in environments.
-// It's possible to override environment like following.
-// cgi.Handler{
-// ...
-// Env: []string{"SCRIPT_FILENAME=foo.php"},
-// }
-func removeLeadingDuplicates(env []string) (ret []string) {
- n := len(env)
- for i := 0; i < n; i++ {
- e := env[i]
- s := strings.SplitN(e, "=", 2)[0]
- found := false
- for j := i + 1; j < n; j++ {
- if s == strings.SplitN(env[j], "=", 2)[0] {
- found = true
- break
- }
- }
- if !found {
- ret = append(ret, e)
- }
- }
- return
-}
-
-func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
- root := h.Root
- if root == "" {
- root = "/"
- }
-
- if len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked" {
- rw.WriteHeader(http.StatusBadRequest)
- rw.Write([]byte("Chunked request bodies are not supported by CGI."))
- return
- }
-
- pathInfo := req.URL.Path
- if root != "/" && strings.HasPrefix(pathInfo, root) {
- pathInfo = pathInfo[len(root):]
- }
-
- port := "80"
- if matches := trailingPort.FindStringSubmatch(req.Host); len(matches) != 0 {
- port = matches[1]
- }
-
- env := []string{
- "SERVER_SOFTWARE=go",
- "SERVER_NAME=" + req.Host,
- "SERVER_PROTOCOL=HTTP/1.1",
- "HTTP_HOST=" + req.Host,
- "GATEWAY_INTERFACE=CGI/1.1",
- "REQUEST_METHOD=" + req.Method,
- "QUERY_STRING=" + req.URL.RawQuery,
- "REQUEST_URI=" + req.URL.RequestURI(),
- "PATH_INFO=" + pathInfo,
- "SCRIPT_NAME=" + root,
- "SCRIPT_FILENAME=" + h.Path,
- "REMOTE_ADDR=" + req.RemoteAddr,
- "REMOTE_HOST=" + req.RemoteAddr,
- "SERVER_PORT=" + port,
- }
-
- if req.TLS != nil {
- env = append(env, "HTTPS=on")
- }
-
- for k, v := range req.Header {
- k = strings.Map(upperCaseAndUnderscore, k)
- joinStr := ", "
- if k == "COOKIE" {
- joinStr = "; "
- }
- env = append(env, "HTTP_"+k+"="+strings.Join(v, joinStr))
- }
-
- if req.ContentLength > 0 {
- env = append(env, fmt.Sprintf("CONTENT_LENGTH=%d", req.ContentLength))
- }
- if ctype := req.Header.Get("Content-Type"); ctype != "" {
- env = append(env, "CONTENT_TYPE="+ctype)
- }
-
- if h.Env != nil {
- env = append(env, h.Env...)
- }
-
- envPath := os.Getenv("PATH")
- if envPath == "" {
- envPath = "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
- }
- env = append(env, "PATH="+envPath)
-
- for _, e := range h.InheritEnv {
- if v := os.Getenv(e); v != "" {
- env = append(env, e+"="+v)
- }
- }
-
- for _, e := range osDefaultInheritEnv[runtime.GOOS] {
- if v := os.Getenv(e); v != "" {
- env = append(env, e+"="+v)
- }
- }
-
- env = removeLeadingDuplicates(env)
-
- var cwd, path string
- if h.Dir != "" {
- path = h.Path
- cwd = h.Dir
- } else {
- cwd, path = filepath.Split(h.Path)
- }
- if cwd == "" {
- cwd = "."
- }
-
- internalError := func(err error) {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("CGI error: %v", err)
- }
-
- cmd := &exec.Cmd{
- Path: path,
- Args: append([]string{h.Path}, h.Args...),
- Dir: cwd,
- Env: env,
- Stderr: os.Stderr, // for now
- }
- if req.ContentLength != 0 {
- cmd.Stdin = req.Body
- }
- stdoutRead, err := cmd.StdoutPipe()
- if err != nil {
- internalError(err)
- return
- }
-
- err = cmd.Start()
- if err != nil {
- internalError(err)
- return
- }
- if hook := testHookStartProcess; hook != nil {
- hook(cmd.Process)
- }
- defer cmd.Wait()
- defer stdoutRead.Close()
-
- linebody := bufio.NewReaderSize(stdoutRead, 1024)
- headers := make(http.Header)
- statusCode := 0
- headerLines := 0
- sawBlankLine := false
- for {
- line, isPrefix, err := linebody.ReadLine()
- if isPrefix {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("cgi: long header line from subprocess.")
- return
- }
- if err == io.EOF {
- break
- }
- if err != nil {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("cgi: error reading headers: %v", err)
- return
- }
- if len(line) == 0 {
- sawBlankLine = true
- break
- }
- headerLines++
- parts := strings.SplitN(string(line), ":", 2)
- if len(parts) < 2 {
- h.printf("cgi: bogus header line: %s", string(line))
- continue
- }
- header, val := parts[0], parts[1]
- header = strings.TrimSpace(header)
- val = strings.TrimSpace(val)
- switch {
- case header == "Status":
- if len(val) < 3 {
- h.printf("cgi: bogus status (short): %q", val)
- return
- }
- code, err := strconv.Atoi(val[0:3])
- if err != nil {
- h.printf("cgi: bogus status: %q", val)
- h.printf("cgi: line was %q", line)
- return
- }
- statusCode = code
- default:
- headers.Add(header, val)
- }
- }
- if headerLines == 0 || !sawBlankLine {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("cgi: no headers")
- return
- }
-
- if loc := headers.Get("Location"); loc != "" {
- if strings.HasPrefix(loc, "/") && h.PathLocationHandler != nil {
- h.handleInternalRedirect(rw, req, loc)
- return
- }
- if statusCode == 0 {
- statusCode = http.StatusFound
- }
- }
-
- if statusCode == 0 && headers.Get("Content-Type") == "" {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("cgi: missing required Content-Type in headers")
- return
- }
-
- if statusCode == 0 {
- statusCode = http.StatusOK
- }
-
- // Copy headers to rw's headers, after we've decided not to
- // go into handleInternalRedirect, which won't want its rw
- // headers to have been touched.
- for k, vv := range headers {
- for _, v := range vv {
- rw.Header().Add(k, v)
- }
- }
-
- rw.WriteHeader(statusCode)
-
- _, err = io.Copy(rw, linebody)
- if err != nil {
- h.printf("cgi: copy error: %v", err)
- // And kill the child CGI process so we don't hang on
- // the deferred cmd.Wait above if the error was just
- // the client (rw) going away. If it was a read error
- // (because the child died itself), then the extra
- // kill of an already-dead process is harmless (the PID
- // won't be reused until the Wait above).
- cmd.Process.Kill()
- }
-}
-
-func (h *Handler) printf(format string, v ...interface{}) {
- if h.Logger != nil {
- h.Logger.Printf(format, v...)
- } else {
- log.Printf(format, v...)
- }
-}
-
-func (h *Handler) handleInternalRedirect(rw http.ResponseWriter, req *http.Request, path string) {
- url, err := req.URL.Parse(path)
- if err != nil {
- rw.WriteHeader(http.StatusInternalServerError)
- h.printf("cgi: error resolving local URI path %q: %v", path, err)
- return
- }
- // TODO: RFC 3875 isn't clear if only GET is supported, but it
- // suggests so: "Note that any message-body attached to the
- // request (such as for a POST request) may not be available
- // to the resource that is the target of the redirect." We
- // should do some tests against Apache to see how it handles
- // POST, HEAD, etc. Does the internal redirect get the same
- // method or just GET? What about incoming headers?
- // (e.g. Cookies) Which headers, if any, are copied into the
- // second request?
- newReq := &http.Request{
- Method: "GET",
- URL: url,
- Proto: "HTTP/1.1",
- ProtoMajor: 1,
- ProtoMinor: 1,
- Header: make(http.Header),
- Host: url.Host,
- RemoteAddr: req.RemoteAddr,
- TLS: req.TLS,
- }
- h.PathLocationHandler.ServeHTTP(rw, newReq)
-}
-
-func upperCaseAndUnderscore(r rune) rune {
- switch {
- case r >= 'a' && r <= 'z':
- return r - ('a' - 'A')
- case r == '-':
- return '_'
- case r == '=':
- // Maybe not part of the CGI 'spec' but would mess up
- // the environment in any case, as Go represents the
- // environment as a slice of "key=value" strings.
- return '_'
- }
- // TODO: other transformations in spec or practice?
- return r
-}
-
-var testHookStartProcess func(*os.Process) // nil except for some tests
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/host_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,461 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Tests for package cgi
-
-package cgi
-
-import (
- "bufio"
- "fmt"
- "io"
- "net"
- "net/http"
- "net/http/httptest"
- "os"
- "os/exec"
- "path/filepath"
- "runtime"
- "strconv"
- "strings"
- "testing"
- "time"
-)
-
-func newRequest(httpreq string) *http.Request {
- buf := bufio.NewReader(strings.NewReader(httpreq))
- req, err := http.ReadRequest(buf)
- if err != nil {
- panic("cgi: bogus http request in test: " + httpreq)
- }
- req.RemoteAddr = "1.2.3.4"
- return req
-}
-
-func runCgiTest(t *testing.T, h *Handler, httpreq string, expectedMap map[string]string) *httptest.ResponseRecorder {
- rw := httptest.NewRecorder()
- req := newRequest(httpreq)
- h.ServeHTTP(rw, req)
-
- // Make a map to hold the test map that the CGI returns.
- m := make(map[string]string)
- m["_body"] = rw.Body.String()
- linesRead := 0
-readlines:
- for {
- line, err := rw.Body.ReadString('\n')
- switch {
- case err == io.EOF:
- break readlines
- case err != nil:
- t.Fatalf("unexpected error reading from CGI: %v", err)
- }
- linesRead++
- trimmedLine := strings.TrimRight(line, "\r\n")
- split := strings.SplitN(trimmedLine, "=", 2)
- if len(split) != 2 {
- t.Fatalf("Unexpected %d parts from invalid line number %v: %q; existing map=%v",
- len(split), linesRead, line, m)
- }
- m[split[0]] = split[1]
- }
-
- for key, expected := range expectedMap {
- got := m[key]
- if key == "cwd" {
- // For Windows. golang.org/issue/4645.
- fi1, _ := os.Stat(got)
- fi2, _ := os.Stat(expected)
- if os.SameFile(fi1, fi2) {
- got = expected
- }
- }
- if got != expected {
- t.Errorf("for key %q got %q; expected %q", key, got, expected)
- }
- }
- return rw
-}
-
-var cgiTested, cgiWorks bool
-
-func check(t *testing.T) {
- if !cgiTested {
- cgiTested = true
- cgiWorks = exec.Command("./testdata/test.cgi").Run() == nil
- }
- if !cgiWorks {
- // No Perl on Windows, needed by test.cgi
- // TODO: make the child process be Go, not Perl.
- t.Skip("Skipping test: test.cgi failed.")
- }
-}
-
-func TestCGIBasicGet(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap := map[string]string{
- "test": "Hello CGI",
- "param-a": "b",
- "param-foo": "bar",
- "env-GATEWAY_INTERFACE": "CGI/1.1",
- "env-HTTP_HOST": "example.com",
- "env-PATH_INFO": "",
- "env-QUERY_STRING": "foo=bar&a=b",
- "env-REMOTE_ADDR": "1.2.3.4",
- "env-REMOTE_HOST": "1.2.3.4",
- "env-REQUEST_METHOD": "GET",
- "env-REQUEST_URI": "/test.cgi?foo=bar&a=b",
- "env-SCRIPT_FILENAME": "testdata/test.cgi",
- "env-SCRIPT_NAME": "/test.cgi",
- "env-SERVER_NAME": "example.com",
- "env-SERVER_PORT": "80",
- "env-SERVER_SOFTWARE": "go",
- }
- replay := runCgiTest(t, h, "GET /test.cgi?foo=bar&a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-
- if expected, got := "text/html", replay.Header().Get("Content-Type"); got != expected {
- t.Errorf("got a Content-Type of %q; expected %q", got, expected)
- }
- if expected, got := "X-Test-Value", replay.Header().Get("X-Test-Header"); got != expected {
- t.Errorf("got a X-Test-Header of %q; expected %q", got, expected)
- }
-}
-
-func TestCGIBasicGetAbsPath(t *testing.T) {
- check(t)
- pwd, err := os.Getwd()
- if err != nil {
- t.Fatalf("getwd error: %v", err)
- }
- h := &Handler{
- Path: pwd + "/testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap := map[string]string{
- "env-REQUEST_URI": "/test.cgi?foo=bar&a=b",
- "env-SCRIPT_FILENAME": pwd + "/testdata/test.cgi",
- "env-SCRIPT_NAME": "/test.cgi",
- }
- runCgiTest(t, h, "GET /test.cgi?foo=bar&a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestPathInfo(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap := map[string]string{
- "param-a": "b",
- "env-PATH_INFO": "/extrapath",
- "env-QUERY_STRING": "a=b",
- "env-REQUEST_URI": "/test.cgi/extrapath?a=b",
- "env-SCRIPT_FILENAME": "testdata/test.cgi",
- "env-SCRIPT_NAME": "/test.cgi",
- }
- runCgiTest(t, h, "GET /test.cgi/extrapath?a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestPathInfoDirRoot(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/myscript/",
- }
- expectedMap := map[string]string{
- "env-PATH_INFO": "bar",
- "env-QUERY_STRING": "a=b",
- "env-REQUEST_URI": "/myscript/bar?a=b",
- "env-SCRIPT_FILENAME": "testdata/test.cgi",
- "env-SCRIPT_NAME": "/myscript/",
- }
- runCgiTest(t, h, "GET /myscript/bar?a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestDupHeaders(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- }
- expectedMap := map[string]string{
- "env-REQUEST_URI": "/myscript/bar?a=b",
- "env-SCRIPT_FILENAME": "testdata/test.cgi",
- "env-HTTP_COOKIE": "nom=NOM; yum=YUM",
- "env-HTTP_X_FOO": "val1, val2",
- }
- runCgiTest(t, h, "GET /myscript/bar?a=b HTTP/1.0\n"+
- "Cookie: nom=NOM\n"+
- "Cookie: yum=YUM\n"+
- "X-Foo: val1\n"+
- "X-Foo: val2\n"+
- "Host: example.com\n\n",
- expectedMap)
-}
-
-func TestPathInfoNoRoot(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "",
- }
- expectedMap := map[string]string{
- "env-PATH_INFO": "/bar",
- "env-QUERY_STRING": "a=b",
- "env-REQUEST_URI": "/bar?a=b",
- "env-SCRIPT_FILENAME": "testdata/test.cgi",
- "env-SCRIPT_NAME": "/",
- }
- runCgiTest(t, h, "GET /bar?a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestCGIBasicPost(t *testing.T) {
- check(t)
- postReq := `POST /test.cgi?a=b HTTP/1.0
-Host: example.com
-Content-Type: application/x-www-form-urlencoded
-Content-Length: 15
-
-postfoo=postbar`
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap := map[string]string{
- "test": "Hello CGI",
- "param-postfoo": "postbar",
- "env-REQUEST_METHOD": "POST",
- "env-CONTENT_LENGTH": "15",
- "env-REQUEST_URI": "/test.cgi?a=b",
- }
- runCgiTest(t, h, postReq, expectedMap)
-}
-
-func chunk(s string) string {
- return fmt.Sprintf("%x\r\n%s\r\n", len(s), s)
-}
-
-// The CGI spec doesn't allow chunked requests.
-func TestCGIPostChunked(t *testing.T) {
- check(t)
- postReq := `POST /test.cgi?a=b HTTP/1.1
-Host: example.com
-Content-Type: application/x-www-form-urlencoded
-Transfer-Encoding: chunked
-
-` + chunk("postfoo") + chunk("=") + chunk("postbar") + chunk("")
-
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap := map[string]string{}
- resp := runCgiTest(t, h, postReq, expectedMap)
- if got, expected := resp.Code, http.StatusBadRequest; got != expected {
- t.Fatalf("Expected %v response code from chunked request body; got %d",
- expected, got)
- }
-}
-
-func TestRedirect(t *testing.T) {
- check(t)
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- rec := runCgiTest(t, h, "GET /test.cgi?loc=http://foo.com/ HTTP/1.0\nHost: example.com\n\n", nil)
- if e, g := 302, rec.Code; e != g {
- t.Errorf("expected status code %d; got %d", e, g)
- }
- if e, g := "http://foo.com/", rec.Header().Get("Location"); e != g {
- t.Errorf("expected Location header of %q; got %q", e, g)
- }
-}
-
-func TestInternalRedirect(t *testing.T) {
- check(t)
- baseHandler := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
- fmt.Fprintf(rw, "basepath=%s\n", req.URL.Path)
- fmt.Fprintf(rw, "remoteaddr=%s\n", req.RemoteAddr)
- })
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- PathLocationHandler: baseHandler,
- }
- expectedMap := map[string]string{
- "basepath": "/foo",
- "remoteaddr": "1.2.3.4",
- }
- runCgiTest(t, h, "GET /test.cgi?loc=/foo HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-// TestCopyError tests that we kill the process if there's an error copying
-// its output. (for example, from the client having gone away)
-func TestCopyError(t *testing.T) {
- check(t)
- if runtime.GOOS == "windows" {
- t.Skipf("skipping test on %q", runtime.GOOS)
- }
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- ts := httptest.NewServer(h)
- defer ts.Close()
-
- conn, err := net.Dial("tcp", ts.Listener.Addr().String())
- if err != nil {
- t.Fatal(err)
- }
- req, _ := http.NewRequest("GET", "http://example.com/test.cgi?bigresponse=1", nil)
- err = req.Write(conn)
- if err != nil {
- t.Fatalf("Write: %v", err)
- }
-
- res, err := http.ReadResponse(bufio.NewReader(conn), req)
- if err != nil {
- t.Fatalf("ReadResponse: %v", err)
- }
-
- pidstr := res.Header.Get("X-CGI-Pid")
- if pidstr == "" {
- t.Fatalf("expected an X-CGI-Pid header in response")
- }
- pid, err := strconv.Atoi(pidstr)
- if err != nil {
- t.Fatalf("invalid X-CGI-Pid value")
- }
-
- var buf [5000]byte
- n, err := io.ReadFull(res.Body, buf[:])
- if err != nil {
- t.Fatalf("ReadFull: %d bytes, %v", n, err)
- }
-
- childRunning := func() bool {
- return isProcessRunning(t, pid)
- }
-
- if !childRunning() {
- t.Fatalf("pre-conn.Close, expected child to be running")
- }
- conn.Close()
-
- tries := 0
- for tries < 25 && childRunning() {
- time.Sleep(50 * time.Millisecond * time.Duration(tries))
- tries++
- }
- if childRunning() {
- t.Fatalf("post-conn.Close, expected child to be gone")
- }
-}
-
-func TestDirUnix(t *testing.T) {
- check(t)
- if runtime.GOOS == "windows" {
- t.Skipf("skipping test on %q", runtime.GOOS)
- }
- cwd, _ := os.Getwd()
- h := &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- Dir: cwd,
- }
- expectedMap := map[string]string{
- "cwd": cwd,
- }
- runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
-
- cwd, _ = os.Getwd()
- cwd = filepath.Join(cwd, "testdata")
- h = &Handler{
- Path: "testdata/test.cgi",
- Root: "/test.cgi",
- }
- expectedMap = map[string]string{
- "cwd": cwd,
- }
- runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestDirWindows(t *testing.T) {
- if runtime.GOOS != "windows" {
- t.Skip("Skipping windows specific test.")
- }
-
- cgifile, _ := filepath.Abs("testdata/test.cgi")
-
- var perl string
- var err error
- perl, err = exec.LookPath("perl")
- if err != nil {
- t.Skip("Skipping test: perl not found.")
- }
- perl, _ = filepath.Abs(perl)
-
- cwd, _ := os.Getwd()
- h := &Handler{
- Path: perl,
- Root: "/test.cgi",
- Dir: cwd,
- Args: []string{cgifile},
- Env: []string{"SCRIPT_FILENAME=" + cgifile},
- }
- expectedMap := map[string]string{
- "cwd": cwd,
- }
- runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
-
- // If not specify Dir on windows, working directory should be
- // base directory of perl.
- cwd, _ = filepath.Split(perl)
- if cwd != "" && cwd[len(cwd)-1] == filepath.Separator {
- cwd = cwd[:len(cwd)-1]
- }
- h = &Handler{
- Path: perl,
- Root: "/test.cgi",
- Args: []string{cgifile},
- Env: []string{"SCRIPT_FILENAME=" + cgifile},
- }
- expectedMap = map[string]string{
- "cwd": cwd,
- }
- runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
-
-func TestEnvOverride(t *testing.T) {
- cgifile, _ := filepath.Abs("testdata/test.cgi")
-
- var perl string
- var err error
- perl, err = exec.LookPath("perl")
- if err != nil {
- t.Skipf("Skipping test: perl not found.")
- }
- perl, _ = filepath.Abs(perl)
-
- cwd, _ := os.Getwd()
- h := &Handler{
- Path: perl,
- Root: "/test.cgi",
- Dir: cwd,
- Args: []string{cgifile},
- Env: []string{
- "SCRIPT_FILENAME=" + cgifile,
- "REQUEST_URI=/foo/bar"},
- }
- expectedMap := map[string]string{
- "cwd": cwd,
- "env-SCRIPT_FILENAME": cgifile,
- "env-REQUEST_URI": "/foo/bar",
- }
- runCgiTest(t, h, "GET /test.cgi HTTP/1.0\nHost: example.com\n\n", expectedMap)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/matryoshka_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/matryoshka_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/matryoshka_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/matryoshka_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,228 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Tests a Go CGI program running under a Go CGI host process.
-// Further, the two programs are the same binary, just checking
-// their environment to figure out what mode to run in.
-
-package cgi
-
-import (
- "bytes"
- "errors"
- "fmt"
- "io"
- "net/http"
- "net/http/httptest"
- "os"
- "runtime"
- "testing"
- "time"
-)
-
-// This test is a CGI host (testing host.go) that runs its own binary
-// as a child process testing the other half of CGI (child.go).
-func TestHostingOurselves(t *testing.T) {
- if runtime.GOOS == "nacl" {
- t.Skip("skipping on nacl")
- }
-
- h := &Handler{
- Path: os.Args[0],
- Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
- }
- expectedMap := map[string]string{
- "test": "Hello CGI-in-CGI",
- "param-a": "b",
- "param-foo": "bar",
- "env-GATEWAY_INTERFACE": "CGI/1.1",
- "env-HTTP_HOST": "example.com",
- "env-PATH_INFO": "",
- "env-QUERY_STRING": "foo=bar&a=b",
- "env-REMOTE_ADDR": "1.2.3.4",
- "env-REMOTE_HOST": "1.2.3.4",
- "env-REQUEST_METHOD": "GET",
- "env-REQUEST_URI": "/test.go?foo=bar&a=b",
- "env-SCRIPT_FILENAME": os.Args[0],
- "env-SCRIPT_NAME": "/test.go",
- "env-SERVER_NAME": "example.com",
- "env-SERVER_PORT": "80",
- "env-SERVER_SOFTWARE": "go",
- }
- replay := runCgiTest(t, h, "GET /test.go?foo=bar&a=b HTTP/1.0\nHost: example.com\n\n", expectedMap)
-
- if expected, got := "text/html; charset=utf-8", replay.Header().Get("Content-Type"); got != expected {
- t.Errorf("got a Content-Type of %q; expected %q", got, expected)
- }
- if expected, got := "X-Test-Value", replay.Header().Get("X-Test-Header"); got != expected {
- t.Errorf("got a X-Test-Header of %q; expected %q", got, expected)
- }
-}
-
-type customWriterRecorder struct {
- w io.Writer
- *httptest.ResponseRecorder
-}
-
-func (r *customWriterRecorder) Write(p []byte) (n int, err error) {
- return r.w.Write(p)
-}
-
-type limitWriter struct {
- w io.Writer
- n int
-}
-
-func (w *limitWriter) Write(p []byte) (n int, err error) {
- if len(p) > w.n {
- p = p[:w.n]
- }
- if len(p) > 0 {
- n, err = w.w.Write(p)
- w.n -= n
- }
- if w.n == 0 {
- err = errors.New("past write limit")
- }
- return
-}
-
-// If there's an error copying the child's output to the parent, test
-// that we kill the child.
-func TestKillChildAfterCopyError(t *testing.T) {
- if runtime.GOOS == "nacl" {
- t.Skip("skipping on nacl")
- }
-
- defer func() { testHookStartProcess = nil }()
- proc := make(chan *os.Process, 1)
- testHookStartProcess = func(p *os.Process) {
- proc <- p
- }
-
- h := &Handler{
- Path: os.Args[0],
- Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
- }
- req, _ := http.NewRequest("GET", "http://example.com/test.cgi?write-forever=1", nil)
- rec := httptest.NewRecorder()
- var out bytes.Buffer
- const writeLen = 50 << 10
- rw := &customWriterRecorder{&limitWriter{&out, writeLen}, rec}
-
- donec := make(chan bool, 1)
- go func() {
- h.ServeHTTP(rw, req)
- donec <- true
- }()
-
- select {
- case <-donec:
- if out.Len() != writeLen || out.Bytes()[0] != 'a' {
- t.Errorf("unexpected output: %q", out.Bytes())
- }
- case <-time.After(5 * time.Second):
- t.Errorf("timeout. ServeHTTP hung and didn't kill the child process?")
- select {
- case p := <-proc:
- p.Kill()
- t.Logf("killed process")
- default:
- t.Logf("didn't kill process")
- }
- }
-}
-
-// Test that a child handler writing only headers works.
-// golang.org/issue/7196
-func TestChildOnlyHeaders(t *testing.T) {
- if runtime.GOOS == "nacl" {
- t.Skip("skipping on nacl")
- }
-
- h := &Handler{
- Path: os.Args[0],
- Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
- }
- expectedMap := map[string]string{
- "_body": "",
- }
- replay := runCgiTest(t, h, "GET /test.go?no-body=1 HTTP/1.0\nHost: example.com\n\n", expectedMap)
- if expected, got := "X-Test-Value", replay.Header().Get("X-Test-Header"); got != expected {
- t.Errorf("got a X-Test-Header of %q; expected %q", got, expected)
- }
-}
-
-// golang.org/issue/7198
-func Test500WithNoHeaders(t *testing.T) { want500Test(t, "/immediate-disconnect") }
-func Test500WithNoContentType(t *testing.T) { want500Test(t, "/no-content-type") }
-func Test500WithEmptyHeaders(t *testing.T) { want500Test(t, "/empty-headers") }
-
-func want500Test(t *testing.T, path string) {
- h := &Handler{
- Path: os.Args[0],
- Root: "/test.go",
- Args: []string{"-test.run=TestBeChildCGIProcess"},
- }
- expectedMap := map[string]string{
- "_body": "",
- }
- replay := runCgiTest(t, h, "GET "+path+" HTTP/1.0\nHost: example.com\n\n", expectedMap)
- if replay.Code != 500 {
- t.Errorf("Got code %d; want 500", replay.Code)
- }
-}
-
-type neverEnding byte
-
-func (b neverEnding) Read(p []byte) (n int, err error) {
- for i := range p {
- p[i] = byte(b)
- }
- return len(p), nil
-}
-
-// Note: not actually a test.
-func TestBeChildCGIProcess(t *testing.T) {
- if os.Getenv("REQUEST_METHOD") == "" {
- // Not in a CGI environment; skipping test.
- return
- }
- switch os.Getenv("REQUEST_URI") {
- case "/immediate-disconnect":
- os.Exit(0)
- case "/no-content-type":
- fmt.Printf("Content-Length: 6\n\nHello\n")
- os.Exit(0)
- case "/empty-headers":
- fmt.Printf("\nHello")
- os.Exit(0)
- }
- Serve(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
- rw.Header().Set("X-Test-Header", "X-Test-Value")
- req.ParseForm()
- if req.FormValue("no-body") == "1" {
- return
- }
- if req.FormValue("write-forever") == "1" {
- io.Copy(rw, neverEnding('a'))
- for {
- time.Sleep(5 * time.Second) // hang forever, until killed
- }
- }
- fmt.Fprintf(rw, "test=Hello CGI-in-CGI\n")
- for k, vv := range req.Form {
- for _, v := range vv {
- fmt.Fprintf(rw, "param-%s=%s\n", k, v)
- }
- }
- for _, kv := range os.Environ() {
- fmt.Fprintf(rw, "env-%s\n", kv)
- }
- }))
- os.Exit(0)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/plan9_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/plan9_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/plan9_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/plan9_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,18 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build plan9
-
-package cgi
-
-import (
- "os"
- "strconv"
- "testing"
-)
-
-func isProcessRunning(t *testing.T, pid int) bool {
- _, err := os.Stat("/proc/" + strconv.Itoa(pid))
- return err == nil
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/posix_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/posix_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/posix_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/posix_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,21 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !plan9
-
-package cgi
-
-import (
- "os"
- "syscall"
- "testing"
-)
-
-func isProcessRunning(t *testing.T, pid int) bool {
- p, err := os.FindProcess(pid)
- if err != nil {
- return false
- }
- return p.Signal(syscall.Signal(0)) == nil
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/testdata/test.cgi juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/testdata/test.cgi
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/testdata/test.cgi 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cgi/testdata/test.cgi 1970-01-01 00:00:00.000000000 +0000
@@ -1,91 +0,0 @@
-#!/usr/bin/perl
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-#
-# Test script run as a child process under cgi_test.go
-
-use strict;
-use Cwd;
-
-binmode STDOUT;
-
-my $q = MiniCGI->new;
-my $params = $q->Vars;
-
-if ($params->{"loc"}) {
- print "Location: $params->{loc}\r\n\r\n";
- exit(0);
-}
-
-print "Content-Type: text/html\r\n";
-print "X-CGI-Pid: $$\r\n";
-print "X-Test-Header: X-Test-Value\r\n";
-print "\r\n";
-
-if ($params->{"bigresponse"}) {
- # 17 MB, for OS X: golang.org/issue/4958
- for (1..(17 * 1024)) {
- print "A" x 1024, "\r\n";
- }
- exit 0;
-}
-
-print "test=Hello CGI\r\n";
-
-foreach my $k (sort keys %$params) {
- print "param-$k=$params->{$k}\r\n";
-}
-
-foreach my $k (sort keys %ENV) {
- my $clean_env = $ENV{$k};
- $clean_env =~ s/[\n\r]//g;
- print "env-$k=$clean_env\r\n";
-}
-
-# NOTE: msys perl returns /c/go/src/... not C:\go\....
-my $dir = getcwd();
-if ($^O eq 'MSWin32' || $^O eq 'msys') {
- if ($dir =~ /^.:/) {
- $dir =~ s!/!\\!g;
- } else {
- my $cmd = $ENV{'COMSPEC'} || 'c:\\windows\\system32\\cmd.exe';
- $cmd =~ s!\\!/!g;
- $dir = `$cmd /c cd`;
- chomp $dir;
- }
-}
-print "cwd=$dir\r\n";
-
-# A minimal version of CGI.pm, for people without the perl-modules
-# package installed. (CGI.pm used to be part of the Perl core, but
-# some distros now bundle perl-base and perl-modules separately...)
-package MiniCGI;
-
-sub new {
- my $class = shift;
- return bless {}, $class;
-}
-
-sub Vars {
- my $self = shift;
- my $pairs;
- if ($ENV{CONTENT_LENGTH}) {
- $pairs = do { local $/; };
- } else {
- $pairs = $ENV{QUERY_STRING};
- }
- my $vars = {};
- foreach my $kv (split(/&/, $pairs)) {
- my ($k, $v) = split(/=/, $kv, 2);
- $vars->{_urldecode($k)} = _urldecode($v);
- }
- return $vars;
-}
-
-sub _urldecode {
- my $v = shift;
- $v =~ tr/+/ /;
- $v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
- return $v;
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,497 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
-package cookiejar
-
-import (
- "errors"
- "fmt"
- "net"
- "net/http"
- "net/url"
- "sort"
- "strings"
- "sync"
- "time"
-)
-
-// PublicSuffixList provides the public suffix of a domain. For example:
-// - the public suffix of "example.com" is "com",
-// - the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and
-// - the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us".
-//
-// Implementations of PublicSuffixList must be safe for concurrent use by
-// multiple goroutines.
-//
-// An implementation that always returns "" is valid and may be useful for
-// testing but it is not secure: it means that the HTTP server for foo.com can
-// set a cookie for bar.com.
-//
-// A public suffix list implementation is in the package
-// code.google.com/p/go.net/publicsuffix.
-type PublicSuffixList interface {
- // PublicSuffix returns the public suffix of domain.
- //
- // TODO: specify which of the caller and callee is responsible for IP
- // addresses, for leading and trailing dots, for case sensitivity, and
- // for IDN/Punycode.
- PublicSuffix(domain string) string
-
- // String returns a description of the source of this public suffix
- // list. The description will typically contain something like a time
- // stamp or version number.
- String() string
-}
-
-// Options are the options for creating a new Jar.
-type Options struct {
- // PublicSuffixList is the public suffix list that determines whether
- // an HTTP server can set a cookie for a domain.
- //
- // A nil value is valid and may be useful for testing but it is not
- // secure: it means that the HTTP server for foo.co.uk can set a cookie
- // for bar.co.uk.
- PublicSuffixList PublicSuffixList
-}
-
-// Jar implements the http.CookieJar interface from the net/http package.
-type Jar struct {
- psList PublicSuffixList
-
- // mu locks the remaining fields.
- mu sync.Mutex
-
- // entries is a set of entries, keyed by their eTLD+1 and subkeyed by
- // their name/domain/path.
- entries map[string]map[string]entry
-
- // nextSeqNum is the next sequence number assigned to a new cookie
- // created SetCookies.
- nextSeqNum uint64
-}
-
-// New returns a new cookie jar. A nil *Options is equivalent to a zero
-// Options.
-func New(o *Options) (*Jar, error) {
- jar := &Jar{
- entries: make(map[string]map[string]entry),
- }
- if o != nil {
- jar.psList = o.PublicSuffixList
- }
- return jar, nil
-}
-
-// entry is the internal representation of a cookie.
-//
-// This struct type is not used outside of this package per se, but the exported
-// fields are those of RFC 6265.
-type entry struct {
- Name string
- Value string
- Domain string
- Path string
- Secure bool
- HttpOnly bool
- Persistent bool
- HostOnly bool
- Expires time.Time
- Creation time.Time
- LastAccess time.Time
-
- // seqNum is a sequence number so that Cookies returns cookies in a
- // deterministic order, even for cookies that have equal Path length and
- // equal Creation time. This simplifies testing.
- seqNum uint64
-}
-
-// Id returns the domain;path;name triple of e as an id.
-func (e *entry) id() string {
- return fmt.Sprintf("%s;%s;%s", e.Domain, e.Path, e.Name)
-}
-
-// shouldSend determines whether e's cookie qualifies to be included in a
-// request to host/path. It is the caller's responsibility to check if the
-// cookie is expired.
-func (e *entry) shouldSend(https bool, host, path string) bool {
- return e.domainMatch(host) && e.pathMatch(path) && (https || !e.Secure)
-}
-
-// domainMatch implements "domain-match" of RFC 6265 section 5.1.3.
-func (e *entry) domainMatch(host string) bool {
- if e.Domain == host {
- return true
- }
- return !e.HostOnly && hasDotSuffix(host, e.Domain)
-}
-
-// pathMatch implements "path-match" according to RFC 6265 section 5.1.4.
-func (e *entry) pathMatch(requestPath string) bool {
- if requestPath == e.Path {
- return true
- }
- if strings.HasPrefix(requestPath, e.Path) {
- if e.Path[len(e.Path)-1] == '/' {
- return true // The "/any/" matches "/any/path" case.
- } else if requestPath[len(e.Path)] == '/' {
- return true // The "/any" matches "/any/path" case.
- }
- }
- return false
-}
-
-// hasDotSuffix reports whether s ends in "."+suffix.
-func hasDotSuffix(s, suffix string) bool {
- return len(s) > len(suffix) && s[len(s)-len(suffix)-1] == '.' && s[len(s)-len(suffix):] == suffix
-}
-
-// byPathLength is a []entry sort.Interface that sorts according to RFC 6265
-// section 5.4 point 2: by longest path and then by earliest creation time.
-type byPathLength []entry
-
-func (s byPathLength) Len() int { return len(s) }
-
-func (s byPathLength) Less(i, j int) bool {
- if len(s[i].Path) != len(s[j].Path) {
- return len(s[i].Path) > len(s[j].Path)
- }
- if !s[i].Creation.Equal(s[j].Creation) {
- return s[i].Creation.Before(s[j].Creation)
- }
- return s[i].seqNum < s[j].seqNum
-}
-
-func (s byPathLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-
-// Cookies implements the Cookies method of the http.CookieJar interface.
-//
-// It returns an empty slice if the URL's scheme is not HTTP or HTTPS.
-func (j *Jar) Cookies(u *url.URL) (cookies []*http.Cookie) {
- return j.cookies(u, time.Now())
-}
-
-// cookies is like Cookies but takes the current time as a parameter.
-func (j *Jar) cookies(u *url.URL, now time.Time) (cookies []*http.Cookie) {
- if u.Scheme != "http" && u.Scheme != "https" {
- return cookies
- }
- host, err := canonicalHost(u.Host)
- if err != nil {
- return cookies
- }
- key := jarKey(host, j.psList)
-
- j.mu.Lock()
- defer j.mu.Unlock()
-
- submap := j.entries[key]
- if submap == nil {
- return cookies
- }
-
- https := u.Scheme == "https"
- path := u.Path
- if path == "" {
- path = "/"
- }
-
- modified := false
- var selected []entry
- for id, e := range submap {
- if e.Persistent && !e.Expires.After(now) {
- delete(submap, id)
- modified = true
- continue
- }
- if !e.shouldSend(https, host, path) {
- continue
- }
- e.LastAccess = now
- submap[id] = e
- selected = append(selected, e)
- modified = true
- }
- if modified {
- if len(submap) == 0 {
- delete(j.entries, key)
- } else {
- j.entries[key] = submap
- }
- }
-
- sort.Sort(byPathLength(selected))
- for _, e := range selected {
- cookies = append(cookies, &http.Cookie{Name: e.Name, Value: e.Value})
- }
-
- return cookies
-}
-
-// SetCookies implements the SetCookies method of the http.CookieJar interface.
-//
-// It does nothing if the URL's scheme is not HTTP or HTTPS.
-func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie) {
- j.setCookies(u, cookies, time.Now())
-}
-
-// setCookies is like SetCookies but takes the current time as parameter.
-func (j *Jar) setCookies(u *url.URL, cookies []*http.Cookie, now time.Time) {
- if len(cookies) == 0 {
- return
- }
- if u.Scheme != "http" && u.Scheme != "https" {
- return
- }
- host, err := canonicalHost(u.Host)
- if err != nil {
- return
- }
- key := jarKey(host, j.psList)
- defPath := defaultPath(u.Path)
-
- j.mu.Lock()
- defer j.mu.Unlock()
-
- submap := j.entries[key]
-
- modified := false
- for _, cookie := range cookies {
- e, remove, err := j.newEntry(cookie, now, defPath, host)
- if err != nil {
- continue
- }
- id := e.id()
- if remove {
- if submap != nil {
- if _, ok := submap[id]; ok {
- delete(submap, id)
- modified = true
- }
- }
- continue
- }
- if submap == nil {
- submap = make(map[string]entry)
- }
-
- if old, ok := submap[id]; ok {
- e.Creation = old.Creation
- e.seqNum = old.seqNum
- } else {
- e.Creation = now
- e.seqNum = j.nextSeqNum
- j.nextSeqNum++
- }
- e.LastAccess = now
- submap[id] = e
- modified = true
- }
-
- if modified {
- if len(submap) == 0 {
- delete(j.entries, key)
- } else {
- j.entries[key] = submap
- }
- }
-}
-
-// canonicalHost strips port from host if present and returns the canonicalized
-// host name.
-func canonicalHost(host string) (string, error) {
- var err error
- host = strings.ToLower(host)
- if hasPort(host) {
- host, _, err = net.SplitHostPort(host)
- if err != nil {
- return "", err
- }
- }
- if strings.HasSuffix(host, ".") {
- // Strip trailing dot from fully qualified domain names.
- host = host[:len(host)-1]
- }
- return toASCII(host)
-}
-
-// hasPort reports whether host contains a port number. host may be a host
-// name, an IPv4 or an IPv6 address.
-func hasPort(host string) bool {
- colons := strings.Count(host, ":")
- if colons == 0 {
- return false
- }
- if colons == 1 {
- return true
- }
- return host[0] == '[' && strings.Contains(host, "]:")
-}
-
-// jarKey returns the key to use for a jar.
-func jarKey(host string, psl PublicSuffixList) string {
- if isIP(host) {
- return host
- }
-
- var i int
- if psl == nil {
- i = strings.LastIndex(host, ".")
- if i == -1 {
- return host
- }
- } else {
- suffix := psl.PublicSuffix(host)
- if suffix == host {
- return host
- }
- i = len(host) - len(suffix)
- if i <= 0 || host[i-1] != '.' {
- // The provided public suffix list psl is broken.
- // Storing cookies under host is a safe stopgap.
- return host
- }
- }
- prevDot := strings.LastIndex(host[:i-1], ".")
- return host[prevDot+1:]
-}
-
-// isIP reports whether host is an IP address.
-func isIP(host string) bool {
- return net.ParseIP(host) != nil
-}
-
-// defaultPath returns the directory part of an URL's path according to
-// RFC 6265 section 5.1.4.
-func defaultPath(path string) string {
- if len(path) == 0 || path[0] != '/' {
- return "/" // Path is empty or malformed.
- }
-
- i := strings.LastIndex(path, "/") // Path starts with "/", so i != -1.
- if i == 0 {
- return "/" // Path has the form "/abc".
- }
- return path[:i] // Path is either of form "/abc/xyz" or "/abc/xyz/".
-}
-
-// newEntry creates an entry from a http.Cookie c. now is the current time and
-// is compared to c.Expires to determine deletion of c. defPath and host are the
-// default-path and the canonical host name of the URL c was received from.
-//
-// remove records whether the jar should delete this cookie, as it has already
-// expired with respect to now. In this case, e may be incomplete, but it will
-// be valid to call e.id (which depends on e's Name, Domain and Path).
-//
-// A malformed c.Domain will result in an error.
-func (j *Jar) newEntry(c *http.Cookie, now time.Time, defPath, host string) (e entry, remove bool, err error) {
- e.Name = c.Name
-
- if c.Path == "" || c.Path[0] != '/' {
- e.Path = defPath
- } else {
- e.Path = c.Path
- }
-
- e.Domain, e.HostOnly, err = j.domainAndType(host, c.Domain)
- if err != nil {
- return e, false, err
- }
-
- // MaxAge takes precedence over Expires.
- if c.MaxAge < 0 {
- return e, true, nil
- } else if c.MaxAge > 0 {
- e.Expires = now.Add(time.Duration(c.MaxAge) * time.Second)
- e.Persistent = true
- } else {
- if c.Expires.IsZero() {
- e.Expires = endOfTime
- e.Persistent = false
- } else {
- if !c.Expires.After(now) {
- return e, true, nil
- }
- e.Expires = c.Expires
- e.Persistent = true
- }
- }
-
- e.Value = c.Value
- e.Secure = c.Secure
- e.HttpOnly = c.HttpOnly
-
- return e, false, nil
-}
-
-var (
- errIllegalDomain = errors.New("cookiejar: illegal cookie domain attribute")
- errMalformedDomain = errors.New("cookiejar: malformed cookie domain attribute")
- errNoHostname = errors.New("cookiejar: no host name available (IP only)")
-)
-
-// endOfTime is the time when session (non-persistent) cookies expire.
-// This instant is representable in most date/time formats (not just
-// Go's time.Time) and should be far enough in the future.
-var endOfTime = time.Date(9999, 12, 31, 23, 59, 59, 0, time.UTC)
-
-// domainAndType determines the cookie's domain and hostOnly attribute.
-func (j *Jar) domainAndType(host, domain string) (string, bool, error) {
- if domain == "" {
- // No domain attribute in the SetCookie header indicates a
- // host cookie.
- return host, true, nil
- }
-
- if isIP(host) {
- // According to RFC 6265 domain-matching includes not being
- // an IP address.
- // TODO: This might be relaxed as in common browsers.
- return "", false, errNoHostname
- }
-
- // From here on: If the cookie is valid, it is a domain cookie (with
- // the one exception of a public suffix below).
- // See RFC 6265 section 5.2.3.
- if domain[0] == '.' {
- domain = domain[1:]
- }
-
- if len(domain) == 0 || domain[0] == '.' {
- // Received either "Domain=." or "Domain=..some.thing",
- // both are illegal.
- return "", false, errMalformedDomain
- }
- domain = strings.ToLower(domain)
-
- if domain[len(domain)-1] == '.' {
- // We received stuff like "Domain=www.example.com.".
- // Browsers do handle such stuff (actually differently) but
- // RFC 6265 seems to be clear here (e.g. section 4.1.2.3) in
- // requiring a reject. 4.1.2.3 is not normative, but
- // "Domain Matching" (5.1.3) and "Canonicalized Host Names"
- // (5.1.2) are.
- return "", false, errMalformedDomain
- }
-
- // See RFC 6265 section 5.3 #5.
- if j.psList != nil {
- if ps := j.psList.PublicSuffix(domain); ps != "" && !hasDotSuffix(domain, ps) {
- if host == domain {
- // This is the one exception in which a cookie
- // with a domain attribute is a host cookie.
- return host, true, nil
- }
- return "", false, errIllegalDomain
- }
- }
-
- // The domain must domain-match host: www.mycompany.com cannot
- // set cookies for .ourcompetitors.com.
- if host != domain && !hasDotSuffix(host, domain) {
- return "", false, errIllegalDomain
- }
-
- return domain, false, nil
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/jar_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,1267 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package cookiejar
-
-import (
- "fmt"
- "net/http"
- "net/url"
- "sort"
- "strings"
- "testing"
- "time"
-)
-
-// tNow is the synthetic current time used as now during testing.
-var tNow = time.Date(2013, 1, 1, 12, 0, 0, 0, time.UTC)
-
-// testPSL implements PublicSuffixList with just two rules: "co.uk"
-// and the default rule "*".
-type testPSL struct{}
-
-func (testPSL) String() string {
- return "testPSL"
-}
-func (testPSL) PublicSuffix(d string) string {
- if d == "co.uk" || strings.HasSuffix(d, ".co.uk") {
- return "co.uk"
- }
- return d[strings.LastIndex(d, ".")+1:]
-}
-
-// newTestJar creates an empty Jar with testPSL as the public suffix list.
-func newTestJar() *Jar {
- jar, err := New(&Options{PublicSuffixList: testPSL{}})
- if err != nil {
- panic(err)
- }
- return jar
-}
-
-var hasDotSuffixTests = [...]struct {
- s, suffix string
-}{
- {"", ""},
- {"", "."},
- {"", "x"},
- {".", ""},
- {".", "."},
- {".", ".."},
- {".", "x"},
- {".", "x."},
- {".", ".x"},
- {".", ".x."},
- {"x", ""},
- {"x", "."},
- {"x", ".."},
- {"x", "x"},
- {"x", "x."},
- {"x", ".x"},
- {"x", ".x."},
- {".x", ""},
- {".x", "."},
- {".x", ".."},
- {".x", "x"},
- {".x", "x."},
- {".x", ".x"},
- {".x", ".x."},
- {"x.", ""},
- {"x.", "."},
- {"x.", ".."},
- {"x.", "x"},
- {"x.", "x."},
- {"x.", ".x"},
- {"x.", ".x."},
- {"com", ""},
- {"com", "m"},
- {"com", "om"},
- {"com", "com"},
- {"com", ".com"},
- {"com", "x.com"},
- {"com", "xcom"},
- {"com", "xorg"},
- {"com", "org"},
- {"com", "rg"},
- {"foo.com", ""},
- {"foo.com", "m"},
- {"foo.com", "om"},
- {"foo.com", "com"},
- {"foo.com", ".com"},
- {"foo.com", "o.com"},
- {"foo.com", "oo.com"},
- {"foo.com", "foo.com"},
- {"foo.com", ".foo.com"},
- {"foo.com", "x.foo.com"},
- {"foo.com", "xfoo.com"},
- {"foo.com", "xfoo.org"},
- {"foo.com", "foo.org"},
- {"foo.com", "oo.org"},
- {"foo.com", "o.org"},
- {"foo.com", ".org"},
- {"foo.com", "org"},
- {"foo.com", "rg"},
-}
-
-func TestHasDotSuffix(t *testing.T) {
- for _, tc := range hasDotSuffixTests {
- got := hasDotSuffix(tc.s, tc.suffix)
- want := strings.HasSuffix(tc.s, "."+tc.suffix)
- if got != want {
- t.Errorf("s=%q, suffix=%q: got %v, want %v", tc.s, tc.suffix, got, want)
- }
- }
-}
-
-var canonicalHostTests = map[string]string{
- "www.example.com": "www.example.com",
- "WWW.EXAMPLE.COM": "www.example.com",
- "wWw.eXAmple.CoM": "www.example.com",
- "www.example.com:80": "www.example.com",
- "192.168.0.10": "192.168.0.10",
- "192.168.0.5:8080": "192.168.0.5",
- "2001:4860:0:2001::68": "2001:4860:0:2001::68",
- "[2001:4860:0:::68]:8080": "2001:4860:0:::68",
- "www.bücher.de": "www.xn--bcher-kva.de",
- "www.example.com.": "www.example.com",
- "[bad.unmatched.bracket:": "error",
-}
-
-func TestCanonicalHost(t *testing.T) {
- for h, want := range canonicalHostTests {
- got, err := canonicalHost(h)
- if want == "error" {
- if err == nil {
- t.Errorf("%q: got nil error, want non-nil", h)
- }
- continue
- }
- if err != nil {
- t.Errorf("%q: %v", h, err)
- continue
- }
- if got != want {
- t.Errorf("%q: got %q, want %q", h, got, want)
- continue
- }
- }
-}
-
-var hasPortTests = map[string]bool{
- "www.example.com": false,
- "www.example.com:80": true,
- "127.0.0.1": false,
- "127.0.0.1:8080": true,
- "2001:4860:0:2001::68": false,
- "[2001::0:::68]:80": true,
-}
-
-func TestHasPort(t *testing.T) {
- for host, want := range hasPortTests {
- if got := hasPort(host); got != want {
- t.Errorf("%q: got %t, want %t", host, got, want)
- }
- }
-}
-
-var jarKeyTests = map[string]string{
- "foo.www.example.com": "example.com",
- "www.example.com": "example.com",
- "example.com": "example.com",
- "com": "com",
- "foo.www.bbc.co.uk": "bbc.co.uk",
- "www.bbc.co.uk": "bbc.co.uk",
- "bbc.co.uk": "bbc.co.uk",
- "co.uk": "co.uk",
- "uk": "uk",
- "192.168.0.5": "192.168.0.5",
-}
-
-func TestJarKey(t *testing.T) {
- for host, want := range jarKeyTests {
- if got := jarKey(host, testPSL{}); got != want {
- t.Errorf("%q: got %q, want %q", host, got, want)
- }
- }
-}
-
-var jarKeyNilPSLTests = map[string]string{
- "foo.www.example.com": "example.com",
- "www.example.com": "example.com",
- "example.com": "example.com",
- "com": "com",
- "foo.www.bbc.co.uk": "co.uk",
- "www.bbc.co.uk": "co.uk",
- "bbc.co.uk": "co.uk",
- "co.uk": "co.uk",
- "uk": "uk",
- "192.168.0.5": "192.168.0.5",
-}
-
-func TestJarKeyNilPSL(t *testing.T) {
- for host, want := range jarKeyNilPSLTests {
- if got := jarKey(host, nil); got != want {
- t.Errorf("%q: got %q, want %q", host, got, want)
- }
- }
-}
-
-var isIPTests = map[string]bool{
- "127.0.0.1": true,
- "1.2.3.4": true,
- "2001:4860:0:2001::68": true,
- "example.com": false,
- "1.1.1.300": false,
- "www.foo.bar.net": false,
- "123.foo.bar.net": false,
-}
-
-func TestIsIP(t *testing.T) {
- for host, want := range isIPTests {
- if got := isIP(host); got != want {
- t.Errorf("%q: got %t, want %t", host, got, want)
- }
- }
-}
-
-var defaultPathTests = map[string]string{
- "/": "/",
- "/abc": "/",
- "/abc/": "/abc",
- "/abc/xyz": "/abc",
- "/abc/xyz/": "/abc/xyz",
- "/a/b/c.html": "/a/b",
- "": "/",
- "strange": "/",
- "//": "/",
- "/a//b": "/a/",
- "/a/./b": "/a/.",
- "/a/../b": "/a/..",
-}
-
-func TestDefaultPath(t *testing.T) {
- for path, want := range defaultPathTests {
- if got := defaultPath(path); got != want {
- t.Errorf("%q: got %q, want %q", path, got, want)
- }
- }
-}
-
-var domainAndTypeTests = [...]struct {
- host string // host Set-Cookie header was received from
- domain string // domain attribute in Set-Cookie header
- wantDomain string // expected domain of cookie
- wantHostOnly bool // expected host-cookie flag
- wantErr error // expected error
-}{
- {"www.example.com", "", "www.example.com", true, nil},
- {"127.0.0.1", "", "127.0.0.1", true, nil},
- {"2001:4860:0:2001::68", "", "2001:4860:0:2001::68", true, nil},
- {"www.example.com", "example.com", "example.com", false, nil},
- {"www.example.com", ".example.com", "example.com", false, nil},
- {"www.example.com", "www.example.com", "www.example.com", false, nil},
- {"www.example.com", ".www.example.com", "www.example.com", false, nil},
- {"foo.sso.example.com", "sso.example.com", "sso.example.com", false, nil},
- {"bar.co.uk", "bar.co.uk", "bar.co.uk", false, nil},
- {"foo.bar.co.uk", ".bar.co.uk", "bar.co.uk", false, nil},
- {"127.0.0.1", "127.0.0.1", "", false, errNoHostname},
- {"2001:4860:0:2001::68", "2001:4860:0:2001::68", "2001:4860:0:2001::68", false, errNoHostname},
- {"www.example.com", ".", "", false, errMalformedDomain},
- {"www.example.com", "..", "", false, errMalformedDomain},
- {"www.example.com", "other.com", "", false, errIllegalDomain},
- {"www.example.com", "com", "", false, errIllegalDomain},
- {"www.example.com", ".com", "", false, errIllegalDomain},
- {"foo.bar.co.uk", ".co.uk", "", false, errIllegalDomain},
- {"127.www.0.0.1", "127.0.0.1", "", false, errIllegalDomain},
- {"com", "", "com", true, nil},
- {"com", "com", "com", true, nil},
- {"com", ".com", "com", true, nil},
- {"co.uk", "", "co.uk", true, nil},
- {"co.uk", "co.uk", "co.uk", true, nil},
- {"co.uk", ".co.uk", "co.uk", true, nil},
-}
-
-func TestDomainAndType(t *testing.T) {
- jar := newTestJar()
- for _, tc := range domainAndTypeTests {
- domain, hostOnly, err := jar.domainAndType(tc.host, tc.domain)
- if err != tc.wantErr {
- t.Errorf("%q/%q: got %q error, want %q",
- tc.host, tc.domain, err, tc.wantErr)
- continue
- }
- if err != nil {
- continue
- }
- if domain != tc.wantDomain || hostOnly != tc.wantHostOnly {
- t.Errorf("%q/%q: got %q/%t want %q/%t",
- tc.host, tc.domain, domain, hostOnly,
- tc.wantDomain, tc.wantHostOnly)
- }
- }
-}
-
-// expiresIn creates an expires attribute delta seconds from tNow.
-func expiresIn(delta int) string {
- t := tNow.Add(time.Duration(delta) * time.Second)
- return "expires=" + t.Format(time.RFC1123)
-}
-
-// mustParseURL parses s to an URL and panics on error.
-func mustParseURL(s string) *url.URL {
- u, err := url.Parse(s)
- if err != nil || u.Scheme == "" || u.Host == "" {
- panic(fmt.Sprintf("Unable to parse URL %s.", s))
- }
- return u
-}
-
-// jarTest encapsulates the following actions on a jar:
-// 1. Perform SetCookies with fromURL and the cookies from setCookies.
-// (Done at time tNow + 0 ms.)
-// 2. Check that the entries in the jar matches content.
-// (Done at time tNow + 1001 ms.)
-// 3. For each query in tests: Check that Cookies with toURL yields the
-// cookies in want.
-// (Query n done at tNow + (n+2)*1001 ms.)
-type jarTest struct {
- description string // The description of what this test is supposed to test
- fromURL string // The full URL of the request from which Set-Cookie headers where received
- setCookies []string // All the cookies received from fromURL
- content string // The whole (non-expired) content of the jar
- queries []query // Queries to test the Jar.Cookies method
-}
-
-// query contains one test of the cookies returned from Jar.Cookies.
-type query struct {
- toURL string // the URL in the Cookies call
- want string // the expected list of cookies (order matters)
-}
-
-// run runs the jarTest.
-func (test jarTest) run(t *testing.T, jar *Jar) {
- now := tNow
-
- // Populate jar with cookies.
- setCookies := make([]*http.Cookie, len(test.setCookies))
- for i, cs := range test.setCookies {
- cookies := (&http.Response{Header: http.Header{"Set-Cookie": {cs}}}).Cookies()
- if len(cookies) != 1 {
- panic(fmt.Sprintf("Wrong cookie line %q: %#v", cs, cookies))
- }
- setCookies[i] = cookies[0]
- }
- jar.setCookies(mustParseURL(test.fromURL), setCookies, now)
- now = now.Add(1001 * time.Millisecond)
-
- // Serialize non-expired entries in the form "name1=val1 name2=val2".
- var cs []string
- for _, submap := range jar.entries {
- for _, cookie := range submap {
- if !cookie.Expires.After(now) {
- continue
- }
- cs = append(cs, cookie.Name+"="+cookie.Value)
- }
- }
- sort.Strings(cs)
- got := strings.Join(cs, " ")
-
- // Make sure jar content matches our expectations.
- if got != test.content {
- t.Errorf("Test %q Content\ngot %q\nwant %q",
- test.description, got, test.content)
- }
-
- // Test different calls to Cookies.
- for i, query := range test.queries {
- now = now.Add(1001 * time.Millisecond)
- var s []string
- for _, c := range jar.cookies(mustParseURL(query.toURL), now) {
- s = append(s, c.Name+"="+c.Value)
- }
- if got := strings.Join(s, " "); got != query.want {
- t.Errorf("Test %q #%d\ngot %q\nwant %q", test.description, i, got, query.want)
- }
- }
-}
-
-// basicsTests contains fundamental tests. Each jarTest has to be performed on
-// a fresh, empty Jar.
-var basicsTests = [...]jarTest{
- {
- "Retrieval of a plain host cookie.",
- "http://www.host.test/",
- []string{"A=a"},
- "A=a",
- []query{
- {"http://www.host.test", "A=a"},
- {"http://www.host.test/", "A=a"},
- {"http://www.host.test/some/path", "A=a"},
- {"https://www.host.test", "A=a"},
- {"https://www.host.test/", "A=a"},
- {"https://www.host.test/some/path", "A=a"},
- {"ftp://www.host.test", ""},
- {"ftp://www.host.test/", ""},
- {"ftp://www.host.test/some/path", ""},
- {"http://www.other.org", ""},
- {"http://sibling.host.test", ""},
- {"http://deep.www.host.test", ""},
- },
- },
- {
- "Secure cookies are not returned to http.",
- "http://www.host.test/",
- []string{"A=a; secure"},
- "A=a",
- []query{
- {"http://www.host.test", ""},
- {"http://www.host.test/", ""},
- {"http://www.host.test/some/path", ""},
- {"https://www.host.test", "A=a"},
- {"https://www.host.test/", "A=a"},
- {"https://www.host.test/some/path", "A=a"},
- },
- },
- {
- "Explicit path.",
- "http://www.host.test/",
- []string{"A=a; path=/some/path"},
- "A=a",
- []query{
- {"http://www.host.test", ""},
- {"http://www.host.test/", ""},
- {"http://www.host.test/some", ""},
- {"http://www.host.test/some/", ""},
- {"http://www.host.test/some/path", "A=a"},
- {"http://www.host.test/some/paths", ""},
- {"http://www.host.test/some/path/foo", "A=a"},
- {"http://www.host.test/some/path/foo/", "A=a"},
- },
- },
- {
- "Implicit path #1: path is a directory.",
- "http://www.host.test/some/path/",
- []string{"A=a"},
- "A=a",
- []query{
- {"http://www.host.test", ""},
- {"http://www.host.test/", ""},
- {"http://www.host.test/some", ""},
- {"http://www.host.test/some/", ""},
- {"http://www.host.test/some/path", "A=a"},
- {"http://www.host.test/some/paths", ""},
- {"http://www.host.test/some/path/foo", "A=a"},
- {"http://www.host.test/some/path/foo/", "A=a"},
- },
- },
- {
- "Implicit path #2: path is not a directory.",
- "http://www.host.test/some/path/index.html",
- []string{"A=a"},
- "A=a",
- []query{
- {"http://www.host.test", ""},
- {"http://www.host.test/", ""},
- {"http://www.host.test/some", ""},
- {"http://www.host.test/some/", ""},
- {"http://www.host.test/some/path", "A=a"},
- {"http://www.host.test/some/paths", ""},
- {"http://www.host.test/some/path/foo", "A=a"},
- {"http://www.host.test/some/path/foo/", "A=a"},
- },
- },
- {
- "Implicit path #3: no path in URL at all.",
- "http://www.host.test",
- []string{"A=a"},
- "A=a",
- []query{
- {"http://www.host.test", "A=a"},
- {"http://www.host.test/", "A=a"},
- {"http://www.host.test/some/path", "A=a"},
- },
- },
- {
- "Cookies are sorted by path length.",
- "http://www.host.test/",
- []string{
- "A=a; path=/foo/bar",
- "B=b; path=/foo/bar/baz/qux",
- "C=c; path=/foo/bar/baz",
- "D=d; path=/foo"},
- "A=a B=b C=c D=d",
- []query{
- {"http://www.host.test/foo/bar/baz/qux", "B=b C=c A=a D=d"},
- {"http://www.host.test/foo/bar/baz/", "C=c A=a D=d"},
- {"http://www.host.test/foo/bar", "A=a D=d"},
- },
- },
- {
- "Creation time determines sorting on same length paths.",
- "http://www.host.test/",
- []string{
- "A=a; path=/foo/bar",
- "X=x; path=/foo/bar",
- "Y=y; path=/foo/bar/baz/qux",
- "B=b; path=/foo/bar/baz/qux",
- "C=c; path=/foo/bar/baz",
- "W=w; path=/foo/bar/baz",
- "Z=z; path=/foo",
- "D=d; path=/foo"},
- "A=a B=b C=c D=d W=w X=x Y=y Z=z",
- []query{
- {"http://www.host.test/foo/bar/baz/qux", "Y=y B=b C=c W=w A=a X=x Z=z D=d"},
- {"http://www.host.test/foo/bar/baz/", "C=c W=w A=a X=x Z=z D=d"},
- {"http://www.host.test/foo/bar", "A=a X=x Z=z D=d"},
- },
- },
- {
- "Sorting of same-name cookies.",
- "http://www.host.test/",
- []string{
- "A=1; path=/",
- "A=2; path=/path",
- "A=3; path=/quux",
- "A=4; path=/path/foo",
- "A=5; domain=.host.test; path=/path",
- "A=6; domain=.host.test; path=/quux",
- "A=7; domain=.host.test; path=/path/foo",
- },
- "A=1 A=2 A=3 A=4 A=5 A=6 A=7",
- []query{
- {"http://www.host.test/path", "A=2 A=5 A=1"},
- {"http://www.host.test/path/foo", "A=4 A=7 A=2 A=5 A=1"},
- },
- },
- {
- "Disallow domain cookie on public suffix.",
- "http://www.bbc.co.uk",
- []string{
- "a=1",
- "b=2; domain=co.uk",
- },
- "a=1",
- []query{{"http://www.bbc.co.uk", "a=1"}},
- },
- {
- "Host cookie on IP.",
- "http://192.168.0.10",
- []string{"a=1"},
- "a=1",
- []query{{"http://192.168.0.10", "a=1"}},
- },
- {
- "Port is ignored #1.",
- "http://www.host.test/",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://www.host.test", "a=1"},
- {"http://www.host.test:8080/", "a=1"},
- },
- },
- {
- "Port is ignored #2.",
- "http://www.host.test:8080/",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://www.host.test", "a=1"},
- {"http://www.host.test:8080/", "a=1"},
- {"http://www.host.test:1234/", "a=1"},
- },
- },
-}
-
-func TestBasics(t *testing.T) {
- for _, test := range basicsTests {
- jar := newTestJar()
- test.run(t, jar)
- }
-}
-
-// updateAndDeleteTests contains jarTests which must be performed on the same
-// Jar.
-var updateAndDeleteTests = [...]jarTest{
- {
- "Set initial cookies.",
- "http://www.host.test",
- []string{
- "a=1",
- "b=2; secure",
- "c=3; httponly",
- "d=4; secure; httponly"},
- "a=1 b=2 c=3 d=4",
- []query{
- {"http://www.host.test", "a=1 c=3"},
- {"https://www.host.test", "a=1 b=2 c=3 d=4"},
- },
- },
- {
- "Update value via http.",
- "http://www.host.test",
- []string{
- "a=w",
- "b=x; secure",
- "c=y; httponly",
- "d=z; secure; httponly"},
- "a=w b=x c=y d=z",
- []query{
- {"http://www.host.test", "a=w c=y"},
- {"https://www.host.test", "a=w b=x c=y d=z"},
- },
- },
- {
- "Clear Secure flag from a http.",
- "http://www.host.test/",
- []string{
- "b=xx",
- "d=zz; httponly"},
- "a=w b=xx c=y d=zz",
- []query{{"http://www.host.test", "a=w b=xx c=y d=zz"}},
- },
- {
- "Delete all.",
- "http://www.host.test/",
- []string{
- "a=1; max-Age=-1", // delete via MaxAge
- "b=2; " + expiresIn(-10), // delete via Expires
- "c=2; max-age=-1; " + expiresIn(-10), // delete via both
- "d=4; max-age=-1; " + expiresIn(10)}, // MaxAge takes precedence
- "",
- []query{{"http://www.host.test", ""}},
- },
- {
- "Refill #1.",
- "http://www.host.test",
- []string{
- "A=1",
- "A=2; path=/foo",
- "A=3; domain=.host.test",
- "A=4; path=/foo; domain=.host.test"},
- "A=1 A=2 A=3 A=4",
- []query{{"http://www.host.test/foo", "A=2 A=4 A=1 A=3"}},
- },
- {
- "Refill #2.",
- "http://www.google.com",
- []string{
- "A=6",
- "A=7; path=/foo",
- "A=8; domain=.google.com",
- "A=9; path=/foo; domain=.google.com"},
- "A=1 A=2 A=3 A=4 A=6 A=7 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=4 A=1 A=3"},
- {"http://www.google.com/foo", "A=7 A=9 A=6 A=8"},
- },
- },
- {
- "Delete A7.",
- "http://www.google.com",
- []string{"A=; path=/foo; max-age=-1"},
- "A=1 A=2 A=3 A=4 A=6 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=4 A=1 A=3"},
- {"http://www.google.com/foo", "A=9 A=6 A=8"},
- },
- },
- {
- "Delete A4.",
- "http://www.host.test",
- []string{"A=; path=/foo; domain=host.test; max-age=-1"},
- "A=1 A=2 A=3 A=6 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=1 A=3"},
- {"http://www.google.com/foo", "A=9 A=6 A=8"},
- },
- },
- {
- "Delete A6.",
- "http://www.google.com",
- []string{"A=; max-age=-1"},
- "A=1 A=2 A=3 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=1 A=3"},
- {"http://www.google.com/foo", "A=9 A=8"},
- },
- },
- {
- "Delete A3.",
- "http://www.host.test",
- []string{"A=; domain=host.test; max-age=-1"},
- "A=1 A=2 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=1"},
- {"http://www.google.com/foo", "A=9 A=8"},
- },
- },
- {
- "No cross-domain delete.",
- "http://www.host.test",
- []string{
- "A=; domain=google.com; max-age=-1",
- "A=; path=/foo; domain=google.com; max-age=-1"},
- "A=1 A=2 A=8 A=9",
- []query{
- {"http://www.host.test/foo", "A=2 A=1"},
- {"http://www.google.com/foo", "A=9 A=8"},
- },
- },
- {
- "Delete A8 and A9.",
- "http://www.google.com",
- []string{
- "A=; domain=google.com; max-age=-1",
- "A=; path=/foo; domain=google.com; max-age=-1"},
- "A=1 A=2",
- []query{
- {"http://www.host.test/foo", "A=2 A=1"},
- {"http://www.google.com/foo", ""},
- },
- },
-}
-
-func TestUpdateAndDelete(t *testing.T) {
- jar := newTestJar()
- for _, test := range updateAndDeleteTests {
- test.run(t, jar)
- }
-}
-
-func TestExpiration(t *testing.T) {
- jar := newTestJar()
- jarTest{
- "Expiration.",
- "http://www.host.test",
- []string{
- "a=1",
- "b=2; max-age=3",
- "c=3; " + expiresIn(3),
- "d=4; max-age=5",
- "e=5; " + expiresIn(5),
- "f=6; max-age=100",
- },
- "a=1 b=2 c=3 d=4 e=5 f=6", // executed at t0 + 1001 ms
- []query{
- {"http://www.host.test", "a=1 b=2 c=3 d=4 e=5 f=6"}, // t0 + 2002 ms
- {"http://www.host.test", "a=1 d=4 e=5 f=6"}, // t0 + 3003 ms
- {"http://www.host.test", "a=1 d=4 e=5 f=6"}, // t0 + 4004 ms
- {"http://www.host.test", "a=1 f=6"}, // t0 + 5005 ms
- {"http://www.host.test", "a=1 f=6"}, // t0 + 6006 ms
- },
- }.run(t, jar)
-}
-
-//
-// Tests derived from Chromium's cookie_store_unittest.h.
-//
-
-// See http://src.chromium.org/viewvc/chrome/trunk/src/net/cookies/cookie_store_unittest.h?revision=159685&content-type=text/plain
-// Some of the original tests are in a bad condition (e.g.
-// DomainWithTrailingDotTest) or are not RFC 6265 conforming (e.g.
-// TestNonDottedAndTLD #1 and #6) and have not been ported.
-
-// chromiumBasicsTests contains fundamental tests. Each jarTest has to be
-// performed on a fresh, empty Jar.
-var chromiumBasicsTests = [...]jarTest{
- {
- "DomainWithTrailingDotTest.",
- "http://www.google.com/",
- []string{
- "a=1; domain=.www.google.com.",
- "b=2; domain=.www.google.com.."},
- "",
- []query{
- {"http://www.google.com", ""},
- },
- },
- {
- "ValidSubdomainTest #1.",
- "http://a.b.c.d.com",
- []string{
- "a=1; domain=.a.b.c.d.com",
- "b=2; domain=.b.c.d.com",
- "c=3; domain=.c.d.com",
- "d=4; domain=.d.com"},
- "a=1 b=2 c=3 d=4",
- []query{
- {"http://a.b.c.d.com", "a=1 b=2 c=3 d=4"},
- {"http://b.c.d.com", "b=2 c=3 d=4"},
- {"http://c.d.com", "c=3 d=4"},
- {"http://d.com", "d=4"},
- },
- },
- {
- "ValidSubdomainTest #2.",
- "http://a.b.c.d.com",
- []string{
- "a=1; domain=.a.b.c.d.com",
- "b=2; domain=.b.c.d.com",
- "c=3; domain=.c.d.com",
- "d=4; domain=.d.com",
- "X=bcd; domain=.b.c.d.com",
- "X=cd; domain=.c.d.com"},
- "X=bcd X=cd a=1 b=2 c=3 d=4",
- []query{
- {"http://b.c.d.com", "b=2 c=3 d=4 X=bcd X=cd"},
- {"http://c.d.com", "c=3 d=4 X=cd"},
- },
- },
- {
- "InvalidDomainTest #1.",
- "http://foo.bar.com",
- []string{
- "a=1; domain=.yo.foo.bar.com",
- "b=2; domain=.foo.com",
- "c=3; domain=.bar.foo.com",
- "d=4; domain=.foo.bar.com.net",
- "e=5; domain=ar.com",
- "f=6; domain=.",
- "g=7; domain=/",
- "h=8; domain=http://foo.bar.com",
- "i=9; domain=..foo.bar.com",
- "j=10; domain=..bar.com",
- "k=11; domain=.foo.bar.com?blah",
- "l=12; domain=.foo.bar.com/blah",
- "m=12; domain=.foo.bar.com:80",
- "n=14; domain=.foo.bar.com:",
- "o=15; domain=.foo.bar.com#sup",
- },
- "", // Jar is empty.
- []query{{"http://foo.bar.com", ""}},
- },
- {
- "InvalidDomainTest #2.",
- "http://foo.com.com",
- []string{"a=1; domain=.foo.com.com.com"},
- "",
- []query{{"http://foo.bar.com", ""}},
- },
- {
- "DomainWithoutLeadingDotTest #1.",
- "http://manage.hosted.filefront.com",
- []string{"a=1; domain=filefront.com"},
- "a=1",
- []query{{"http://www.filefront.com", "a=1"}},
- },
- {
- "DomainWithoutLeadingDotTest #2.",
- "http://www.google.com",
- []string{"a=1; domain=www.google.com"},
- "a=1",
- []query{
- {"http://www.google.com", "a=1"},
- {"http://sub.www.google.com", "a=1"},
- {"http://something-else.com", ""},
- },
- },
- {
- "CaseInsensitiveDomainTest.",
- "http://www.google.com",
- []string{
- "a=1; domain=.GOOGLE.COM",
- "b=2; domain=.www.gOOgLE.coM"},
- "a=1 b=2",
- []query{{"http://www.google.com", "a=1 b=2"}},
- },
- {
- "TestIpAddress #1.",
- "http://1.2.3.4/foo",
- []string{"a=1; path=/"},
- "a=1",
- []query{{"http://1.2.3.4/foo", "a=1"}},
- },
- {
- "TestIpAddress #2.",
- "http://1.2.3.4/foo",
- []string{
- "a=1; domain=.1.2.3.4",
- "b=2; domain=.3.4"},
- "",
- []query{{"http://1.2.3.4/foo", ""}},
- },
- {
- "TestIpAddress #3.",
- "http://1.2.3.4/foo",
- []string{"a=1; domain=1.2.3.4"},
- "",
- []query{{"http://1.2.3.4/foo", ""}},
- },
- {
- "TestNonDottedAndTLD #2.",
- "http://com./index.html",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://com./index.html", "a=1"},
- {"http://no-cookies.com./index.html", ""},
- },
- },
- {
- "TestNonDottedAndTLD #3.",
- "http://a.b",
- []string{
- "a=1; domain=.b",
- "b=2; domain=b"},
- "",
- []query{{"http://bar.foo", ""}},
- },
- {
- "TestNonDottedAndTLD #4.",
- "http://google.com",
- []string{
- "a=1; domain=.com",
- "b=2; domain=com"},
- "",
- []query{{"http://google.com", ""}},
- },
- {
- "TestNonDottedAndTLD #5.",
- "http://google.co.uk",
- []string{
- "a=1; domain=.co.uk",
- "b=2; domain=.uk"},
- "",
- []query{
- {"http://google.co.uk", ""},
- {"http://else.co.com", ""},
- {"http://else.uk", ""},
- },
- },
- {
- "TestHostEndsWithDot.",
- "http://www.google.com",
- []string{
- "a=1",
- "b=2; domain=.www.google.com."},
- "a=1",
- []query{{"http://www.google.com", "a=1"}},
- },
- {
- "PathTest",
- "http://www.google.izzle",
- []string{"a=1; path=/wee"},
- "a=1",
- []query{
- {"http://www.google.izzle/wee", "a=1"},
- {"http://www.google.izzle/wee/", "a=1"},
- {"http://www.google.izzle/wee/war", "a=1"},
- {"http://www.google.izzle/wee/war/more/more", "a=1"},
- {"http://www.google.izzle/weehee", ""},
- {"http://www.google.izzle/", ""},
- },
- },
-}
-
-func TestChromiumBasics(t *testing.T) {
- for _, test := range chromiumBasicsTests {
- jar := newTestJar()
- test.run(t, jar)
- }
-}
-
-// chromiumDomainTests contains jarTests which must be executed all on the
-// same Jar.
-var chromiumDomainTests = [...]jarTest{
- {
- "Fill #1.",
- "http://www.google.izzle",
- []string{"A=B"},
- "A=B",
- []query{{"http://www.google.izzle", "A=B"}},
- },
- {
- "Fill #2.",
- "http://www.google.izzle",
- []string{"C=D; domain=.google.izzle"},
- "A=B C=D",
- []query{{"http://www.google.izzle", "A=B C=D"}},
- },
- {
- "Verify A is a host cookie and not accessible from subdomain.",
- "http://unused.nil",
- []string{},
- "A=B C=D",
- []query{{"http://foo.www.google.izzle", "C=D"}},
- },
- {
- "Verify domain cookies are found on proper domain.",
- "http://www.google.izzle",
- []string{"E=F; domain=.www.google.izzle"},
- "A=B C=D E=F",
- []query{{"http://www.google.izzle", "A=B C=D E=F"}},
- },
- {
- "Leading dots in domain attributes are optional.",
- "http://www.google.izzle",
- []string{"G=H; domain=www.google.izzle"},
- "A=B C=D E=F G=H",
- []query{{"http://www.google.izzle", "A=B C=D E=F G=H"}},
- },
- {
- "Verify domain enforcement works #1.",
- "http://www.google.izzle",
- []string{"K=L; domain=.bar.www.google.izzle"},
- "A=B C=D E=F G=H",
- []query{{"http://bar.www.google.izzle", "C=D E=F G=H"}},
- },
- {
- "Verify domain enforcement works #2.",
- "http://unused.nil",
- []string{},
- "A=B C=D E=F G=H",
- []query{{"http://www.google.izzle", "A=B C=D E=F G=H"}},
- },
-}
-
-func TestChromiumDomain(t *testing.T) {
- jar := newTestJar()
- for _, test := range chromiumDomainTests {
- test.run(t, jar)
- }
-
-}
-
-// chromiumDeletionTests must be performed all on the same Jar.
-var chromiumDeletionTests = [...]jarTest{
- {
- "Create session cookie a1.",
- "http://www.google.com",
- []string{"a=1"},
- "a=1",
- []query{{"http://www.google.com", "a=1"}},
- },
- {
- "Delete sc a1 via MaxAge.",
- "http://www.google.com",
- []string{"a=1; max-age=-1"},
- "",
- []query{{"http://www.google.com", ""}},
- },
- {
- "Create session cookie b2.",
- "http://www.google.com",
- []string{"b=2"},
- "b=2",
- []query{{"http://www.google.com", "b=2"}},
- },
- {
- "Delete sc b2 via Expires.",
- "http://www.google.com",
- []string{"b=2; " + expiresIn(-10)},
- "",
- []query{{"http://www.google.com", ""}},
- },
- {
- "Create persistent cookie c3.",
- "http://www.google.com",
- []string{"c=3; max-age=3600"},
- "c=3",
- []query{{"http://www.google.com", "c=3"}},
- },
- {
- "Delete pc c3 via MaxAge.",
- "http://www.google.com",
- []string{"c=3; max-age=-1"},
- "",
- []query{{"http://www.google.com", ""}},
- },
- {
- "Create persistent cookie d4.",
- "http://www.google.com",
- []string{"d=4; max-age=3600"},
- "d=4",
- []query{{"http://www.google.com", "d=4"}},
- },
- {
- "Delete pc d4 via Expires.",
- "http://www.google.com",
- []string{"d=4; " + expiresIn(-10)},
- "",
- []query{{"http://www.google.com", ""}},
- },
-}
-
-func TestChromiumDeletion(t *testing.T) {
- jar := newTestJar()
- for _, test := range chromiumDeletionTests {
- test.run(t, jar)
- }
-}
-
-// domainHandlingTests tests and documents the rules for domain handling.
-// Each test must be performed on an empty new Jar.
-var domainHandlingTests = [...]jarTest{
- {
- "Host cookie",
- "http://www.host.test",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://www.host.test", "a=1"},
- {"http://host.test", ""},
- {"http://bar.host.test", ""},
- {"http://foo.www.host.test", ""},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Domain cookie #1",
- "http://www.host.test",
- []string{"a=1; domain=host.test"},
- "a=1",
- []query{
- {"http://www.host.test", "a=1"},
- {"http://host.test", "a=1"},
- {"http://bar.host.test", "a=1"},
- {"http://foo.www.host.test", "a=1"},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Domain cookie #2",
- "http://www.host.test",
- []string{"a=1; domain=.host.test"},
- "a=1",
- []query{
- {"http://www.host.test", "a=1"},
- {"http://host.test", "a=1"},
- {"http://bar.host.test", "a=1"},
- {"http://foo.www.host.test", "a=1"},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Host cookie on IDNA domain #1",
- "http://www.bücher.test",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://www.bücher.test", "a=1"},
- {"http://www.xn--bcher-kva.test", "a=1"},
- {"http://bücher.test", ""},
- {"http://xn--bcher-kva.test", ""},
- {"http://bar.bücher.test", ""},
- {"http://bar.xn--bcher-kva.test", ""},
- {"http://foo.www.bücher.test", ""},
- {"http://foo.www.xn--bcher-kva.test", ""},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Host cookie on IDNA domain #2",
- "http://www.xn--bcher-kva.test",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://www.bücher.test", "a=1"},
- {"http://www.xn--bcher-kva.test", "a=1"},
- {"http://bücher.test", ""},
- {"http://xn--bcher-kva.test", ""},
- {"http://bar.bücher.test", ""},
- {"http://bar.xn--bcher-kva.test", ""},
- {"http://foo.www.bücher.test", ""},
- {"http://foo.www.xn--bcher-kva.test", ""},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Domain cookie on IDNA domain #1",
- "http://www.bücher.test",
- []string{"a=1; domain=xn--bcher-kva.test"},
- "a=1",
- []query{
- {"http://www.bücher.test", "a=1"},
- {"http://www.xn--bcher-kva.test", "a=1"},
- {"http://bücher.test", "a=1"},
- {"http://xn--bcher-kva.test", "a=1"},
- {"http://bar.bücher.test", "a=1"},
- {"http://bar.xn--bcher-kva.test", "a=1"},
- {"http://foo.www.bücher.test", "a=1"},
- {"http://foo.www.xn--bcher-kva.test", "a=1"},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Domain cookie on IDNA domain #2",
- "http://www.xn--bcher-kva.test",
- []string{"a=1; domain=xn--bcher-kva.test"},
- "a=1",
- []query{
- {"http://www.bücher.test", "a=1"},
- {"http://www.xn--bcher-kva.test", "a=1"},
- {"http://bücher.test", "a=1"},
- {"http://xn--bcher-kva.test", "a=1"},
- {"http://bar.bücher.test", "a=1"},
- {"http://bar.xn--bcher-kva.test", "a=1"},
- {"http://foo.www.bücher.test", "a=1"},
- {"http://foo.www.xn--bcher-kva.test", "a=1"},
- {"http://other.test", ""},
- {"http://test", ""},
- },
- },
- {
- "Host cookie on TLD.",
- "http://com",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://com", "a=1"},
- {"http://any.com", ""},
- {"http://any.test", ""},
- },
- },
- {
- "Domain cookie on TLD becomes a host cookie.",
- "http://com",
- []string{"a=1; domain=com"},
- "a=1",
- []query{
- {"http://com", "a=1"},
- {"http://any.com", ""},
- {"http://any.test", ""},
- },
- },
- {
- "Host cookie on public suffix.",
- "http://co.uk",
- []string{"a=1"},
- "a=1",
- []query{
- {"http://co.uk", "a=1"},
- {"http://uk", ""},
- {"http://some.co.uk", ""},
- {"http://foo.some.co.uk", ""},
- {"http://any.uk", ""},
- },
- },
- {
- "Domain cookie on public suffix is ignored.",
- "http://some.co.uk",
- []string{"a=1; domain=co.uk"},
- "",
- []query{
- {"http://co.uk", ""},
- {"http://uk", ""},
- {"http://some.co.uk", ""},
- {"http://foo.some.co.uk", ""},
- {"http://any.uk", ""},
- },
- },
-}
-
-func TestDomainHandling(t *testing.T) {
- for _, test := range domainHandlingTests {
- jar := newTestJar()
- test.run(t, jar)
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,159 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package cookiejar
-
-// This file implements the Punycode algorithm from RFC 3492.
-
-import (
- "fmt"
- "strings"
- "unicode/utf8"
-)
-
-// These parameter values are specified in section 5.
-//
-// All computation is done with int32s, so that overflow behavior is identical
-// regardless of whether int is 32-bit or 64-bit.
-const (
- base int32 = 36
- damp int32 = 700
- initialBias int32 = 72
- initialN int32 = 128
- skew int32 = 38
- tmax int32 = 26
- tmin int32 = 1
-)
-
-// encode encodes a string as specified in section 6.3 and prepends prefix to
-// the result.
-//
-// The "while h < length(input)" line in the specification becomes "for
-// remaining != 0" in the Go code, because len(s) in Go is in bytes, not runes.
-func encode(prefix, s string) (string, error) {
- output := make([]byte, len(prefix), len(prefix)+1+2*len(s))
- copy(output, prefix)
- delta, n, bias := int32(0), initialN, initialBias
- b, remaining := int32(0), int32(0)
- for _, r := range s {
- if r < 0x80 {
- b++
- output = append(output, byte(r))
- } else {
- remaining++
- }
- }
- h := b
- if b > 0 {
- output = append(output, '-')
- }
- for remaining != 0 {
- m := int32(0x7fffffff)
- for _, r := range s {
- if m > r && r >= n {
- m = r
- }
- }
- delta += (m - n) * (h + 1)
- if delta < 0 {
- return "", fmt.Errorf("cookiejar: invalid label %q", s)
- }
- n = m
- for _, r := range s {
- if r < n {
- delta++
- if delta < 0 {
- return "", fmt.Errorf("cookiejar: invalid label %q", s)
- }
- continue
- }
- if r > n {
- continue
- }
- q := delta
- for k := base; ; k += base {
- t := k - bias
- if t < tmin {
- t = tmin
- } else if t > tmax {
- t = tmax
- }
- if q < t {
- break
- }
- output = append(output, encodeDigit(t+(q-t)%(base-t)))
- q = (q - t) / (base - t)
- }
- output = append(output, encodeDigit(q))
- bias = adapt(delta, h+1, h == b)
- delta = 0
- h++
- remaining--
- }
- delta++
- n++
- }
- return string(output), nil
-}
-
-func encodeDigit(digit int32) byte {
- switch {
- case 0 <= digit && digit < 26:
- return byte(digit + 'a')
- case 26 <= digit && digit < 36:
- return byte(digit + ('0' - 26))
- }
- panic("cookiejar: internal error in punycode encoding")
-}
-
-// adapt is the bias adaptation function specified in section 6.1.
-func adapt(delta, numPoints int32, firstTime bool) int32 {
- if firstTime {
- delta /= damp
- } else {
- delta /= 2
- }
- delta += delta / numPoints
- k := int32(0)
- for delta > ((base-tmin)*tmax)/2 {
- delta /= base - tmin
- k += base
- }
- return k + (base-tmin+1)*delta/(delta+skew)
-}
-
-// Strictly speaking, the remaining code below deals with IDNA (RFC 5890 and
-// friends) and not Punycode (RFC 3492) per se.
-
-// acePrefix is the ASCII Compatible Encoding prefix.
-const acePrefix = "xn--"
-
-// toASCII converts a domain or domain label to its ASCII form. For example,
-// toASCII("bücher.example.com") is "xn--bcher-kva.example.com", and
-// toASCII("golang") is "golang".
-func toASCII(s string) (string, error) {
- if ascii(s) {
- return s, nil
- }
- labels := strings.Split(s, ".")
- for i, label := range labels {
- if !ascii(label) {
- a, err := encode(acePrefix, label)
- if err != nil {
- return "", err
- }
- labels[i] = a
- }
- }
- return strings.Join(labels, "."), nil
-}
-
-func ascii(s string) bool {
- for i := 0; i < len(s); i++ {
- if s[i] >= utf8.RuneSelf {
- return false
- }
- }
- return true
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/cookiejar/punycode_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,161 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package cookiejar
-
-import (
- "testing"
-)
-
-var punycodeTestCases = [...]struct {
- s, encoded string
-}{
- {"", ""},
- {"-", "--"},
- {"-a", "-a-"},
- {"-a-", "-a--"},
- {"a", "a-"},
- {"a-", "a--"},
- {"a-b", "a-b-"},
- {"books", "books-"},
- {"bücher", "bcher-kva"},
- {"Hello世界", "Hello-ck1hg65u"},
- {"ü", "tda"},
- {"üý", "tdac"},
-
- // The test cases below come from RFC 3492 section 7.1 with Errata 3026.
- {
- // (A) Arabic (Egyptian).
- "\u0644\u064A\u0647\u0645\u0627\u0628\u062A\u0643\u0644" +
- "\u0645\u0648\u0634\u0639\u0631\u0628\u064A\u061F",
- "egbpdaj6bu4bxfgehfvwxn",
- },
- {
- // (B) Chinese (simplified).
- "\u4ED6\u4EEC\u4E3A\u4EC0\u4E48\u4E0D\u8BF4\u4E2D\u6587",
- "ihqwcrb4cv8a8dqg056pqjye",
- },
- {
- // (C) Chinese (traditional).
- "\u4ED6\u5011\u7232\u4EC0\u9EBD\u4E0D\u8AAA\u4E2D\u6587",
- "ihqwctvzc91f659drss3x8bo0yb",
- },
- {
- // (D) Czech.
- "\u0050\u0072\u006F\u010D\u0070\u0072\u006F\u0073\u0074" +
- "\u011B\u006E\u0065\u006D\u006C\u0075\u0076\u00ED\u010D" +
- "\u0065\u0073\u006B\u0079",
- "Proprostnemluvesky-uyb24dma41a",
- },
- {
- // (E) Hebrew.
- "\u05DC\u05DE\u05D4\u05D4\u05DD\u05E4\u05E9\u05D5\u05D8" +
- "\u05DC\u05D0\u05DE\u05D3\u05D1\u05E8\u05D9\u05DD\u05E2" +
- "\u05D1\u05E8\u05D9\u05EA",
- "4dbcagdahymbxekheh6e0a7fei0b",
- },
- {
- // (F) Hindi (Devanagari).
- "\u092F\u0939\u0932\u094B\u0917\u0939\u093F\u0928\u094D" +
- "\u0926\u0940\u0915\u094D\u092F\u094B\u0902\u0928\u0939" +
- "\u0940\u0902\u092C\u094B\u0932\u0938\u0915\u0924\u0947" +
- "\u0939\u0948\u0902",
- "i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd",
- },
- {
- // (G) Japanese (kanji and hiragana).
- "\u306A\u305C\u307F\u3093\u306A\u65E5\u672C\u8A9E\u3092" +
- "\u8A71\u3057\u3066\u304F\u308C\u306A\u3044\u306E\u304B",
- "n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa",
- },
- {
- // (H) Korean (Hangul syllables).
- "\uC138\uACC4\uC758\uBAA8\uB4E0\uC0AC\uB78C\uB4E4\uC774" +
- "\uD55C\uAD6D\uC5B4\uB97C\uC774\uD574\uD55C\uB2E4\uBA74" +
- "\uC5BC\uB9C8\uB098\uC88B\uC744\uAE4C",
- "989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5j" +
- "psd879ccm6fea98c",
- },
- {
- // (I) Russian (Cyrillic).
- "\u043F\u043E\u0447\u0435\u043C\u0443\u0436\u0435\u043E" +
- "\u043D\u0438\u043D\u0435\u0433\u043E\u0432\u043E\u0440" +
- "\u044F\u0442\u043F\u043E\u0440\u0443\u0441\u0441\u043A" +
- "\u0438",
- "b1abfaaepdrnnbgefbadotcwatmq2g4l",
- },
- {
- // (J) Spanish.
- "\u0050\u006F\u0072\u0071\u0075\u00E9\u006E\u006F\u0070" +
- "\u0075\u0065\u0064\u0065\u006E\u0073\u0069\u006D\u0070" +
- "\u006C\u0065\u006D\u0065\u006E\u0074\u0065\u0068\u0061" +
- "\u0062\u006C\u0061\u0072\u0065\u006E\u0045\u0073\u0070" +
- "\u0061\u00F1\u006F\u006C",
- "PorqunopuedensimplementehablarenEspaol-fmd56a",
- },
- {
- // (K) Vietnamese.
- "\u0054\u1EA1\u0069\u0073\u0061\u006F\u0068\u1ECD\u006B" +
- "\u0068\u00F4\u006E\u0067\u0074\u0068\u1EC3\u0063\u0068" +
- "\u1EC9\u006E\u00F3\u0069\u0074\u0069\u1EBF\u006E\u0067" +
- "\u0056\u0069\u1EC7\u0074",
- "TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g",
- },
- {
- // (L) 3B.
- "\u0033\u5E74\u0042\u7D44\u91D1\u516B\u5148\u751F",
- "3B-ww4c5e180e575a65lsy2b",
- },
- {
- // (M) -with-SUPER-MONKEYS.
- "\u5B89\u5BA4\u5948\u7F8E\u6075\u002D\u0077\u0069\u0074" +
- "\u0068\u002D\u0053\u0055\u0050\u0045\u0052\u002D\u004D" +
- "\u004F\u004E\u004B\u0045\u0059\u0053",
- "-with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n",
- },
- {
- // (N) Hello-Another-Way-.
- "\u0048\u0065\u006C\u006C\u006F\u002D\u0041\u006E\u006F" +
- "\u0074\u0068\u0065\u0072\u002D\u0057\u0061\u0079\u002D" +
- "\u305D\u308C\u305E\u308C\u306E\u5834\u6240",
- "Hello-Another-Way--fc4qua05auwb3674vfr0b",
- },
- {
- // (O) 2.
- "\u3072\u3068\u3064\u5C4B\u6839\u306E\u4E0B\u0032",
- "2-u9tlzr9756bt3uc0v",
- },
- {
- // (P) MajiKoi5
- "\u004D\u0061\u006A\u0069\u3067\u004B\u006F\u0069\u3059" +
- "\u308B\u0035\u79D2\u524D",
- "MajiKoi5-783gue6qz075azm5e",
- },
- {
- // (Q) de
- "\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0",
- "de-jg4avhby1noc0d",
- },
- {
- // (R)
- "\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067",
- "d9juau41awczczp",
- },
- {
- // (S) -> $1.00 <-
- "\u002D\u003E\u0020\u0024\u0031\u002E\u0030\u0030\u0020" +
- "\u003C\u002D",
- "-> $1.00 <--",
- },
-}
-
-func TestPunycode(t *testing.T) {
- for _, tc := range punycodeTestCases {
- if got, err := encode("", tc.s); err != nil {
- t.Errorf(`encode("", %q): %v`, tc.s, err)
- } else if got != tc.encoded {
- t.Errorf(`encode("", %q): got %q, want %q`, tc.s, got, tc.encoded)
- }
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/child.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,305 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fcgi
-
-// This file implements FastCGI from the perspective of a child process.
-
-import (
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "net/http"
- "net/http/cgi"
- "os"
- "strings"
- "sync"
- "time"
-)
-
-// request holds the state for an in-progress request. As soon as it's complete,
-// it's converted to an http.Request.
-type request struct {
- pw *io.PipeWriter
- reqId uint16
- params map[string]string
- buf [1024]byte
- rawParams []byte
- keepConn bool
-}
-
-func newRequest(reqId uint16, flags uint8) *request {
- r := &request{
- reqId: reqId,
- params: map[string]string{},
- keepConn: flags&flagKeepConn != 0,
- }
- r.rawParams = r.buf[:0]
- return r
-}
-
-// parseParams reads an encoded []byte into Params.
-func (r *request) parseParams() {
- text := r.rawParams
- r.rawParams = nil
- for len(text) > 0 {
- keyLen, n := readSize(text)
- if n == 0 {
- return
- }
- text = text[n:]
- valLen, n := readSize(text)
- if n == 0 {
- return
- }
- text = text[n:]
- key := readString(text, keyLen)
- text = text[keyLen:]
- val := readString(text, valLen)
- text = text[valLen:]
- r.params[key] = val
- }
-}
-
-// response implements http.ResponseWriter.
-type response struct {
- req *request
- header http.Header
- w *bufWriter
- wroteHeader bool
-}
-
-func newResponse(c *child, req *request) *response {
- return &response{
- req: req,
- header: http.Header{},
- w: newWriter(c.conn, typeStdout, req.reqId),
- }
-}
-
-func (r *response) Header() http.Header {
- return r.header
-}
-
-func (r *response) Write(data []byte) (int, error) {
- if !r.wroteHeader {
- r.WriteHeader(http.StatusOK)
- }
- return r.w.Write(data)
-}
-
-func (r *response) WriteHeader(code int) {
- if r.wroteHeader {
- return
- }
- r.wroteHeader = true
- if code == http.StatusNotModified {
- // Must not have body.
- r.header.Del("Content-Type")
- r.header.Del("Content-Length")
- r.header.Del("Transfer-Encoding")
- } else if r.header.Get("Content-Type") == "" {
- r.header.Set("Content-Type", "text/html; charset=utf-8")
- }
-
- if r.header.Get("Date") == "" {
- r.header.Set("Date", time.Now().UTC().Format(http.TimeFormat))
- }
-
- fmt.Fprintf(r.w, "Status: %d %s\r\n", code, http.StatusText(code))
- r.header.Write(r.w)
- r.w.WriteString("\r\n")
-}
-
-func (r *response) Flush() {
- if !r.wroteHeader {
- r.WriteHeader(http.StatusOK)
- }
- r.w.Flush()
-}
-
-func (r *response) Close() error {
- r.Flush()
- return r.w.Close()
-}
-
-type child struct {
- conn *conn
- handler http.Handler
-
- mu sync.Mutex // protects requests:
- requests map[uint16]*request // keyed by request ID
-}
-
-func newChild(rwc io.ReadWriteCloser, handler http.Handler) *child {
- return &child{
- conn: newConn(rwc),
- handler: handler,
- requests: make(map[uint16]*request),
- }
-}
-
-func (c *child) serve() {
- defer c.conn.Close()
- var rec record
- for {
- if err := rec.read(c.conn.rwc); err != nil {
- return
- }
- if err := c.handleRecord(&rec); err != nil {
- return
- }
- }
-}
-
-var errCloseConn = errors.New("fcgi: connection should be closed")
-
-var emptyBody = ioutil.NopCloser(strings.NewReader(""))
-
-func (c *child) handleRecord(rec *record) error {
- c.mu.Lock()
- req, ok := c.requests[rec.h.Id]
- c.mu.Unlock()
- if !ok && rec.h.Type != typeBeginRequest && rec.h.Type != typeGetValues {
- // The spec says to ignore unknown request IDs.
- return nil
- }
-
- switch rec.h.Type {
- case typeBeginRequest:
- if req != nil {
- // The server is trying to begin a request with the same ID
- // as an in-progress request. This is an error.
- return errors.New("fcgi: received ID that is already in-flight")
- }
-
- var br beginRequest
- if err := br.read(rec.content()); err != nil {
- return err
- }
- if br.role != roleResponder {
- c.conn.writeEndRequest(rec.h.Id, 0, statusUnknownRole)
- return nil
- }
- req = newRequest(rec.h.Id, br.flags)
- c.mu.Lock()
- c.requests[rec.h.Id] = req
- c.mu.Unlock()
- return nil
- case typeParams:
- // NOTE(eds): Technically a key-value pair can straddle the boundary
- // between two packets. We buffer until we've received all parameters.
- if len(rec.content()) > 0 {
- req.rawParams = append(req.rawParams, rec.content()...)
- return nil
- }
- req.parseParams()
- return nil
- case typeStdin:
- content := rec.content()
- if req.pw == nil {
- var body io.ReadCloser
- if len(content) > 0 {
- // body could be an io.LimitReader, but it shouldn't matter
- // as long as both sides are behaving.
- body, req.pw = io.Pipe()
- } else {
- body = emptyBody
- }
- go c.serveRequest(req, body)
- }
- if len(content) > 0 {
- // TODO(eds): This blocks until the handler reads from the pipe.
- // If the handler takes a long time, it might be a problem.
- req.pw.Write(content)
- } else if req.pw != nil {
- req.pw.Close()
- }
- return nil
- case typeGetValues:
- values := map[string]string{"FCGI_MPXS_CONNS": "1"}
- c.conn.writePairs(typeGetValuesResult, 0, values)
- return nil
- case typeData:
- // If the filter role is implemented, read the data stream here.
- return nil
- case typeAbortRequest:
- println("abort")
- c.mu.Lock()
- delete(c.requests, rec.h.Id)
- c.mu.Unlock()
- c.conn.writeEndRequest(rec.h.Id, 0, statusRequestComplete)
- if !req.keepConn {
- // connection will close upon return
- return errCloseConn
- }
- return nil
- default:
- b := make([]byte, 8)
- b[0] = byte(rec.h.Type)
- c.conn.writeRecord(typeUnknownType, 0, b)
- return nil
- }
-}
-
-func (c *child) serveRequest(req *request, body io.ReadCloser) {
- r := newResponse(c, req)
- httpReq, err := cgi.RequestFromMap(req.params)
- if err != nil {
- // there was an error reading the request
- r.WriteHeader(http.StatusInternalServerError)
- c.conn.writeRecord(typeStderr, req.reqId, []byte(err.Error()))
- } else {
- httpReq.Body = body
- c.handler.ServeHTTP(r, httpReq)
- }
- r.Close()
- c.mu.Lock()
- delete(c.requests, req.reqId)
- c.mu.Unlock()
- c.conn.writeEndRequest(req.reqId, 0, statusRequestComplete)
-
- // Consume the entire body, so the host isn't still writing to
- // us when we close the socket below in the !keepConn case,
- // otherwise we'd send a RST. (golang.org/issue/4183)
- // TODO(bradfitz): also bound this copy in time. Or send
- // some sort of abort request to the host, so the host
- // can properly cut off the client sending all the data.
- // For now just bound it a little and
- io.CopyN(ioutil.Discard, body, 100<<20)
- body.Close()
-
- if !req.keepConn {
- c.conn.Close()
- }
-}
-
-// Serve accepts incoming FastCGI connections on the listener l, creating a new
-// goroutine for each. The goroutine reads requests and then calls handler
-// to reply to them.
-// If l is nil, Serve accepts connections from os.Stdin.
-// If handler is nil, http.DefaultServeMux is used.
-func Serve(l net.Listener, handler http.Handler) error {
- if l == nil {
- var err error
- l, err = net.FileListener(os.Stdin)
- if err != nil {
- return err
- }
- defer l.Close()
- }
- if handler == nil {
- handler = http.DefaultServeMux
- }
- for {
- rw, err := l.Accept()
- if err != nil {
- return err
- }
- c := newChild(rw, handler)
- go c.serve()
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,274 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package fcgi implements the FastCGI protocol.
-// Currently only the responder role is supported.
-// The protocol is defined at http://www.fastcgi.com/drupal/node/6?q=node/22
-package fcgi
-
-// This file defines the raw protocol and some utilities used by the child and
-// the host.
-
-import (
- "bufio"
- "bytes"
- "encoding/binary"
- "errors"
- "io"
- "sync"
-)
-
-// recType is a record type, as defined by
-// http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S8
-type recType uint8
-
-const (
- typeBeginRequest recType = 1
- typeAbortRequest recType = 2
- typeEndRequest recType = 3
- typeParams recType = 4
- typeStdin recType = 5
- typeStdout recType = 6
- typeStderr recType = 7
- typeData recType = 8
- typeGetValues recType = 9
- typeGetValuesResult recType = 10
- typeUnknownType recType = 11
-)
-
-// keep the connection between web-server and responder open after request
-const flagKeepConn = 1
-
-const (
- maxWrite = 65535 // maximum record body
- maxPad = 255
-)
-
-const (
- roleResponder = iota + 1 // only Responders are implemented.
- roleAuthorizer
- roleFilter
-)
-
-const (
- statusRequestComplete = iota
- statusCantMultiplex
- statusOverloaded
- statusUnknownRole
-)
-
-const headerLen = 8
-
-type header struct {
- Version uint8
- Type recType
- Id uint16
- ContentLength uint16
- PaddingLength uint8
- Reserved uint8
-}
-
-type beginRequest struct {
- role uint16
- flags uint8
- reserved [5]uint8
-}
-
-func (br *beginRequest) read(content []byte) error {
- if len(content) != 8 {
- return errors.New("fcgi: invalid begin request record")
- }
- br.role = binary.BigEndian.Uint16(content)
- br.flags = content[2]
- return nil
-}
-
-// for padding so we don't have to allocate all the time
-// not synchronized because we don't care what the contents are
-var pad [maxPad]byte
-
-func (h *header) init(recType recType, reqId uint16, contentLength int) {
- h.Version = 1
- h.Type = recType
- h.Id = reqId
- h.ContentLength = uint16(contentLength)
- h.PaddingLength = uint8(-contentLength & 7)
-}
-
-// conn sends records over rwc
-type conn struct {
- mutex sync.Mutex
- rwc io.ReadWriteCloser
-
- // to avoid allocations
- buf bytes.Buffer
- h header
-}
-
-func newConn(rwc io.ReadWriteCloser) *conn {
- return &conn{rwc: rwc}
-}
-
-func (c *conn) Close() error {
- c.mutex.Lock()
- defer c.mutex.Unlock()
- return c.rwc.Close()
-}
-
-type record struct {
- h header
- buf [maxWrite + maxPad]byte
-}
-
-func (rec *record) read(r io.Reader) (err error) {
- if err = binary.Read(r, binary.BigEndian, &rec.h); err != nil {
- return err
- }
- if rec.h.Version != 1 {
- return errors.New("fcgi: invalid header version")
- }
- n := int(rec.h.ContentLength) + int(rec.h.PaddingLength)
- if _, err = io.ReadFull(r, rec.buf[:n]); err != nil {
- return err
- }
- return nil
-}
-
-func (r *record) content() []byte {
- return r.buf[:r.h.ContentLength]
-}
-
-// writeRecord writes and sends a single record.
-func (c *conn) writeRecord(recType recType, reqId uint16, b []byte) error {
- c.mutex.Lock()
- defer c.mutex.Unlock()
- c.buf.Reset()
- c.h.init(recType, reqId, len(b))
- if err := binary.Write(&c.buf, binary.BigEndian, c.h); err != nil {
- return err
- }
- if _, err := c.buf.Write(b); err != nil {
- return err
- }
- if _, err := c.buf.Write(pad[:c.h.PaddingLength]); err != nil {
- return err
- }
- _, err := c.rwc.Write(c.buf.Bytes())
- return err
-}
-
-func (c *conn) writeBeginRequest(reqId uint16, role uint16, flags uint8) error {
- b := [8]byte{byte(role >> 8), byte(role), flags}
- return c.writeRecord(typeBeginRequest, reqId, b[:])
-}
-
-func (c *conn) writeEndRequest(reqId uint16, appStatus int, protocolStatus uint8) error {
- b := make([]byte, 8)
- binary.BigEndian.PutUint32(b, uint32(appStatus))
- b[4] = protocolStatus
- return c.writeRecord(typeEndRequest, reqId, b)
-}
-
-func (c *conn) writePairs(recType recType, reqId uint16, pairs map[string]string) error {
- w := newWriter(c, recType, reqId)
- b := make([]byte, 8)
- for k, v := range pairs {
- n := encodeSize(b, uint32(len(k)))
- n += encodeSize(b[n:], uint32(len(v)))
- if _, err := w.Write(b[:n]); err != nil {
- return err
- }
- if _, err := w.WriteString(k); err != nil {
- return err
- }
- if _, err := w.WriteString(v); err != nil {
- return err
- }
- }
- w.Close()
- return nil
-}
-
-func readSize(s []byte) (uint32, int) {
- if len(s) == 0 {
- return 0, 0
- }
- size, n := uint32(s[0]), 1
- if size&(1<<7) != 0 {
- if len(s) < 4 {
- return 0, 0
- }
- n = 4
- size = binary.BigEndian.Uint32(s)
- size &^= 1 << 31
- }
- return size, n
-}
-
-func readString(s []byte, size uint32) string {
- if size > uint32(len(s)) {
- return ""
- }
- return string(s[:size])
-}
-
-func encodeSize(b []byte, size uint32) int {
- if size > 127 {
- size |= 1 << 31
- binary.BigEndian.PutUint32(b, size)
- return 4
- }
- b[0] = byte(size)
- return 1
-}
-
-// bufWriter encapsulates bufio.Writer but also closes the underlying stream when
-// Closed.
-type bufWriter struct {
- closer io.Closer
- *bufio.Writer
-}
-
-func (w *bufWriter) Close() error {
- if err := w.Writer.Flush(); err != nil {
- w.closer.Close()
- return err
- }
- return w.closer.Close()
-}
-
-func newWriter(c *conn, recType recType, reqId uint16) *bufWriter {
- s := &streamWriter{c: c, recType: recType, reqId: reqId}
- w := bufio.NewWriterSize(s, maxWrite)
- return &bufWriter{s, w}
-}
-
-// streamWriter abstracts out the separation of a stream into discrete records.
-// It only writes maxWrite bytes at a time.
-type streamWriter struct {
- c *conn
- recType recType
- reqId uint16
-}
-
-func (w *streamWriter) Write(p []byte) (int, error) {
- nn := 0
- for len(p) > 0 {
- n := len(p)
- if n > maxWrite {
- n = maxWrite
- }
- if err := w.c.writeRecord(w.recType, w.reqId, p[:n]); err != nil {
- return nn, err
- }
- nn += n
- p = p[n:]
- }
- return nn, nil
-}
-
-func (w *streamWriter) Close() error {
- // send empty record to close the stream
- return w.c.writeRecord(w.recType, w.reqId, nil)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/fcgi/fcgi_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,150 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package fcgi
-
-import (
- "bytes"
- "errors"
- "io"
- "testing"
-)
-
-var sizeTests = []struct {
- size uint32
- bytes []byte
-}{
- {0, []byte{0x00}},
- {127, []byte{0x7F}},
- {128, []byte{0x80, 0x00, 0x00, 0x80}},
- {1000, []byte{0x80, 0x00, 0x03, 0xE8}},
- {33554431, []byte{0x81, 0xFF, 0xFF, 0xFF}},
-}
-
-func TestSize(t *testing.T) {
- b := make([]byte, 4)
- for i, test := range sizeTests {
- n := encodeSize(b, test.size)
- if !bytes.Equal(b[:n], test.bytes) {
- t.Errorf("%d expected %x, encoded %x", i, test.bytes, b)
- }
- size, n := readSize(test.bytes)
- if size != test.size {
- t.Errorf("%d expected %d, read %d", i, test.size, size)
- }
- if len(test.bytes) != n {
- t.Errorf("%d did not consume all the bytes", i)
- }
- }
-}
-
-var streamTests = []struct {
- desc string
- recType recType
- reqId uint16
- content []byte
- raw []byte
-}{
- {"single record", typeStdout, 1, nil,
- []byte{1, byte(typeStdout), 0, 1, 0, 0, 0, 0},
- },
- // this data will have to be split into two records
- {"two records", typeStdin, 300, make([]byte, 66000),
- bytes.Join([][]byte{
- // header for the first record
- {1, byte(typeStdin), 0x01, 0x2C, 0xFF, 0xFF, 1, 0},
- make([]byte, 65536),
- // header for the second
- {1, byte(typeStdin), 0x01, 0x2C, 0x01, 0xD1, 7, 0},
- make([]byte, 472),
- // header for the empty record
- {1, byte(typeStdin), 0x01, 0x2C, 0, 0, 0, 0},
- },
- nil),
- },
-}
-
-type nilCloser struct {
- io.ReadWriter
-}
-
-func (c *nilCloser) Close() error { return nil }
-
-func TestStreams(t *testing.T) {
- var rec record
-outer:
- for _, test := range streamTests {
- buf := bytes.NewBuffer(test.raw)
- var content []byte
- for buf.Len() > 0 {
- if err := rec.read(buf); err != nil {
- t.Errorf("%s: error reading record: %v", test.desc, err)
- continue outer
- }
- content = append(content, rec.content()...)
- }
- if rec.h.Type != test.recType {
- t.Errorf("%s: got type %d expected %d", test.desc, rec.h.Type, test.recType)
- continue
- }
- if rec.h.Id != test.reqId {
- t.Errorf("%s: got request ID %d expected %d", test.desc, rec.h.Id, test.reqId)
- continue
- }
- if !bytes.Equal(content, test.content) {
- t.Errorf("%s: read wrong content", test.desc)
- continue
- }
- buf.Reset()
- c := newConn(&nilCloser{buf})
- w := newWriter(c, test.recType, test.reqId)
- if _, err := w.Write(test.content); err != nil {
- t.Errorf("%s: error writing record: %v", test.desc, err)
- continue
- }
- if err := w.Close(); err != nil {
- t.Errorf("%s: error closing stream: %v", test.desc, err)
- continue
- }
- if !bytes.Equal(buf.Bytes(), test.raw) {
- t.Errorf("%s: wrote wrong content", test.desc)
- }
- }
-}
-
-type writeOnlyConn struct {
- buf []byte
-}
-
-func (c *writeOnlyConn) Write(p []byte) (int, error) {
- c.buf = append(c.buf, p...)
- return len(p), nil
-}
-
-func (c *writeOnlyConn) Read(p []byte) (int, error) {
- return 0, errors.New("conn is write-only")
-}
-
-func (c *writeOnlyConn) Close() error {
- return nil
-}
-
-func TestGetValues(t *testing.T) {
- var rec record
- rec.h.Type = typeGetValues
-
- wc := new(writeOnlyConn)
- c := newChild(wc, nil)
- err := c.handleRecord(&rec)
- if err != nil {
- t.Fatalf("handleRecord: %v", err)
- }
-
- const want = "\x01\n\x00\x00\x00\x12\x06\x00" +
- "\x0f\x01FCGI_MPXS_CONNS1" +
- "\x00\x00\x00\x00\x00\x00\x01\n\x00\x00\x00\x00\x00\x00"
- if got := string(wc.buf); got != want {
- t.Errorf(" got: %q\nwant: %q\n", got, want)
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/example_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/example_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/example_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/example_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,50 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httptest_test
-
-import (
- "fmt"
- "io/ioutil"
- "log"
- "net/http"
- "net/http/httptest"
-)
-
-func ExampleResponseRecorder() {
- handler := func(w http.ResponseWriter, r *http.Request) {
- http.Error(w, "something failed", http.StatusInternalServerError)
- }
-
- req, err := http.NewRequest("GET", "http://example.com/foo", nil)
- if err != nil {
- log.Fatal(err)
- }
-
- w := httptest.NewRecorder()
- handler(w, req)
-
- fmt.Printf("%d - %s", w.Code, w.Body.String())
- // Output: 500 - something failed
-}
-
-func ExampleServer() {
- ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- fmt.Fprintln(w, "Hello, client")
- }))
- defer ts.Close()
-
- res, err := http.Get(ts.URL)
- if err != nil {
- log.Fatal(err)
- }
- greeting, err := ioutil.ReadAll(res.Body)
- res.Body.Close()
- if err != nil {
- log.Fatal(err)
- }
-
- fmt.Printf("%s", greeting)
- // Output: Hello, client
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,72 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package httptest provides utilities for HTTP testing.
-package httptest
-
-import (
- "bytes"
- "net/http"
-)
-
-// ResponseRecorder is an implementation of http.ResponseWriter that
-// records its mutations for later inspection in tests.
-type ResponseRecorder struct {
- Code int // the HTTP response code from WriteHeader
- HeaderMap http.Header // the HTTP response headers
- Body *bytes.Buffer // if non-nil, the bytes.Buffer to append written data to
- Flushed bool
-
- wroteHeader bool
-}
-
-// NewRecorder returns an initialized ResponseRecorder.
-func NewRecorder() *ResponseRecorder {
- return &ResponseRecorder{
- HeaderMap: make(http.Header),
- Body: new(bytes.Buffer),
- Code: 200,
- }
-}
-
-// DefaultRemoteAddr is the default remote address to return in RemoteAddr if
-// an explicit DefaultRemoteAddr isn't set on ResponseRecorder.
-const DefaultRemoteAddr = "1.2.3.4"
-
-// Header returns the response headers.
-func (rw *ResponseRecorder) Header() http.Header {
- m := rw.HeaderMap
- if m == nil {
- m = make(http.Header)
- rw.HeaderMap = m
- }
- return m
-}
-
-// Write always succeeds and writes to rw.Body, if not nil.
-func (rw *ResponseRecorder) Write(buf []byte) (int, error) {
- if !rw.wroteHeader {
- rw.WriteHeader(200)
- }
- if rw.Body != nil {
- rw.Body.Write(buf)
- }
- return len(buf), nil
-}
-
-// WriteHeader sets rw.Code.
-func (rw *ResponseRecorder) WriteHeader(code int) {
- if !rw.wroteHeader {
- rw.Code = code
- }
- rw.wroteHeader = true
-}
-
-// Flush sets rw.Flushed to true.
-func (rw *ResponseRecorder) Flush() {
- if !rw.wroteHeader {
- rw.WriteHeader(200)
- }
- rw.Flushed = true
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/recorder_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,90 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httptest
-
-import (
- "fmt"
- "net/http"
- "testing"
-)
-
-func TestRecorder(t *testing.T) {
- type checkFunc func(*ResponseRecorder) error
- check := func(fns ...checkFunc) []checkFunc { return fns }
-
- hasStatus := func(wantCode int) checkFunc {
- return func(rec *ResponseRecorder) error {
- if rec.Code != wantCode {
- return fmt.Errorf("Status = %d; want %d", rec.Code, wantCode)
- }
- return nil
- }
- }
- hasContents := func(want string) checkFunc {
- return func(rec *ResponseRecorder) error {
- if rec.Body.String() != want {
- return fmt.Errorf("wrote = %q; want %q", rec.Body.String(), want)
- }
- return nil
- }
- }
- hasFlush := func(want bool) checkFunc {
- return func(rec *ResponseRecorder) error {
- if rec.Flushed != want {
- return fmt.Errorf("Flushed = %v; want %v", rec.Flushed, want)
- }
- return nil
- }
- }
-
- tests := []struct {
- name string
- h func(w http.ResponseWriter, r *http.Request)
- checks []checkFunc
- }{
- {
- "200 default",
- func(w http.ResponseWriter, r *http.Request) {},
- check(hasStatus(200), hasContents("")),
- },
- {
- "first code only",
- func(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(201)
- w.WriteHeader(202)
- w.Write([]byte("hi"))
- },
- check(hasStatus(201), hasContents("hi")),
- },
- {
- "write sends 200",
- func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte("hi first"))
- w.WriteHeader(201)
- w.WriteHeader(202)
- },
- check(hasStatus(200), hasContents("hi first"), hasFlush(false)),
- },
- {
- "flush",
- func(w http.ResponseWriter, r *http.Request) {
- w.(http.Flusher).Flush() // also sends a 200
- w.WriteHeader(201)
- },
- check(hasStatus(200), hasFlush(true)),
- },
- }
- r, _ := http.NewRequest("GET", "http://foo.com/", nil)
- for _, tt := range tests {
- h := http.HandlerFunc(tt.h)
- rec := NewRecorder()
- h.ServeHTTP(rec, r)
- for _, check := range tt.checks {
- if err := check(rec); err != nil {
- t.Errorf("%s: %v", tt.name, err)
- }
- }
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,228 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Implementation of Server
-
-package httptest
-
-import (
- "crypto/tls"
- "flag"
- "fmt"
- "net"
- "net/http"
- "os"
- "sync"
-)
-
-// A Server is an HTTP server listening on a system-chosen port on the
-// local loopback interface, for use in end-to-end HTTP tests.
-type Server struct {
- URL string // base URL of form http://ipaddr:port with no trailing slash
- Listener net.Listener
-
- // TLS is the optional TLS configuration, populated with a new config
- // after TLS is started. If set on an unstarted server before StartTLS
- // is called, existing fields are copied into the new config.
- TLS *tls.Config
-
- // Config may be changed after calling NewUnstartedServer and
- // before Start or StartTLS.
- Config *http.Server
-
- // wg counts the number of outstanding HTTP requests on this server.
- // Close blocks until all requests are finished.
- wg sync.WaitGroup
-}
-
-// historyListener keeps track of all connections that it's ever
-// accepted.
-type historyListener struct {
- net.Listener
- sync.Mutex // protects history
- history []net.Conn
-}
-
-func (hs *historyListener) Accept() (c net.Conn, err error) {
- c, err = hs.Listener.Accept()
- if err == nil {
- hs.Lock()
- hs.history = append(hs.history, c)
- hs.Unlock()
- }
- return
-}
-
-func newLocalListener() net.Listener {
- if *serve != "" {
- l, err := net.Listen("tcp", *serve)
- if err != nil {
- panic(fmt.Sprintf("httptest: failed to listen on %v: %v", *serve, err))
- }
- return l
- }
- l, err := net.Listen("tcp", "127.0.0.1:0")
- if err != nil {
- if l, err = net.Listen("tcp6", "[::1]:0"); err != nil {
- panic(fmt.Sprintf("httptest: failed to listen on a port: %v", err))
- }
- }
- return l
-}
-
-// When debugging a particular http server-based test,
-// this flag lets you run
-// go test -run=BrokenTest -httptest.serve=127.0.0.1:8000
-// to start the broken server so you can interact with it manually.
-var serve = flag.String("httptest.serve", "", "if non-empty, httptest.NewServer serves on this address and blocks")
-
-// NewServer starts and returns a new Server.
-// The caller should call Close when finished, to shut it down.
-func NewServer(handler http.Handler) *Server {
- ts := NewUnstartedServer(handler)
- ts.Start()
- return ts
-}
-
-// NewUnstartedServer returns a new Server but doesn't start it.
-//
-// After changing its configuration, the caller should call Start or
-// StartTLS.
-//
-// The caller should call Close when finished, to shut it down.
-func NewUnstartedServer(handler http.Handler) *Server {
- return &Server{
- Listener: newLocalListener(),
- Config: &http.Server{Handler: handler},
- }
-}
-
-// Start starts a server from NewUnstartedServer.
-func (s *Server) Start() {
- if s.URL != "" {
- panic("Server already started")
- }
- s.Listener = &historyListener{Listener: s.Listener}
- s.URL = "http://" + s.Listener.Addr().String()
- s.wrapHandler()
- go s.Config.Serve(s.Listener)
- if *serve != "" {
- fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL)
- select {}
- }
-}
-
-// StartTLS starts TLS on a server from NewUnstartedServer.
-func (s *Server) StartTLS() {
- if s.URL != "" {
- panic("Server already started")
- }
- cert, err := tls.X509KeyPair(localhostCert, localhostKey)
- if err != nil {
- panic(fmt.Sprintf("httptest: NewTLSServer: %v", err))
- }
-
- existingConfig := s.TLS
- s.TLS = new(tls.Config)
- if existingConfig != nil {
- *s.TLS = *existingConfig
- }
- if s.TLS.NextProtos == nil {
- s.TLS.NextProtos = []string{"http/1.1"}
- }
- if len(s.TLS.Certificates) == 0 {
- s.TLS.Certificates = []tls.Certificate{cert}
- }
- tlsListener := tls.NewListener(s.Listener, s.TLS)
-
- s.Listener = &historyListener{Listener: tlsListener}
- s.URL = "https://" + s.Listener.Addr().String()
- s.wrapHandler()
- go s.Config.Serve(s.Listener)
-}
-
-func (s *Server) wrapHandler() {
- h := s.Config.Handler
- if h == nil {
- h = http.DefaultServeMux
- }
- s.Config.Handler = &waitGroupHandler{
- s: s,
- h: h,
- }
-}
-
-// NewTLSServer starts and returns a new Server using TLS.
-// The caller should call Close when finished, to shut it down.
-func NewTLSServer(handler http.Handler) *Server {
- ts := NewUnstartedServer(handler)
- ts.StartTLS()
- return ts
-}
-
-// Close shuts down the server and blocks until all outstanding
-// requests on this server have completed.
-func (s *Server) Close() {
- s.Listener.Close()
- s.wg.Wait()
- s.CloseClientConnections()
- if t, ok := http.DefaultTransport.(*http.Transport); ok {
- t.CloseIdleConnections()
- }
-}
-
-// CloseClientConnections closes any currently open HTTP connections
-// to the test Server.
-func (s *Server) CloseClientConnections() {
- hl, ok := s.Listener.(*historyListener)
- if !ok {
- return
- }
- hl.Lock()
- for _, conn := range hl.history {
- conn.Close()
- }
- hl.Unlock()
-}
-
-// waitGroupHandler wraps a handler, incrementing and decrementing a
-// sync.WaitGroup on each request, to enable Server.Close to block
-// until outstanding requests are finished.
-type waitGroupHandler struct {
- s *Server
- h http.Handler // non-nil
-}
-
-func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- h.s.wg.Add(1)
- defer h.s.wg.Done() // a defer, in case ServeHTTP below panics
- h.h.ServeHTTP(w, r)
-}
-
-// localhostCert is a PEM-encoded TLS cert with SAN IPs
-// "127.0.0.1" and "[::1]", expiring at the last second of 2049 (the end
-// of ASN.1 time).
-// generated from src/pkg/crypto/tls:
-// go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h
-var localhostCert = []byte(`-----BEGIN CERTIFICATE-----
-MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD
-bzAeFw03MDAxMDEwMDAwMDBaFw00OTEyMzEyMzU5NTlaMBIxEDAOBgNVBAoTB0Fj
-bWUgQ28wWjALBgkqhkiG9w0BAQEDSwAwSAJBAN55NcYKZeInyTuhcCwFMhDHCmwa
-IUSdtXdcbItRB/yfXGBhiex00IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEA
-AaNoMGYwDgYDVR0PAQH/BAQDAgCkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1Ud
-EwEB/wQFMAMBAf8wLgYDVR0RBCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAA
-AAAAAAAAAAAAAAEwCwYJKoZIhvcNAQEFA0EAAoQn/ytgqpiLcZu9XKbCJsJcvkgk
-Se6AbGXgSlq+ZCEVo0qIwSgeBqmsJxUu7NCSOwVJLYNEBO2DtIxoYVk+MA==
------END CERTIFICATE-----`)
-
-// localhostKey is the private key for localhostCert.
-var localhostKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
-MIIBPAIBAAJBAN55NcYKZeInyTuhcCwFMhDHCmwaIUSdtXdcbItRB/yfXGBhiex0
-0IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEAAQJBAQdUx66rfh8sYsgfdcvV
-NoafYpnEcB5s4m/vSVe6SU7dCK6eYec9f9wpT353ljhDUHq3EbmE4foNzJngh35d
-AekCIQDhRQG5Li0Wj8TM4obOnnXUXf1jRv0UkzE9AHWLG5q3AwIhAPzSjpYUDjVW
-MCUXgckTpKCuGwbJk7424Nb8bLzf3kllAiA5mUBgjfr/WtFSJdWcPQ4Zt9KTMNKD
-EUO0ukpTwEIl6wIhAMbGqZK3zAAFdq8DD2jPx+UJXnh0rnOkZBzDtJ6/iN69AiEA
-1Aq8MJgTaYsDQWyU/hDq5YkDJc9e9DSCvUIzqxQWMQE=
------END RSA PRIVATE KEY-----`)
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httptest/server_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,52 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httptest
-
-import (
- "io/ioutil"
- "net/http"
- "testing"
- "time"
-)
-
-func TestServer(t *testing.T) {
- ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte("hello"))
- }))
- defer ts.Close()
- res, err := http.Get(ts.URL)
- if err != nil {
- t.Fatal(err)
- }
- got, err := ioutil.ReadAll(res.Body)
- if err != nil {
- t.Fatal(err)
- }
- if string(got) != "hello" {
- t.Errorf("got %q, want hello", string(got))
- }
-}
-
-func TestIssue7264(t *testing.T) {
- for i := 0; i < 1000; i++ {
- func() {
- inHandler := make(chan bool, 1)
- ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- inHandler <- true
- }))
- defer ts.Close()
- tr := &http.Transport{
- ResponseHeaderTimeout: time.Nanosecond,
- }
- defer tr.CloseIdleConnections()
- c := &http.Client{Transport: tr}
- res, err := c.Get(ts.URL)
- <-inHandler
- if err == nil {
- res.Body.Close()
- }
- }()
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,203 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// The wire protocol for HTTP's "chunked" Transfer-Encoding.
-
-// This code is duplicated in net/http and net/http/httputil.
-// Please make any changes in both files.
-
-package httputil
-
-import (
- "bufio"
- "bytes"
- "errors"
- "fmt"
- "io"
-)
-
-const maxLineLength = 4096 // assumed <= bufio.defaultBufSize
-
-var ErrLineTooLong = errors.New("header line too long")
-
-// newChunkedReader returns a new chunkedReader that translates the data read from r
-// out of HTTP "chunked" format before returning it.
-// The chunkedReader returns io.EOF when the final 0-length chunk is read.
-//
-// newChunkedReader is not needed by normal applications. The http package
-// automatically decodes chunking when reading response bodies.
-func newChunkedReader(r io.Reader) io.Reader {
- br, ok := r.(*bufio.Reader)
- if !ok {
- br = bufio.NewReader(r)
- }
- return &chunkedReader{r: br}
-}
-
-type chunkedReader struct {
- r *bufio.Reader
- n uint64 // unread bytes in chunk
- err error
- buf [2]byte
-}
-
-func (cr *chunkedReader) beginChunk() {
- // chunk-size CRLF
- var line []byte
- line, cr.err = readLine(cr.r)
- if cr.err != nil {
- return
- }
- cr.n, cr.err = parseHexUint(line)
- if cr.err != nil {
- return
- }
- if cr.n == 0 {
- cr.err = io.EOF
- }
-}
-
-func (cr *chunkedReader) chunkHeaderAvailable() bool {
- n := cr.r.Buffered()
- if n > 0 {
- peek, _ := cr.r.Peek(n)
- return bytes.IndexByte(peek, '\n') >= 0
- }
- return false
-}
-
-func (cr *chunkedReader) Read(b []uint8) (n int, err error) {
- for cr.err == nil {
- if cr.n == 0 {
- if n > 0 && !cr.chunkHeaderAvailable() {
- // We've read enough. Don't potentially block
- // reading a new chunk header.
- break
- }
- cr.beginChunk()
- continue
- }
- if len(b) == 0 {
- break
- }
- rbuf := b
- if uint64(len(rbuf)) > cr.n {
- rbuf = rbuf[:cr.n]
- }
- var n0 int
- n0, cr.err = cr.r.Read(rbuf)
- n += n0
- b = b[n0:]
- cr.n -= uint64(n0)
- // If we're at the end of a chunk, read the next two
- // bytes to verify they are "\r\n".
- if cr.n == 0 && cr.err == nil {
- if _, cr.err = io.ReadFull(cr.r, cr.buf[:2]); cr.err == nil {
- if cr.buf[0] != '\r' || cr.buf[1] != '\n' {
- cr.err = errors.New("malformed chunked encoding")
- }
- }
- }
- }
- return n, cr.err
-}
-
-// Read a line of bytes (up to \n) from b.
-// Give up if the line exceeds maxLineLength.
-// The returned bytes are a pointer into storage in
-// the bufio, so they are only valid until the next bufio read.
-func readLine(b *bufio.Reader) (p []byte, err error) {
- if p, err = b.ReadSlice('\n'); err != nil {
- // We always know when EOF is coming.
- // If the caller asked for a line, there should be a line.
- if err == io.EOF {
- err = io.ErrUnexpectedEOF
- } else if err == bufio.ErrBufferFull {
- err = ErrLineTooLong
- }
- return nil, err
- }
- if len(p) >= maxLineLength {
- return nil, ErrLineTooLong
- }
- return trimTrailingWhitespace(p), nil
-}
-
-func trimTrailingWhitespace(b []byte) []byte {
- for len(b) > 0 && isASCIISpace(b[len(b)-1]) {
- b = b[:len(b)-1]
- }
- return b
-}
-
-func isASCIISpace(b byte) bool {
- return b == ' ' || b == '\t' || b == '\n' || b == '\r'
-}
-
-// newChunkedWriter returns a new chunkedWriter that translates writes into HTTP
-// "chunked" format before writing them to w. Closing the returned chunkedWriter
-// sends the final 0-length chunk that marks the end of the stream.
-//
-// newChunkedWriter is not needed by normal applications. The http
-// package adds chunking automatically if handlers don't set a
-// Content-Length header. Using newChunkedWriter inside a handler
-// would result in double chunking or chunking with a Content-Length
-// length, both of which are wrong.
-func newChunkedWriter(w io.Writer) io.WriteCloser {
- return &chunkedWriter{w}
-}
-
-// Writing to chunkedWriter translates to writing in HTTP chunked Transfer
-// Encoding wire format to the underlying Wire chunkedWriter.
-type chunkedWriter struct {
- Wire io.Writer
-}
-
-// Write the contents of data as one chunk to Wire.
-// NOTE: Note that the corresponding chunk-writing procedure in Conn.Write has
-// a bug since it does not check for success of io.WriteString
-func (cw *chunkedWriter) Write(data []byte) (n int, err error) {
-
- // Don't send 0-length data. It looks like EOF for chunked encoding.
- if len(data) == 0 {
- return 0, nil
- }
-
- if _, err = fmt.Fprintf(cw.Wire, "%x\r\n", len(data)); err != nil {
- return 0, err
- }
- if n, err = cw.Wire.Write(data); err != nil {
- return
- }
- if n != len(data) {
- err = io.ErrShortWrite
- return
- }
- _, err = io.WriteString(cw.Wire, "\r\n")
-
- return
-}
-
-func (cw *chunkedWriter) Close() error {
- _, err := io.WriteString(cw.Wire, "0\r\n")
- return err
-}
-
-func parseHexUint(v []byte) (n uint64, err error) {
- for _, b := range v {
- n <<= 4
- switch {
- case '0' <= b && b <= '9':
- b = b - '0'
- case 'a' <= b && b <= 'f':
- b = b - 'a' + 10
- case 'A' <= b && b <= 'F':
- b = b - 'A' + 10
- default:
- return 0, errors.New("invalid byte in chunk length")
- }
- n |= uint64(b)
- }
- return
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/chunked_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,159 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This code is duplicated in net/http and net/http/httputil.
-// Please make any changes in both files.
-
-package httputil
-
-import (
- "bufio"
- "bytes"
- "fmt"
- "io"
- "io/ioutil"
- "strings"
- "testing"
-)
-
-func TestChunk(t *testing.T) {
- var b bytes.Buffer
-
- w := newChunkedWriter(&b)
- const chunk1 = "hello, "
- const chunk2 = "world! 0123456789abcdef"
- w.Write([]byte(chunk1))
- w.Write([]byte(chunk2))
- w.Close()
-
- if g, e := b.String(), "7\r\nhello, \r\n17\r\nworld! 0123456789abcdef\r\n0\r\n"; g != e {
- t.Fatalf("chunk writer wrote %q; want %q", g, e)
- }
-
- r := newChunkedReader(&b)
- data, err := ioutil.ReadAll(r)
- if err != nil {
- t.Logf(`data: "%s"`, data)
- t.Fatalf("ReadAll from reader: %v", err)
- }
- if g, e := string(data), chunk1+chunk2; g != e {
- t.Errorf("chunk reader read %q; want %q", g, e)
- }
-}
-
-func TestChunkReadMultiple(t *testing.T) {
- // Bunch of small chunks, all read together.
- {
- var b bytes.Buffer
- w := newChunkedWriter(&b)
- w.Write([]byte("foo"))
- w.Write([]byte("bar"))
- w.Close()
-
- r := newChunkedReader(&b)
- buf := make([]byte, 10)
- n, err := r.Read(buf)
- if n != 6 || err != io.EOF {
- t.Errorf("Read = %d, %v; want 6, EOF", n, err)
- }
- buf = buf[:n]
- if string(buf) != "foobar" {
- t.Errorf("Read = %q; want %q", buf, "foobar")
- }
- }
-
- // One big chunk followed by a little chunk, but the small bufio.Reader size
- // should prevent the second chunk header from being read.
- {
- var b bytes.Buffer
- w := newChunkedWriter(&b)
- // fillBufChunk is 11 bytes + 3 bytes header + 2 bytes footer = 16 bytes,
- // the same as the bufio ReaderSize below (the minimum), so even
- // though we're going to try to Read with a buffer larger enough to also
- // receive "foo", the second chunk header won't be read yet.
- const fillBufChunk = "0123456789a"
- const shortChunk = "foo"
- w.Write([]byte(fillBufChunk))
- w.Write([]byte(shortChunk))
- w.Close()
-
- r := newChunkedReader(bufio.NewReaderSize(&b, 16))
- buf := make([]byte, len(fillBufChunk)+len(shortChunk))
- n, err := r.Read(buf)
- if n != len(fillBufChunk) || err != nil {
- t.Errorf("Read = %d, %v; want %d, nil", n, err, len(fillBufChunk))
- }
- buf = buf[:n]
- if string(buf) != fillBufChunk {
- t.Errorf("Read = %q; want %q", buf, fillBufChunk)
- }
-
- n, err = r.Read(buf)
- if n != len(shortChunk) || err != io.EOF {
- t.Errorf("Read = %d, %v; want %d, EOF", n, err, len(shortChunk))
- }
- }
-
- // And test that we see an EOF chunk, even though our buffer is already full:
- {
- r := newChunkedReader(bufio.NewReader(strings.NewReader("3\r\nfoo\r\n0\r\n")))
- buf := make([]byte, 3)
- n, err := r.Read(buf)
- if n != 3 || err != io.EOF {
- t.Errorf("Read = %d, %v; want 3, EOF", n, err)
- }
- if string(buf) != "foo" {
- t.Errorf("buf = %q; want foo", buf)
- }
- }
-}
-
-func TestChunkReaderAllocs(t *testing.T) {
- if testing.Short() {
- t.Skip("skipping in short mode")
- }
- var buf bytes.Buffer
- w := newChunkedWriter(&buf)
- a, b, c := []byte("aaaaaa"), []byte("bbbbbbbbbbbb"), []byte("cccccccccccccccccccccccc")
- w.Write(a)
- w.Write(b)
- w.Write(c)
- w.Close()
-
- readBuf := make([]byte, len(a)+len(b)+len(c)+1)
- byter := bytes.NewReader(buf.Bytes())
- bufr := bufio.NewReader(byter)
- mallocs := testing.AllocsPerRun(100, func() {
- byter.Seek(0, 0)
- bufr.Reset(byter)
- r := newChunkedReader(bufr)
- n, err := io.ReadFull(r, readBuf)
- if n != len(readBuf)-1 {
- t.Fatalf("read %d bytes; want %d", n, len(readBuf)-1)
- }
- if err != io.ErrUnexpectedEOF {
- t.Fatalf("read error = %v; want ErrUnexpectedEOF", err)
- }
- })
- if mallocs > 1.5 {
- t.Errorf("mallocs = %v; want 1", mallocs)
- }
-}
-
-func TestParseHexUint(t *testing.T) {
- for i := uint64(0); i <= 1234; i++ {
- line := []byte(fmt.Sprintf("%x", i))
- got, err := parseHexUint(line)
- if err != nil {
- t.Fatalf("on %d: %v", i, err)
- }
- if got != i {
- t.Errorf("for input %q = %d; want %d", line, got, i)
- }
- }
- _, err := parseHexUint([]byte("bogus"))
- if err == nil {
- t.Error("expected error on bogus input")
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,276 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httputil
-
-import (
- "bufio"
- "bytes"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "net/http"
- "net/url"
- "strings"
- "time"
-)
-
-// One of the copies, say from b to r2, could be avoided by using a more
-// elaborate trick where the other copy is made during Request/Response.Write.
-// This would complicate things too much, given that these functions are for
-// debugging only.
-func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) {
- var buf bytes.Buffer
- if _, err = buf.ReadFrom(b); err != nil {
- return nil, nil, err
- }
- if err = b.Close(); err != nil {
- return nil, nil, err
- }
- return ioutil.NopCloser(&buf), ioutil.NopCloser(bytes.NewReader(buf.Bytes())), nil
-}
-
-// dumpConn is a net.Conn which writes to Writer and reads from Reader
-type dumpConn struct {
- io.Writer
- io.Reader
-}
-
-func (c *dumpConn) Close() error { return nil }
-func (c *dumpConn) LocalAddr() net.Addr { return nil }
-func (c *dumpConn) RemoteAddr() net.Addr { return nil }
-func (c *dumpConn) SetDeadline(t time.Time) error { return nil }
-func (c *dumpConn) SetReadDeadline(t time.Time) error { return nil }
-func (c *dumpConn) SetWriteDeadline(t time.Time) error { return nil }
-
-type neverEnding byte
-
-func (b neverEnding) Read(p []byte) (n int, err error) {
- for i := range p {
- p[i] = byte(b)
- }
- return len(p), nil
-}
-
-// DumpRequestOut is like DumpRequest but includes
-// headers that the standard http.Transport adds,
-// such as User-Agent.
-func DumpRequestOut(req *http.Request, body bool) ([]byte, error) {
- save := req.Body
- dummyBody := false
- if !body || req.Body == nil {
- req.Body = nil
- if req.ContentLength != 0 {
- req.Body = ioutil.NopCloser(io.LimitReader(neverEnding('x'), req.ContentLength))
- dummyBody = true
- }
- } else {
- var err error
- save, req.Body, err = drainBody(req.Body)
- if err != nil {
- return nil, err
- }
- }
-
- // Since we're using the actual Transport code to write the request,
- // switch to http so the Transport doesn't try to do an SSL
- // negotiation with our dumpConn and its bytes.Buffer & pipe.
- // The wire format for https and http are the same, anyway.
- reqSend := req
- if req.URL.Scheme == "https" {
- reqSend = new(http.Request)
- *reqSend = *req
- reqSend.URL = new(url.URL)
- *reqSend.URL = *req.URL
- reqSend.URL.Scheme = "http"
- }
-
- // Use the actual Transport code to record what we would send
- // on the wire, but not using TCP. Use a Transport with a
- // custom dialer that returns a fake net.Conn that waits
- // for the full input (and recording it), and then responds
- // with a dummy response.
- var buf bytes.Buffer // records the output
- pr, pw := io.Pipe()
- dr := &delegateReader{c: make(chan io.Reader)}
- // Wait for the request before replying with a dummy response:
- go func() {
- http.ReadRequest(bufio.NewReader(pr))
- dr.c <- strings.NewReader("HTTP/1.1 204 No Content\r\n\r\n")
- }()
-
- t := &http.Transport{
- Dial: func(net, addr string) (net.Conn, error) {
- return &dumpConn{io.MultiWriter(&buf, pw), dr}, nil
- },
- }
- defer t.CloseIdleConnections()
-
- _, err := t.RoundTrip(reqSend)
-
- req.Body = save
- if err != nil {
- return nil, err
- }
- dump := buf.Bytes()
-
- // If we used a dummy body above, remove it now.
- // TODO: if the req.ContentLength is large, we allocate memory
- // unnecessarily just to slice it off here. But this is just
- // a debug function, so this is acceptable for now. We could
- // discard the body earlier if this matters.
- if dummyBody {
- if i := bytes.Index(dump, []byte("\r\n\r\n")); i >= 0 {
- dump = dump[:i+4]
- }
- }
- return dump, nil
-}
-
-// delegateReader is a reader that delegates to another reader,
-// once it arrives on a channel.
-type delegateReader struct {
- c chan io.Reader
- r io.Reader // nil until received from c
-}
-
-func (r *delegateReader) Read(p []byte) (int, error) {
- if r.r == nil {
- r.r = <-r.c
- }
- return r.r.Read(p)
-}
-
-// Return value if nonempty, def otherwise.
-func valueOrDefault(value, def string) string {
- if value != "" {
- return value
- }
- return def
-}
-
-var reqWriteExcludeHeaderDump = map[string]bool{
- "Host": true, // not in Header map anyway
- "Content-Length": true,
- "Transfer-Encoding": true,
- "Trailer": true,
-}
-
-// dumpAsReceived writes req to w in the form as it was received, or
-// at least as accurately as possible from the information retained in
-// the request.
-func dumpAsReceived(req *http.Request, w io.Writer) error {
- return nil
-}
-
-// DumpRequest returns the as-received wire representation of req,
-// optionally including the request body, for debugging.
-// DumpRequest is semantically a no-op, but in order to
-// dump the body, it reads the body data into memory and
-// changes req.Body to refer to the in-memory copy.
-// The documentation for http.Request.Write details which fields
-// of req are used.
-func DumpRequest(req *http.Request, body bool) (dump []byte, err error) {
- save := req.Body
- if !body || req.Body == nil {
- req.Body = nil
- } else {
- save, req.Body, err = drainBody(req.Body)
- if err != nil {
- return
- }
- }
-
- var b bytes.Buffer
-
- fmt.Fprintf(&b, "%s %s HTTP/%d.%d\r\n", valueOrDefault(req.Method, "GET"),
- req.URL.RequestURI(), req.ProtoMajor, req.ProtoMinor)
-
- host := req.Host
- if host == "" && req.URL != nil {
- host = req.URL.Host
- }
- if host != "" {
- fmt.Fprintf(&b, "Host: %s\r\n", host)
- }
-
- chunked := len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked"
- if len(req.TransferEncoding) > 0 {
- fmt.Fprintf(&b, "Transfer-Encoding: %s\r\n", strings.Join(req.TransferEncoding, ","))
- }
- if req.Close {
- fmt.Fprintf(&b, "Connection: close\r\n")
- }
-
- err = req.Header.WriteSubset(&b, reqWriteExcludeHeaderDump)
- if err != nil {
- return
- }
-
- io.WriteString(&b, "\r\n")
-
- if req.Body != nil {
- var dest io.Writer = &b
- if chunked {
- dest = NewChunkedWriter(dest)
- }
- _, err = io.Copy(dest, req.Body)
- if chunked {
- dest.(io.Closer).Close()
- io.WriteString(&b, "\r\n")
- }
- }
-
- req.Body = save
- if err != nil {
- return
- }
- dump = b.Bytes()
- return
-}
-
-// errNoBody is a sentinel error value used by failureToReadBody so we can detect
-// that the lack of body was intentional.
-var errNoBody = errors.New("sentinel error value")
-
-// failureToReadBody is a io.ReadCloser that just returns errNoBody on
-// Read. It's swapped in when we don't actually want to consume the
-// body, but need a non-nil one, and want to distinguish the error
-// from reading the dummy body.
-type failureToReadBody struct{}
-
-func (failureToReadBody) Read([]byte) (int, error) { return 0, errNoBody }
-func (failureToReadBody) Close() error { return nil }
-
-var emptyBody = ioutil.NopCloser(strings.NewReader(""))
-
-// DumpResponse is like DumpRequest but dumps a response.
-func DumpResponse(resp *http.Response, body bool) (dump []byte, err error) {
- var b bytes.Buffer
- save := resp.Body
- savecl := resp.ContentLength
-
- if !body {
- resp.Body = failureToReadBody{}
- } else if resp.Body == nil {
- resp.Body = emptyBody
- } else {
- save, resp.Body, err = drainBody(resp.Body)
- if err != nil {
- return
- }
- }
- err = resp.Write(&b)
- if err == errNoBody {
- err = nil
- }
- resp.Body = save
- resp.ContentLength = savecl
- if err != nil {
- return nil, err
- }
- return b.Bytes(), nil
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/dump_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,263 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httputil
-
-import (
- "bytes"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "net/url"
- "runtime"
- "strings"
- "testing"
-)
-
-type dumpTest struct {
- Req http.Request
- Body interface{} // optional []byte or func() io.ReadCloser to populate Req.Body
-
- WantDump string
- WantDumpOut string
- NoBody bool // if true, set DumpRequest{,Out} body to false
-}
-
-var dumpTests = []dumpTest{
-
- // HTTP/1.1 => chunked coding; body; empty trailer
- {
- Req: http.Request{
- Method: "GET",
- URL: &url.URL{
- Scheme: "http",
- Host: "www.google.com",
- Path: "/search",
- },
- ProtoMajor: 1,
- ProtoMinor: 1,
- TransferEncoding: []string{"chunked"},
- },
-
- Body: []byte("abcdef"),
-
- WantDump: "GET /search HTTP/1.1\r\n" +
- "Host: www.google.com\r\n" +
- "Transfer-Encoding: chunked\r\n\r\n" +
- chunk("abcdef") + chunk(""),
- },
-
- // Verify that DumpRequest preserves the HTTP version number, doesn't add a Host,
- // and doesn't add a User-Agent.
- {
- Req: http.Request{
- Method: "GET",
- URL: mustParseURL("/foo"),
- ProtoMajor: 1,
- ProtoMinor: 0,
- Header: http.Header{
- "X-Foo": []string{"X-Bar"},
- },
- },
-
- WantDump: "GET /foo HTTP/1.0\r\n" +
- "X-Foo: X-Bar\r\n\r\n",
- },
-
- {
- Req: *mustNewRequest("GET", "http://example.com/foo", nil),
-
- WantDumpOut: "GET /foo HTTP/1.1\r\n" +
- "Host: example.com\r\n" +
- "User-Agent: Go 1.1 package http\r\n" +
- "Accept-Encoding: gzip\r\n\r\n",
- },
-
- // Test that an https URL doesn't try to do an SSL negotiation
- // with a bytes.Buffer and hang with all goroutines not
- // runnable.
- {
- Req: *mustNewRequest("GET", "https://example.com/foo", nil),
-
- WantDumpOut: "GET /foo HTTP/1.1\r\n" +
- "Host: example.com\r\n" +
- "User-Agent: Go 1.1 package http\r\n" +
- "Accept-Encoding: gzip\r\n\r\n",
- },
-
- // Request with Body, but Dump requested without it.
- {
- Req: http.Request{
- Method: "POST",
- URL: &url.URL{
- Scheme: "http",
- Host: "post.tld",
- Path: "/",
- },
- ContentLength: 6,
- ProtoMajor: 1,
- ProtoMinor: 1,
- },
-
- Body: []byte("abcdef"),
-
- WantDumpOut: "POST / HTTP/1.1\r\n" +
- "Host: post.tld\r\n" +
- "User-Agent: Go 1.1 package http\r\n" +
- "Content-Length: 6\r\n" +
- "Accept-Encoding: gzip\r\n\r\n",
-
- NoBody: true,
- },
-}
-
-func TestDumpRequest(t *testing.T) {
- numg0 := runtime.NumGoroutine()
- for i, tt := range dumpTests {
- setBody := func() {
- if tt.Body == nil {
- return
- }
- switch b := tt.Body.(type) {
- case []byte:
- tt.Req.Body = ioutil.NopCloser(bytes.NewReader(b))
- case func() io.ReadCloser:
- tt.Req.Body = b()
- }
- }
- setBody()
- if tt.Req.Header == nil {
- tt.Req.Header = make(http.Header)
- }
-
- if tt.WantDump != "" {
- setBody()
- dump, err := DumpRequest(&tt.Req, !tt.NoBody)
- if err != nil {
- t.Errorf("DumpRequest #%d: %s", i, err)
- continue
- }
- if string(dump) != tt.WantDump {
- t.Errorf("DumpRequest %d, expecting:\n%s\nGot:\n%s\n", i, tt.WantDump, string(dump))
- continue
- }
- }
-
- if tt.WantDumpOut != "" {
- setBody()
- dump, err := DumpRequestOut(&tt.Req, !tt.NoBody)
- if err != nil {
- t.Errorf("DumpRequestOut #%d: %s", i, err)
- continue
- }
- if string(dump) != tt.WantDumpOut {
- t.Errorf("DumpRequestOut %d, expecting:\n%s\nGot:\n%s\n", i, tt.WantDumpOut, string(dump))
- continue
- }
- }
- }
- if dg := runtime.NumGoroutine() - numg0; dg > 4 {
- t.Errorf("Unexpectedly large number of new goroutines: %d new", dg)
- }
-}
-
-func chunk(s string) string {
- return fmt.Sprintf("%x\r\n%s\r\n", len(s), s)
-}
-
-func mustParseURL(s string) *url.URL {
- u, err := url.Parse(s)
- if err != nil {
- panic(fmt.Sprintf("Error parsing URL %q: %v", s, err))
- }
- return u
-}
-
-func mustNewRequest(method, url string, body io.Reader) *http.Request {
- req, err := http.NewRequest(method, url, body)
- if err != nil {
- panic(fmt.Sprintf("NewRequest(%q, %q, %p) err = %v", method, url, body, err))
- }
- return req
-}
-
-var dumpResTests = []struct {
- res *http.Response
- body bool
- want string
-}{
- {
- res: &http.Response{
- Status: "200 OK",
- StatusCode: 200,
- Proto: "HTTP/1.1",
- ProtoMajor: 1,
- ProtoMinor: 1,
- ContentLength: 50,
- Header: http.Header{
- "Foo": []string{"Bar"},
- },
- Body: ioutil.NopCloser(strings.NewReader("foo")), // shouldn't be used
- },
- body: false, // to verify we see 50, not empty or 3.
- want: `HTTP/1.1 200 OK
-Content-Length: 50
-Foo: Bar`,
- },
-
- {
- res: &http.Response{
- Status: "200 OK",
- StatusCode: 200,
- Proto: "HTTP/1.1",
- ProtoMajor: 1,
- ProtoMinor: 1,
- ContentLength: 3,
- Body: ioutil.NopCloser(strings.NewReader("foo")),
- },
- body: true,
- want: `HTTP/1.1 200 OK
-Content-Length: 3
-
-foo`,
- },
-
- {
- res: &http.Response{
- Status: "200 OK",
- StatusCode: 200,
- Proto: "HTTP/1.1",
- ProtoMajor: 1,
- ProtoMinor: 1,
- ContentLength: -1,
- Body: ioutil.NopCloser(strings.NewReader("foo")),
- TransferEncoding: []string{"chunked"},
- },
- body: true,
- want: `HTTP/1.1 200 OK
-Transfer-Encoding: chunked
-
-3
-foo
-0`,
- },
-}
-
-func TestDumpResponse(t *testing.T) {
- for i, tt := range dumpResTests {
- gotb, err := DumpResponse(tt.res, tt.body)
- if err != nil {
- t.Errorf("%d. DumpResponse = %v", i, err)
- continue
- }
- got := string(gotb)
- got = strings.TrimSpace(got)
- got = strings.Replace(got, "\r", "", -1)
-
- if got != tt.want {
- t.Errorf("%d.\nDumpResponse got:\n%s\n\nWant:\n%s\n", i, got, tt.want)
- }
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/httputil.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,32 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package httputil provides HTTP utility functions, complementing the
-// more common ones in the net/http package.
-package httputil
-
-import "io"
-
-// NewChunkedReader returns a new chunkedReader that translates the data read from r
-// out of HTTP "chunked" format before returning it.
-// The chunkedReader returns io.EOF when the final 0-length chunk is read.
-//
-// NewChunkedReader is not needed by normal applications. The http package
-// automatically decodes chunking when reading response bodies.
-func NewChunkedReader(r io.Reader) io.Reader {
- return newChunkedReader(r)
-}
-
-// NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP
-// "chunked" format before writing them to w. Closing the returned chunkedWriter
-// sends the final 0-length chunk that marks the end of the stream.
-//
-// NewChunkedWriter is not needed by normal applications. The http
-// package adds chunking automatically if handlers don't set a
-// Content-Length header. Using NewChunkedWriter inside a handler
-// would result in double chunking or chunking with a Content-Length
-// length, both of which are wrong.
-func NewChunkedWriter(w io.Writer) io.WriteCloser {
- return newChunkedWriter(w)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/persist.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,429 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package httputil
-
-import (
- "bufio"
- "errors"
- "io"
- "net"
- "net/http"
- "net/textproto"
- "sync"
-)
-
-var (
- ErrPersistEOF = &http.ProtocolError{ErrorString: "persistent connection closed"}
- ErrClosed = &http.ProtocolError{ErrorString: "connection closed by user"}
- ErrPipeline = &http.ProtocolError{ErrorString: "pipeline error"}
-)
-
-// This is an API usage error - the local side is closed.
-// ErrPersistEOF (above) reports that the remote side is closed.
-var errClosed = errors.New("i/o operation on closed connection")
-
-// A ServerConn reads requests and sends responses over an underlying
-// connection, until the HTTP keepalive logic commands an end. ServerConn
-// also allows hijacking the underlying connection by calling Hijack
-// to regain control over the connection. ServerConn supports pipe-lining,
-// i.e. requests can be read out of sync (but in the same order) while the
-// respective responses are sent.
-//
-// ServerConn is low-level and old. Applications should instead use Server
-// in the net/http package.
-type ServerConn struct {
- lk sync.Mutex // read-write protects the following fields
- c net.Conn
- r *bufio.Reader
- re, we error // read/write errors
- lastbody io.ReadCloser
- nread, nwritten int
- pipereq map[*http.Request]uint
-
- pipe textproto.Pipeline
-}
-
-// NewServerConn returns a new ServerConn reading and writing c. If r is not
-// nil, it is the buffer to use when reading c.
-//
-// ServerConn is low-level and old. Applications should instead use Server
-// in the net/http package.
-func NewServerConn(c net.Conn, r *bufio.Reader) *ServerConn {
- if r == nil {
- r = bufio.NewReader(c)
- }
- return &ServerConn{c: c, r: r, pipereq: make(map[*http.Request]uint)}
-}
-
-// Hijack detaches the ServerConn and returns the underlying connection as well
-// as the read-side bufio which may have some left over data. Hijack may be
-// called before Read has signaled the end of the keep-alive logic. The user
-// should not call Hijack while Read or Write is in progress.
-func (sc *ServerConn) Hijack() (c net.Conn, r *bufio.Reader) {
- sc.lk.Lock()
- defer sc.lk.Unlock()
- c = sc.c
- r = sc.r
- sc.c = nil
- sc.r = nil
- return
-}
-
-// Close calls Hijack and then also closes the underlying connection
-func (sc *ServerConn) Close() error {
- c, _ := sc.Hijack()
- if c != nil {
- return c.Close()
- }
- return nil
-}
-
-// Read returns the next request on the wire. An ErrPersistEOF is returned if
-// it is gracefully determined that there are no more requests (e.g. after the
-// first request on an HTTP/1.0 connection, or after a Connection:close on a
-// HTTP/1.1 connection).
-func (sc *ServerConn) Read() (req *http.Request, err error) {
-
- // Ensure ordered execution of Reads and Writes
- id := sc.pipe.Next()
- sc.pipe.StartRequest(id)
- defer func() {
- sc.pipe.EndRequest(id)
- if req == nil {
- sc.pipe.StartResponse(id)
- sc.pipe.EndResponse(id)
- } else {
- // Remember the pipeline id of this request
- sc.lk.Lock()
- sc.pipereq[req] = id
- sc.lk.Unlock()
- }
- }()
-
- sc.lk.Lock()
- if sc.we != nil { // no point receiving if write-side broken or closed
- defer sc.lk.Unlock()
- return nil, sc.we
- }
- if sc.re != nil {
- defer sc.lk.Unlock()
- return nil, sc.re
- }
- if sc.r == nil { // connection closed by user in the meantime
- defer sc.lk.Unlock()
- return nil, errClosed
- }
- r := sc.r
- lastbody := sc.lastbody
- sc.lastbody = nil
- sc.lk.Unlock()
-
- // Make sure body is fully consumed, even if user does not call body.Close
- if lastbody != nil {
- // body.Close is assumed to be idempotent and multiple calls to
- // it should return the error that its first invocation
- // returned.
- err = lastbody.Close()
- if err != nil {
- sc.lk.Lock()
- defer sc.lk.Unlock()
- sc.re = err
- return nil, err
- }
- }
-
- req, err = http.ReadRequest(r)
- sc.lk.Lock()
- defer sc.lk.Unlock()
- if err != nil {
- if err == io.ErrUnexpectedEOF {
- // A close from the opposing client is treated as a
- // graceful close, even if there was some unparse-able
- // data before the close.
- sc.re = ErrPersistEOF
- return nil, sc.re
- } else {
- sc.re = err
- return req, err
- }
- }
- sc.lastbody = req.Body
- sc.nread++
- if req.Close {
- sc.re = ErrPersistEOF
- return req, sc.re
- }
- return req, err
-}
-
-// Pending returns the number of unanswered requests
-// that have been received on the connection.
-func (sc *ServerConn) Pending() int {
- sc.lk.Lock()
- defer sc.lk.Unlock()
- return sc.nread - sc.nwritten
-}
-
-// Write writes resp in response to req. To close the connection gracefully, set the
-// Response.Close field to true. Write should be considered operational until
-// it returns an error, regardless of any errors returned on the Read side.
-func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error {
-
- // Retrieve the pipeline ID of this request/response pair
- sc.lk.Lock()
- id, ok := sc.pipereq[req]
- delete(sc.pipereq, req)
- if !ok {
- sc.lk.Unlock()
- return ErrPipeline
- }
- sc.lk.Unlock()
-
- // Ensure pipeline order
- sc.pipe.StartResponse(id)
- defer sc.pipe.EndResponse(id)
-
- sc.lk.Lock()
- if sc.we != nil {
- defer sc.lk.Unlock()
- return sc.we
- }
- if sc.c == nil { // connection closed by user in the meantime
- defer sc.lk.Unlock()
- return ErrClosed
- }
- c := sc.c
- if sc.nread <= sc.nwritten {
- defer sc.lk.Unlock()
- return errors.New("persist server pipe count")
- }
- if resp.Close {
- // After signaling a keep-alive close, any pipelined unread
- // requests will be lost. It is up to the user to drain them
- // before signaling.
- sc.re = ErrPersistEOF
- }
- sc.lk.Unlock()
-
- err := resp.Write(c)
- sc.lk.Lock()
- defer sc.lk.Unlock()
- if err != nil {
- sc.we = err
- return err
- }
- sc.nwritten++
-
- return nil
-}
-
-// A ClientConn sends request and receives headers over an underlying
-// connection, while respecting the HTTP keepalive logic. ClientConn
-// supports hijacking the connection calling Hijack to
-// regain control of the underlying net.Conn and deal with it as desired.
-//
-// ClientConn is low-level and old. Applications should instead use
-// Client or Transport in the net/http package.
-type ClientConn struct {
- lk sync.Mutex // read-write protects the following fields
- c net.Conn
- r *bufio.Reader
- re, we error // read/write errors
- lastbody io.ReadCloser
- nread, nwritten int
- pipereq map[*http.Request]uint
-
- pipe textproto.Pipeline
- writeReq func(*http.Request, io.Writer) error
-}
-
-// NewClientConn returns a new ClientConn reading and writing c. If r is not
-// nil, it is the buffer to use when reading c.
-//
-// ClientConn is low-level and old. Applications should use Client or
-// Transport in the net/http package.
-func NewClientConn(c net.Conn, r *bufio.Reader) *ClientConn {
- if r == nil {
- r = bufio.NewReader(c)
- }
- return &ClientConn{
- c: c,
- r: r,
- pipereq: make(map[*http.Request]uint),
- writeReq: (*http.Request).Write,
- }
-}
-
-// NewProxyClientConn works like NewClientConn but writes Requests
-// using Request's WriteProxy method.
-//
-// New code should not use NewProxyClientConn. See Client or
-// Transport in the net/http package instead.
-func NewProxyClientConn(c net.Conn, r *bufio.Reader) *ClientConn {
- cc := NewClientConn(c, r)
- cc.writeReq = (*http.Request).WriteProxy
- return cc
-}
-
-// Hijack detaches the ClientConn and returns the underlying connection as well
-// as the read-side bufio which may have some left over data. Hijack may be
-// called before the user or Read have signaled the end of the keep-alive
-// logic. The user should not call Hijack while Read or Write is in progress.
-func (cc *ClientConn) Hijack() (c net.Conn, r *bufio.Reader) {
- cc.lk.Lock()
- defer cc.lk.Unlock()
- c = cc.c
- r = cc.r
- cc.c = nil
- cc.r = nil
- return
-}
-
-// Close calls Hijack and then also closes the underlying connection
-func (cc *ClientConn) Close() error {
- c, _ := cc.Hijack()
- if c != nil {
- return c.Close()
- }
- return nil
-}
-
-// Write writes a request. An ErrPersistEOF error is returned if the connection
-// has been closed in an HTTP keepalive sense. If req.Close equals true, the
-// keepalive connection is logically closed after this request and the opposing
-// server is informed. An ErrUnexpectedEOF indicates the remote closed the
-// underlying TCP connection, which is usually considered as graceful close.
-func (cc *ClientConn) Write(req *http.Request) (err error) {
-
- // Ensure ordered execution of Writes
- id := cc.pipe.Next()
- cc.pipe.StartRequest(id)
- defer func() {
- cc.pipe.EndRequest(id)
- if err != nil {
- cc.pipe.StartResponse(id)
- cc.pipe.EndResponse(id)
- } else {
- // Remember the pipeline id of this request
- cc.lk.Lock()
- cc.pipereq[req] = id
- cc.lk.Unlock()
- }
- }()
-
- cc.lk.Lock()
- if cc.re != nil { // no point sending if read-side closed or broken
- defer cc.lk.Unlock()
- return cc.re
- }
- if cc.we != nil {
- defer cc.lk.Unlock()
- return cc.we
- }
- if cc.c == nil { // connection closed by user in the meantime
- defer cc.lk.Unlock()
- return errClosed
- }
- c := cc.c
- if req.Close {
- // We write the EOF to the write-side error, because there
- // still might be some pipelined reads
- cc.we = ErrPersistEOF
- }
- cc.lk.Unlock()
-
- err = cc.writeReq(req, c)
- cc.lk.Lock()
- defer cc.lk.Unlock()
- if err != nil {
- cc.we = err
- return err
- }
- cc.nwritten++
-
- return nil
-}
-
-// Pending returns the number of unanswered requests
-// that have been sent on the connection.
-func (cc *ClientConn) Pending() int {
- cc.lk.Lock()
- defer cc.lk.Unlock()
- return cc.nwritten - cc.nread
-}
-
-// Read reads the next response from the wire. A valid response might be
-// returned together with an ErrPersistEOF, which means that the remote
-// requested that this be the last request serviced. Read can be called
-// concurrently with Write, but not with another Read.
-func (cc *ClientConn) Read(req *http.Request) (resp *http.Response, err error) {
- // Retrieve the pipeline ID of this request/response pair
- cc.lk.Lock()
- id, ok := cc.pipereq[req]
- delete(cc.pipereq, req)
- if !ok {
- cc.lk.Unlock()
- return nil, ErrPipeline
- }
- cc.lk.Unlock()
-
- // Ensure pipeline order
- cc.pipe.StartResponse(id)
- defer cc.pipe.EndResponse(id)
-
- cc.lk.Lock()
- if cc.re != nil {
- defer cc.lk.Unlock()
- return nil, cc.re
- }
- if cc.r == nil { // connection closed by user in the meantime
- defer cc.lk.Unlock()
- return nil, errClosed
- }
- r := cc.r
- lastbody := cc.lastbody
- cc.lastbody = nil
- cc.lk.Unlock()
-
- // Make sure body is fully consumed, even if user does not call body.Close
- if lastbody != nil {
- // body.Close is assumed to be idempotent and multiple calls to
- // it should return the error that its first invocation
- // returned.
- err = lastbody.Close()
- if err != nil {
- cc.lk.Lock()
- defer cc.lk.Unlock()
- cc.re = err
- return nil, err
- }
- }
-
- resp, err = http.ReadResponse(r, req)
- cc.lk.Lock()
- defer cc.lk.Unlock()
- if err != nil {
- cc.re = err
- return resp, err
- }
- cc.lastbody = resp.Body
-
- cc.nread++
-
- if resp.Close {
- cc.re = ErrPersistEOF // don't send any more requests
- return resp, cc.re
- }
- return resp, err
-}
-
-// Do is convenience method that writes a request and reads a response.
-func (cc *ClientConn) Do(req *http.Request) (resp *http.Response, err error) {
- err = cc.Write(req)
- if err != nil {
- return
- }
- return cc.Read(req)
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,211 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// HTTP reverse proxy handler
-
-package httputil
-
-import (
- "io"
- "log"
- "net"
- "net/http"
- "net/url"
- "strings"
- "sync"
- "time"
-)
-
-// onExitFlushLoop is a callback set by tests to detect the state of the
-// flushLoop() goroutine.
-var onExitFlushLoop func()
-
-// ReverseProxy is an HTTP Handler that takes an incoming request and
-// sends it to another server, proxying the response back to the
-// client.
-type ReverseProxy struct {
- // Director must be a function which modifies
- // the request into a new request to be sent
- // using Transport. Its response is then copied
- // back to the original client unmodified.
- Director func(*http.Request)
-
- // The transport used to perform proxy requests.
- // If nil, http.DefaultTransport is used.
- Transport http.RoundTripper
-
- // FlushInterval specifies the flush interval
- // to flush to the client while copying the
- // response body.
- // If zero, no periodic flushing is done.
- FlushInterval time.Duration
-}
-
-func singleJoiningSlash(a, b string) string {
- aslash := strings.HasSuffix(a, "/")
- bslash := strings.HasPrefix(b, "/")
- switch {
- case aslash && bslash:
- return a + b[1:]
- case !aslash && !bslash:
- return a + "/" + b
- }
- return a + b
-}
-
-// NewSingleHostReverseProxy returns a new ReverseProxy that rewrites
-// URLs to the scheme, host, and base path provided in target. If the
-// target's path is "/base" and the incoming request was for "/dir",
-// the target request will be for /base/dir.
-func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy {
- targetQuery := target.RawQuery
- director := func(req *http.Request) {
- req.URL.Scheme = target.Scheme
- req.URL.Host = target.Host
- req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
- if targetQuery == "" || req.URL.RawQuery == "" {
- req.URL.RawQuery = targetQuery + req.URL.RawQuery
- } else {
- req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery
- }
- }
- return &ReverseProxy{Director: director}
-}
-
-func copyHeader(dst, src http.Header) {
- for k, vv := range src {
- for _, v := range vv {
- dst.Add(k, v)
- }
- }
-}
-
-// Hop-by-hop headers. These are removed when sent to the backend.
-// http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
-var hopHeaders = []string{
- "Connection",
- "Keep-Alive",
- "Proxy-Authenticate",
- "Proxy-Authorization",
- "Te", // canonicalized version of "TE"
- "Trailers",
- "Transfer-Encoding",
- "Upgrade",
-}
-
-func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
- transport := p.Transport
- if transport == nil {
- transport = http.DefaultTransport
- }
-
- outreq := new(http.Request)
- *outreq = *req // includes shallow copies of maps, but okay
-
- p.Director(outreq)
- outreq.Proto = "HTTP/1.1"
- outreq.ProtoMajor = 1
- outreq.ProtoMinor = 1
- outreq.Close = false
-
- // Remove hop-by-hop headers to the backend. Especially
- // important is "Connection" because we want a persistent
- // connection, regardless of what the client sent to us. This
- // is modifying the same underlying map from req (shallow
- // copied above) so we only copy it if necessary.
- copiedHeaders := false
- for _, h := range hopHeaders {
- if outreq.Header.Get(h) != "" {
- if !copiedHeaders {
- outreq.Header = make(http.Header)
- copyHeader(outreq.Header, req.Header)
- copiedHeaders = true
- }
- outreq.Header.Del(h)
- }
- }
-
- if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil {
- // If we aren't the first proxy retain prior
- // X-Forwarded-For information as a comma+space
- // separated list and fold multiple headers into one.
- if prior, ok := outreq.Header["X-Forwarded-For"]; ok {
- clientIP = strings.Join(prior, ", ") + ", " + clientIP
- }
- outreq.Header.Set("X-Forwarded-For", clientIP)
- }
-
- res, err := transport.RoundTrip(outreq)
- if err != nil {
- log.Printf("http: proxy error: %v", err)
- rw.WriteHeader(http.StatusInternalServerError)
- return
- }
- defer res.Body.Close()
-
- for _, h := range hopHeaders {
- res.Header.Del(h)
- }
-
- copyHeader(rw.Header(), res.Header)
-
- rw.WriteHeader(res.StatusCode)
- p.copyResponse(rw, res.Body)
-}
-
-func (p *ReverseProxy) copyResponse(dst io.Writer, src io.Reader) {
- if p.FlushInterval != 0 {
- if wf, ok := dst.(writeFlusher); ok {
- mlw := &maxLatencyWriter{
- dst: wf,
- latency: p.FlushInterval,
- done: make(chan bool),
- }
- go mlw.flushLoop()
- defer mlw.stop()
- dst = mlw
- }
- }
-
- io.Copy(dst, src)
-}
-
-type writeFlusher interface {
- io.Writer
- http.Flusher
-}
-
-type maxLatencyWriter struct {
- dst writeFlusher
- latency time.Duration
-
- lk sync.Mutex // protects Write + Flush
- done chan bool
-}
-
-func (m *maxLatencyWriter) Write(p []byte) (int, error) {
- m.lk.Lock()
- defer m.lk.Unlock()
- return m.dst.Write(p)
-}
-
-func (m *maxLatencyWriter) flushLoop() {
- t := time.NewTicker(m.latency)
- defer t.Stop()
- for {
- select {
- case <-m.done:
- if onExitFlushLoop != nil {
- onExitFlushLoop()
- }
- return
- case <-t.C:
- m.lk.Lock()
- m.dst.Flush()
- m.lk.Unlock()
- }
- }
-}
-
-func (m *maxLatencyWriter) stop() { m.done <- true }
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy_test.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy_test.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy_test.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/httputil/reverseproxy_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,213 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Reverse proxy tests.
-
-package httputil
-
-import (
- "io/ioutil"
- "net/http"
- "net/http/httptest"
- "net/url"
- "strings"
- "testing"
- "time"
-)
-
-const fakeHopHeader = "X-Fake-Hop-Header-For-Test"
-
-func init() {
- hopHeaders = append(hopHeaders, fakeHopHeader)
-}
-
-func TestReverseProxy(t *testing.T) {
- const backendResponse = "I am the backend"
- const backendStatus = 404
- backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- if len(r.TransferEncoding) > 0 {
- t.Errorf("backend got unexpected TransferEncoding: %v", r.TransferEncoding)
- }
- if r.Header.Get("X-Forwarded-For") == "" {
- t.Errorf("didn't get X-Forwarded-For header")
- }
- if c := r.Header.Get("Connection"); c != "" {
- t.Errorf("handler got Connection header value %q", c)
- }
- if c := r.Header.Get("Upgrade"); c != "" {
- t.Errorf("handler got Upgrade header value %q", c)
- }
- if g, e := r.Host, "some-name"; g != e {
- t.Errorf("backend got Host header %q, want %q", g, e)
- }
- w.Header().Set("X-Foo", "bar")
- w.Header().Set("Upgrade", "foo")
- w.Header().Set(fakeHopHeader, "foo")
- w.Header().Add("X-Multi-Value", "foo")
- w.Header().Add("X-Multi-Value", "bar")
- http.SetCookie(w, &http.Cookie{Name: "flavor", Value: "chocolateChip"})
- w.WriteHeader(backendStatus)
- w.Write([]byte(backendResponse))
- }))
- defer backend.Close()
- backendURL, err := url.Parse(backend.URL)
- if err != nil {
- t.Fatal(err)
- }
- proxyHandler := NewSingleHostReverseProxy(backendURL)
- frontend := httptest.NewServer(proxyHandler)
- defer frontend.Close()
-
- getReq, _ := http.NewRequest("GET", frontend.URL, nil)
- getReq.Host = "some-name"
- getReq.Header.Set("Connection", "close")
- getReq.Header.Set("Upgrade", "foo")
- getReq.Close = true
- res, err := http.DefaultClient.Do(getReq)
- if err != nil {
- t.Fatalf("Get: %v", err)
- }
- if g, e := res.StatusCode, backendStatus; g != e {
- t.Errorf("got res.StatusCode %d; expected %d", g, e)
- }
- if g, e := res.Header.Get("X-Foo"), "bar"; g != e {
- t.Errorf("got X-Foo %q; expected %q", g, e)
- }
- if c := res.Header.Get(fakeHopHeader); c != "" {
- t.Errorf("got %s header value %q", fakeHopHeader, c)
- }
- if g, e := len(res.Header["X-Multi-Value"]), 2; g != e {
- t.Errorf("got %d X-Multi-Value header values; expected %d", g, e)
- }
- if g, e := len(res.Header["Set-Cookie"]), 1; g != e {
- t.Fatalf("got %d SetCookies, want %d", g, e)
- }
- if cookie := res.Cookies()[0]; cookie.Name != "flavor" {
- t.Errorf("unexpected cookie %q", cookie.Name)
- }
- bodyBytes, _ := ioutil.ReadAll(res.Body)
- if g, e := string(bodyBytes), backendResponse; g != e {
- t.Errorf("got body %q; expected %q", g, e)
- }
-}
-
-func TestXForwardedFor(t *testing.T) {
- const prevForwardedFor = "client ip"
- const backendResponse = "I am the backend"
- const backendStatus = 404
- backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- if r.Header.Get("X-Forwarded-For") == "" {
- t.Errorf("didn't get X-Forwarded-For header")
- }
- if !strings.Contains(r.Header.Get("X-Forwarded-For"), prevForwardedFor) {
- t.Errorf("X-Forwarded-For didn't contain prior data")
- }
- w.WriteHeader(backendStatus)
- w.Write([]byte(backendResponse))
- }))
- defer backend.Close()
- backendURL, err := url.Parse(backend.URL)
- if err != nil {
- t.Fatal(err)
- }
- proxyHandler := NewSingleHostReverseProxy(backendURL)
- frontend := httptest.NewServer(proxyHandler)
- defer frontend.Close()
-
- getReq, _ := http.NewRequest("GET", frontend.URL, nil)
- getReq.Host = "some-name"
- getReq.Header.Set("Connection", "close")
- getReq.Header.Set("X-Forwarded-For", prevForwardedFor)
- getReq.Close = true
- res, err := http.DefaultClient.Do(getReq)
- if err != nil {
- t.Fatalf("Get: %v", err)
- }
- if g, e := res.StatusCode, backendStatus; g != e {
- t.Errorf("got res.StatusCode %d; expected %d", g, e)
- }
- bodyBytes, _ := ioutil.ReadAll(res.Body)
- if g, e := string(bodyBytes), backendResponse; g != e {
- t.Errorf("got body %q; expected %q", g, e)
- }
-}
-
-var proxyQueryTests = []struct {
- baseSuffix string // suffix to add to backend URL
- reqSuffix string // suffix to add to frontend's request URL
- want string // what backend should see for final request URL (without ?)
-}{
- {"", "", ""},
- {"?sta=tic", "?us=er", "sta=tic&us=er"},
- {"", "?us=er", "us=er"},
- {"?sta=tic", "", "sta=tic"},
-}
-
-func TestReverseProxyQuery(t *testing.T) {
- backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("X-Got-Query", r.URL.RawQuery)
- w.Write([]byte("hi"))
- }))
- defer backend.Close()
-
- for i, tt := range proxyQueryTests {
- backendURL, err := url.Parse(backend.URL + tt.baseSuffix)
- if err != nil {
- t.Fatal(err)
- }
- frontend := httptest.NewServer(NewSingleHostReverseProxy(backendURL))
- req, _ := http.NewRequest("GET", frontend.URL+tt.reqSuffix, nil)
- req.Close = true
- res, err := http.DefaultClient.Do(req)
- if err != nil {
- t.Fatalf("%d. Get: %v", i, err)
- }
- if g, e := res.Header.Get("X-Got-Query"), tt.want; g != e {
- t.Errorf("%d. got query %q; expected %q", i, g, e)
- }
- res.Body.Close()
- frontend.Close()
- }
-}
-
-func TestReverseProxyFlushInterval(t *testing.T) {
- const expected = "hi"
- backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte(expected))
- }))
- defer backend.Close()
-
- backendURL, err := url.Parse(backend.URL)
- if err != nil {
- t.Fatal(err)
- }
-
- proxyHandler := NewSingleHostReverseProxy(backendURL)
- proxyHandler.FlushInterval = time.Microsecond
-
- done := make(chan bool)
- onExitFlushLoop = func() { done <- true }
- defer func() { onExitFlushLoop = nil }()
-
- frontend := httptest.NewServer(proxyHandler)
- defer frontend.Close()
-
- req, _ := http.NewRequest("GET", frontend.URL, nil)
- req.Close = true
- res, err := http.DefaultClient.Do(req)
- if err != nil {
- t.Fatalf("Get: %v", err)
- }
- defer res.Body.Close()
- if bodyBytes, _ := ioutil.ReadAll(res.Body); string(bodyBytes) != expected {
- t.Errorf("got body %q; expected %q", bodyBytes, expected)
- }
-
- select {
- case <-done:
- // OK
- case <-time.After(5 * time.Second):
- t.Error("maxLatencyWriter flushLoop() never exited")
- }
-}
diff -Nru juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go
--- juju-core-2.0~beta15/src/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go 2016-08-16 08:56:25.000000000 +0000
+++ juju-core-2.0.0/src/github.com/Azure/azure-sdk-for-go/core/http/pprof/pprof.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,205 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package pprof serves via its HTTP server runtime profiling data
-// in the format expected by the pprof visualization tool.
-// For more information about pprof, see
-// http://code.google.com/p/google-perftools/.
-//
-// The package is typically only imported for the side effect of
-// registering its HTTP handlers.
-// The handled paths all begin with /debug/pprof/.
-//
-// To use pprof, link this package into your program:
-// import _ "net/http/pprof"
-//
-// If your application is not already running an http server, you
-// need to start one. Add "net/http" and "log" to your imports and
-// the following code to your main function:
-//
-// go func() {
-// log.Println(http.ListenAndServe("localhost:6060", nil))
-// }()
-//
-// Then use the pprof tool to look at the heap profile:
-//
-// go tool pprof http://localhost:6060/debug/pprof/heap
-//
-// Or to look at a 30-second CPU profile:
-//
-// go tool pprof http://localhost:6060/debug/pprof/profile
-//
-// Or to look at the goroutine blocking profile:
-//
-// go tool pprof http://localhost:6060/debug/pprof/block
-//
-// To view all available profiles, open http://localhost:6060/debug/pprof/
-// in your browser.
-//
-// For a study of the facility in action, visit
-//
-// http://blog.golang.org/2011/06/profiling-go-programs.html
-//
-package pprof
-
-import (
- "bufio"
- "bytes"
- "fmt"
- "html/template"
- "io"
- "log"
- "net/http"
- "os"
- "runtime"
- "runtime/pprof"
- "strconv"
- "strings"
- "time"
-)
-
-func init() {
- http.Handle("/debug/pprof/", http.HandlerFunc(Index))
- http.Handle("/debug/pprof/cmdline", http.HandlerFunc(Cmdline))
- http.Handle("/debug/pprof/profile", http.HandlerFunc(Profile))
- http.Handle("/debug/pprof/symbol", http.HandlerFunc(Symbol))
-}
-
-// Cmdline responds with the running program's
-// command line, with arguments separated by NUL bytes.
-// The package initialization registers it as /debug/pprof/cmdline.
-func Cmdline(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/plain; charset=utf-8")
- fmt.Fprintf(w, strings.Join(os.Args, "\x00"))
-}
-
-// Profile responds with the pprof-formatted cpu profile.
-// The package initialization registers it as /debug/pprof/profile.
-func Profile(w http.ResponseWriter, r *http.Request) {
- sec, _ := strconv.ParseInt(r.FormValue("seconds"), 10, 64)
- if sec == 0 {
- sec = 30
- }
-
- // Set Content Type assuming StartCPUProfile will work,
- // because if it does it starts writing.
- w.Header().Set("Content-Type", "application/octet-stream")
- if err := pprof.StartCPUProfile(w); err != nil {
- // StartCPUProfile failed, so no writes yet.
- // Can change header back to text content
- // and send error code.
- w.Header().Set("Content-Type", "text/plain; charset=utf-8")
- w.WriteHeader(http.StatusInternalServerError)
- fmt.Fprintf(w, "Could not enable CPU profiling: %s\n", err)
- return
- }
- time.Sleep(time.Duration(sec) * time.Second)
- pprof.StopCPUProfile()
-}
-
-// Symbol looks up the program counters listed in the request,
-// responding with a table mapping program counters to function names.
-// The package initialization registers it as /debug/pprof/symbol.
-func Symbol(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/plain; charset=utf-8")
-
- // We have to read the whole POST body before
- // writing any output. Buffer the output here.
- var buf bytes.Buffer
-
- // We don't know how many symbols we have, but we
- // do have symbol information. Pprof only cares whether
- // this number is 0 (no symbols available) or > 0.
- fmt.Fprintf(&buf, "num_symbols: 1\n")
-
- var b *bufio.Reader
- if r.Method == "POST" {
- b = bufio.NewReader(r.Body)
- } else {
- b = bufio.NewReader(strings.NewReader(r.URL.RawQuery))
- }
-
- for {
- word, err := b.ReadSlice('+')
- if err == nil {
- word = word[0 : len(word)-1] // trim +
- }
- pc, _ := strconv.ParseUint(string(word), 0, 64)
- if pc != 0 {
- f := runtime.FuncForPC(uintptr(pc))
- if f != nil {
- fmt.Fprintf(&buf, "%#x %s\n", pc, f.Name())
- }
- }
-
- // Wait until here to check for err; the last
- // symbol will have an err because it doesn't end in +.
- if err != nil {
- if err != io.EOF {
- fmt.Fprintf(&buf, "reading request: %v\n", err)
- }
- break
- }
- }
-
- w.Write(buf.Bytes())
-}
-
-// Handler returns an HTTP handler that serves the named profile.
-func Handler(name string) http.Handler {
- return handler(name)
-}
-
-type handler string
-
-func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "text/plain; charset=utf-8")
- debug, _ := strconv.Atoi(r.FormValue("debug"))
- p := pprof.Lookup(string(name))
- if p == nil {
- w.WriteHeader(404)
- fmt.Fprintf(w, "Unknown profile: %s\n", name)
- return
- }
- p.WriteTo(w, debug)
- return
-}
-
-// Index responds with the pprof-formatted profile named by the request.
-// For example, "/debug/pprof/heap" serves the "heap" profile.
-// Index responds to a request for "/debug/pprof/" with an HTML page
-// listing the available profiles.
-func Index(w http.ResponseWriter, r *http.Request) {
- if strings.HasPrefix(r.URL.Path, "/debug/pprof/") {
- name := strings.TrimPrefix(r.URL.Path, "/debug/pprof/")
- if name != "" {
- handler(name).ServeHTTP(w, r)
- return
- }
- }
-
- profiles := pprof.Profiles()
- if err := indexTmpl.Execute(w, profiles); err != nil {
- log.Print(err)
- }
-}
-
-var indexTmpl = template.Must(template.New("index").Parse(`
-
-/debug/pprof/
-
-/debug/pprof/
-
-
-profiles:
-