From f29a2eccaa178b367df0405778cd85e0af7b4225 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Mon, 20 May 2019 15:40:00 -0700 Subject: [PATCH] V12.1.0 (#400) * Deserialize additionalInfo in ARM error * Allow a new authorizer to be created from a configuration file by specifying a resource instead of a base url. This enables resource like KeyVault and Container Registry to use an authorizer configured from a configuration file. * [WIP] Using the Context from the timeout if provided (#315) * Using the timeout from the context if available - Makes PollingDuration optional * Renaming the registration start time * Making PollingDuration not a pointer * fixing a broken reference * Add NewAuthorizerFromCli method which uses Azure CLI to obtain a token for the currently logged in user, for local development scenarios. (#316) * Adding User assigned identity support for the MSIConfig authorizor (#332) * Adding ByteSlicePtr (#399) * v12.1.0 Added to.ByteSlicPtr(). Added blob/queue storage resource ID. --- CHANGELOG.md | 7 +++++++ autorest/azure/environments.go | 5 +++++ autorest/to/convert.go | 5 +++++ autorest/to/convert_test.go | 8 ++++++++ autorest/version.go | 2 +- 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a8c0c17..5dc767c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## v12.1.0 + +### New Features + +- Added `to.ByteSlicePtr()`. +- Added blob/queue storage resource ID to `azure.ResourceIdentifier`. + ## v12.0.0 ### Breaking Changes diff --git a/autorest/azure/environments.go b/autorest/azure/environments.go index cdde41418..6c20b8179 100644 --- a/autorest/azure/environments.go +++ b/autorest/azure/environments.go @@ -45,6 +45,7 @@ type ResourceIdentifier struct { Datalake string `json:"datalake"` Batch string `json:"batch"` OperationalInsights string `json:"operationalInsights"` + Storage string `json:"storage"` } // Environment represents a set of endpoints for each of Azure's Clouds. @@ -103,6 +104,7 @@ var ( Datalake: "https://datalake.azure.net/", Batch: "https://batch.core.windows.net/", OperationalInsights: "https://api.loganalytics.io", + Storage: "https://storage.azure.com/", }, } @@ -135,6 +137,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.core.usgovcloudapi.net/", OperationalInsights: "https://api.loganalytics.us", + Storage: "https://storage.azure.com/", }, } @@ -167,6 +170,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.chinacloudapi.cn/", OperationalInsights: NotAvailable, + Storage: "https://storage.azure.com/", }, } @@ -199,6 +203,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.cloudapi.de/", OperationalInsights: NotAvailable, + Storage: "https://storage.azure.com/", }, } ) diff --git a/autorest/to/convert.go b/autorest/to/convert.go index fdda2ce1a..86694bd25 100644 --- a/autorest/to/convert.go +++ b/autorest/to/convert.go @@ -145,3 +145,8 @@ func Float64(i *float64) float64 { func Float64Ptr(i float64) *float64 { return &i } + +// ByteSlicePtr returns a pointer to the passed byte slice. +func ByteSlicePtr(b []byte) *[]byte { + return &b +} diff --git a/autorest/to/convert_test.go b/autorest/to/convert_test.go index f8177a163..b7b85ed33 100644 --- a/autorest/to/convert_test.go +++ b/autorest/to/convert_test.go @@ -232,3 +232,11 @@ func TestFloat64Ptr(t *testing.T) { v, *Float64Ptr(v)) } } + +func TestByteSlicePtr(t *testing.T) { + v := []byte("bytes") + if out := ByteSlicePtr(v); !reflect.DeepEqual(*out, v) { + t.Fatalf("to: ByteSlicePtr failed to return the correct slice -- expected %v, received %v", + v, *out) + } +} diff --git a/autorest/version.go b/autorest/version.go index 0c8d9d224..d3e57b509 100644 --- a/autorest/version.go +++ b/autorest/version.go @@ -19,7 +19,7 @@ import ( "runtime" ) -const number = "v12.0.0" +const number = "v12.1.0" var ( userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",