vendor: update all dependencies to latest versions
This commit is contained in:
+3
-5
@@ -1,5 +1,4 @@
|
||||
// Package notificationhubs implements the Azure ARM Notificationhubs service
|
||||
// API version 2017-04-01.
|
||||
// Package notificationhubs implements the Azure ARM Notificationhubs service API version 2017-04-01.
|
||||
//
|
||||
// Azure NotificationHub client
|
||||
package notificationhubs
|
||||
@@ -18,9 +17,8 @@ package notificationhubs
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
Generated
Vendored
Executable → Regular
+124
-49
@@ -14,9 +14,8 @@ package notificationhubs
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -40,11 +39,10 @@ func NewGroupClientWithBaseURI(baseURI string, subscriptionID string) GroupClien
|
||||
return GroupClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CheckAvailability checks the availability of the given notificationHub in a
|
||||
// namespace.
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name. parameters is the
|
||||
// notificationHub name.
|
||||
func (client GroupClient) CheckAvailability(resourceGroupName string, namespaceName string, parameters CheckAvailabilityParameters) (result CheckAvailabilityResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -118,9 +116,8 @@ func (client GroupClient) CheckAvailabilityResponder(resp *http.Response) (resul
|
||||
|
||||
// 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.
|
||||
// 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 GroupClient) CreateOrUpdate(resourceGroupName string, namespaceName string, notificationHubName string, parameters CreateOrUpdateParameters) (result ResourceType, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -192,13 +189,11 @@ func (client GroupClient) CreateOrUpdateResponder(resp *http.Response) (result R
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates/Updates an authorization rule for a
|
||||
// NotificationHub
|
||||
// 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.
|
||||
// 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 GroupClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -273,8 +268,8 @@ func (client GroupClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Re
|
||||
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name. notificationHubName is the
|
||||
// notification hub name.
|
||||
func (client GroupClient) Delete(resourceGroupName string, namespaceName string, notificationHubName string) (result autorest.Response, err error) {
|
||||
req, err := client.DeletePreparer(resourceGroupName, namespaceName, notificationHubName)
|
||||
if err != nil {
|
||||
@@ -339,9 +334,8 @@ func (client GroupClient) DeleteResponder(resp *http.Response) (result autorest.
|
||||
|
||||
// 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.
|
||||
// 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 GroupClient) 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 {
|
||||
@@ -407,8 +401,8 @@ func (client GroupClient) DeleteAuthorizationRuleResponder(resp *http.Response)
|
||||
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name. notificationHubName is the
|
||||
// notification hub name.
|
||||
func (client GroupClient) Get(resourceGroupName string, namespaceName string, notificationHubName string) (result ResourceType, err error) {
|
||||
req, err := client.GetPreparer(resourceGroupName, namespaceName, notificationHubName)
|
||||
if err != nil {
|
||||
@@ -472,12 +466,10 @@ func (client GroupClient) GetResponder(resp *http.Response) (result ResourceType
|
||||
return
|
||||
}
|
||||
|
||||
// GetAuthorizationRule gets an authorization rule for a NotificationHub by
|
||||
// name.
|
||||
// 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.
|
||||
// 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 GroupClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
|
||||
if err != nil {
|
||||
@@ -542,11 +534,10 @@ func (client GroupClient) GetAuthorizationRuleResponder(resp *http.Response) (re
|
||||
return
|
||||
}
|
||||
|
||||
// GetPnsCredentials lists the PNS Credentials associated with a notification
|
||||
// hub .
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name. notificationHubName is the
|
||||
// notification hub name.
|
||||
func (client GroupClient) GetPnsCredentials(resourceGroupName string, namespaceName string, notificationHubName string) (result PnsCredentialsResource, err error) {
|
||||
req, err := client.GetPnsCredentialsPreparer(resourceGroupName, namespaceName, notificationHubName)
|
||||
if err != nil {
|
||||
@@ -612,8 +603,7 @@ func (client GroupClient) GetPnsCredentialsResponder(resp *http.Response) (resul
|
||||
|
||||
// List lists the notification hubs associated with a namespace.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the
|
||||
// namespace name.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name.
|
||||
func (client GroupClient) List(resourceGroupName string, namespaceName string) (result ListResult, err error) {
|
||||
req, err := client.ListPreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
@@ -700,10 +690,55 @@ func (client GroupClient) ListNextResults(lastResults ListResult) (result ListRe
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListComplete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan ResourceType, <-chan error) {
|
||||
resultChan := make(chan ResourceType)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name notificationHubName is the
|
||||
// notification hub name.
|
||||
func (client GroupClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, notificationHubName string) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName, notificationHubName)
|
||||
if err != nil {
|
||||
@@ -791,13 +826,56 @@ func (client GroupClient) ListAuthorizationRulesNextResults(lastResults SharedAc
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys gets the Primary and Secondary ConnectionStrings to the
|
||||
// NotificationHub
|
||||
// ListAuthorizationRulesComplete gets all elements from the list without paging.
|
||||
func (client GroupClient) ListAuthorizationRulesComplete(resourceGroupName string, namespaceName string, notificationHubName string, cancel <-chan struct{}) (<-chan SharedAccessAuthorizationRuleResource, <-chan error) {
|
||||
resultChan := make(chan SharedAccessAuthorizationRuleResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAuthorizationRules(resourceGroupName, namespaceName, notificationHubName)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAuthorizationRulesNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// 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.
|
||||
// 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 GroupClient) ListKeys(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string) (result ResourceListKeys, err error) {
|
||||
req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName)
|
||||
if err != nil {
|
||||
@@ -862,14 +940,11 @@ func (client GroupClient) ListKeysResponder(resp *http.Response) (result Resourc
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the Primary/Secondary Keys to the NotificationHub
|
||||
// Authorization Rule
|
||||
// RegenerateKeys regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule
|
||||
//
|
||||
// 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. parameters is parameters supplied to
|
||||
// regenerate the NotificationHub Authorization Rule Key.
|
||||
// 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. parameters is parameters supplied to regenerate the NotificationHub Authorization Rule Key.
|
||||
func (client GroupClient) RegenerateKeys(resourceGroupName string, namespaceName string, notificationHubName string, authorizationRuleName string, parameters PolicykeyResource) (result ResourceListKeys, err error) {
|
||||
req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters)
|
||||
if err != nil {
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
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.
|
||||
// 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"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// HubsClient is the azure NotificationHub client
|
||||
type HubsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewHubsClient creates an instance of the HubsClient client.
|
||||
func NewHubsClient(subscriptionID string) HubsClient {
|
||||
return NewHubsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewHubsClientWithBaseURI creates an instance of the HubsClient client.
|
||||
func NewHubsClientWithBaseURI(baseURI string, subscriptionID string) HubsClient {
|
||||
return HubsClient{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 HubsClient) CheckAvailability(resourceGroupName string, namespaceName string, parameters CheckNameAvailabilityRequestParameters) (result CheckNameAvailabilityResponse, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "notificationhubs.HubsClient", "CheckAvailability")
|
||||
}
|
||||
|
||||
req, err := client.CheckAvailabilityPreparer(resourceGroupName, namespaceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.HubsClient", "CheckAvailability", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CheckAvailabilitySender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.HubsClient", "CheckAvailability", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CheckAvailabilityResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.HubsClient", "CheckAvailability", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CheckAvailabilityPreparer prepares the CheckAvailability request.
|
||||
func (client HubsClient) CheckAvailabilityPreparer(resourceGroupName string, namespaceName string, parameters CheckNameAvailabilityRequestParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkHubAvailability", 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 HubsClient) 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 HubsClient) CheckAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
+29
-23
@@ -14,9 +14,8 @@ package notificationhubs
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -93,16 +92,15 @@ type BaiduCredential struct {
|
||||
*BaiduCredentialProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// BaiduCredentialProperties is description of a NotificationHub
|
||||
// BaiduCredential.
|
||||
// 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.
|
||||
// CheckAvailabilityParameters is parameters supplied to the Check Name Availability for Namespace and
|
||||
// NotificationHubs.
|
||||
type CheckAvailabilityParameters struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
@@ -125,8 +123,22 @@ type CheckAvailabilityResult struct {
|
||||
IsAvailiable *bool `json:"isAvailiable,omitempty"`
|
||||
}
|
||||
|
||||
// CreateOrUpdateParameters is parameters supplied to the CreateOrUpdate
|
||||
// NotificationHub operation.
|
||||
// CheckNameAvailabilityRequestParameters is parameters supplied to the Check Name Availability for Namespace and
|
||||
// NotificationHubs.
|
||||
type CheckNameAvailabilityRequestParameters struct {
|
||||
Name *string `json:"Name,omitempty"`
|
||||
Type *string `json:"Type,omitempty"`
|
||||
}
|
||||
|
||||
// CheckNameAvailabilityResponse is
|
||||
type CheckNameAvailabilityResponse struct {
|
||||
autorest.Response `json:"-"`
|
||||
NameAvailable *bool `json:"NameAvailable,omitempty"`
|
||||
Reason *string `json:"Reason,omitempty"`
|
||||
Message *string `json:"Message,omitempty"`
|
||||
}
|
||||
|
||||
// CreateOrUpdateParameters is parameters supplied to the CreateOrUpdate NotificationHub operation.
|
||||
type CreateOrUpdateParameters struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
@@ -179,8 +191,7 @@ type MpnsCredentialProperties struct {
|
||||
Thumbprint *string `json:"thumbprint,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceCreateOrUpdateParameters is parameters supplied to the
|
||||
// CreateOrUpdate Namespace operation.
|
||||
// NamespaceCreateOrUpdateParameters is parameters supplied to the CreateOrUpdate Namespace operation.
|
||||
type NamespaceCreateOrUpdateParameters struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
@@ -210,8 +221,7 @@ func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request,
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// NamespacePatchParameters is parameters supplied to the Patch Namespace
|
||||
// operation.
|
||||
// NamespacePatchParameters is parameters supplied to the Patch Namespace operation.
|
||||
type NamespacePatchParameters struct {
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
@@ -244,8 +254,7 @@ type NamespaceResource struct {
|
||||
*NamespaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// PnsCredentialsProperties is description of a NotificationHub PNS
|
||||
// Credentials.
|
||||
// PnsCredentialsProperties is description of a NotificationHub PNS Credentials.
|
||||
type PnsCredentialsProperties struct {
|
||||
ApnsCredential *ApnsCredential `json:"apnsCredential,omitempty"`
|
||||
WnsCredential *WnsCredential `json:"wnsCredential,omitempty"`
|
||||
@@ -317,8 +326,8 @@ type ResourceType struct {
|
||||
*Properties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters supplied
|
||||
// to the CreateOrUpdate Namespace AuthorizationRules.
|
||||
// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters supplied to the CreateOrUpdate Namespace
|
||||
// AuthorizationRules.
|
||||
type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
@@ -329,8 +338,7 @@ type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
|
||||
Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleListResult is the response of the List
|
||||
// Namespace operation.
|
||||
// SharedAccessAuthorizationRuleListResult is the response of the List Namespace operation.
|
||||
type SharedAccessAuthorizationRuleListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SharedAccessAuthorizationRuleResource `json:"value,omitempty"`
|
||||
@@ -349,14 +357,12 @@ func (client SharedAccessAuthorizationRuleListResult) SharedAccessAuthorizationR
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleProperties is sharedAccessAuthorizationRule
|
||||
// properties.
|
||||
// SharedAccessAuthorizationRuleProperties is sharedAccessAuthorizationRule properties.
|
||||
type SharedAccessAuthorizationRuleProperties struct {
|
||||
Rights *[]AccessRights `json:"rights,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleResource is description of a Namespace
|
||||
// AuthorizationRules.
|
||||
// SharedAccessAuthorizationRuleResource is description of a Namespace AuthorizationRules.
|
||||
type SharedAccessAuthorizationRuleResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
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.
|
||||
// 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"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// NameClient is the azure NotificationHub client
|
||||
type NameClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewNameClient creates an instance of the NameClient client.
|
||||
func NewNameClient(subscriptionID string) NameClient {
|
||||
return NewNameClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewNameClientWithBaseURI creates an instance of the NameClient client.
|
||||
func NewNameClientWithBaseURI(baseURI string, subscriptionID string) NameClient {
|
||||
return NameClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CheckAvailability checks the availability of the given service namespace across all Azure subscriptions. This is
|
||||
// useful because the domain name is created based on the service namespace name.
|
||||
//
|
||||
// parameters is the namespace name.
|
||||
func (client NameClient) CheckAvailability(parameters CheckNameAvailabilityRequestParameters) (result CheckNameAvailabilityResponse, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "notificationhubs.NameClient", "CheckAvailability")
|
||||
}
|
||||
|
||||
req, err := client.CheckAvailabilityPreparer(parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.NameClient", "CheckAvailability", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CheckAvailabilitySender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.NameClient", "CheckAvailability", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CheckAvailabilityResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "notificationhubs.NameClient", "CheckAvailability", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CheckAvailabilityPreparer prepares the CheckAvailability request.
|
||||
func (client NameClient) CheckAvailabilityPreparer(parameters CheckNameAvailabilityRequestParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNameAvailability", 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 NameClient) 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 NameClient) CheckAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
+171
-50
@@ -14,9 +14,8 @@ package notificationhubs
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
@@ -35,15 +34,13 @@ func NewNamespacesClient(subscriptionID string) NamespacesClient {
|
||||
return NewNamespacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewNamespacesClientWithBaseURI creates an instance of the NamespacesClient
|
||||
// client.
|
||||
// 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 Azure subscriptions. This is useful because the domain name is
|
||||
// created based on the service namespace name.
|
||||
// CheckAvailability checks the availability of the given service namespace across all 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 CheckAvailabilityResult, err error) {
|
||||
@@ -115,12 +112,11 @@ func (client NamespacesClient) CheckAvailabilityResponder(resp *http.Response) (
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates/Updates a service namespace. Once created, this
|
||||
// namespace's resource manifest is immutable. This operation is idempotent.
|
||||
// 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.
|
||||
// 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 {
|
||||
@@ -185,12 +181,10 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates an authorization rule for a
|
||||
// namespace
|
||||
// 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.
|
||||
// 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) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
@@ -262,14 +256,11 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *ht
|
||||
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.
|
||||
// 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.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name.
|
||||
func (client NamespacesClient) Delete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
|
||||
resultChan := make(chan autorest.Response, 1)
|
||||
errChan := make(chan error, 1)
|
||||
@@ -277,8 +268,10 @@ func (client NamespacesClient) Delete(resourceGroupName string, namespaceName st
|
||||
var err error
|
||||
var result autorest.Response
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -346,8 +339,8 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto
|
||||
|
||||
// DeleteAuthorizationRule deletes a namespace authorization rule
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the
|
||||
// namespace name. authorizationRuleName is authorization Rule Name.
|
||||
// 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 {
|
||||
@@ -412,8 +405,7 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo
|
||||
|
||||
// Get returns the description for the specified namespace.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the
|
||||
// namespace name.
|
||||
// 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 {
|
||||
@@ -478,8 +470,8 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result Namespa
|
||||
|
||||
// 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.
|
||||
// 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 {
|
||||
@@ -545,8 +537,8 @@ func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response
|
||||
|
||||
// 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
|
||||
// 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 {
|
||||
@@ -632,8 +624,52 @@ func (client NamespacesClient) ListNextResults(lastResults NamespaceListResult)
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll lists all the available namespaces within the subscription
|
||||
// irrespective of the resourceGroups.
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client NamespacesClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan NamespaceResource, <-chan error) {
|
||||
resultChan := make(chan NamespaceResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.List(resourceGroupName)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// 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 {
|
||||
@@ -718,10 +754,54 @@ func (client NamespacesClient) ListAllNextResults(lastResults NamespaceListResul
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllComplete gets all elements from the list without paging.
|
||||
func (client NamespacesClient) ListAllComplete(cancel <-chan struct{}) (<-chan NamespaceResource, <-chan error) {
|
||||
resultChan := make(chan NamespaceResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAll()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAllNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// ListAuthorizationRules gets the authorization rules for a namespace.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the
|
||||
// namespace name
|
||||
// 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 {
|
||||
@@ -808,11 +888,55 @@ func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults Sha
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesComplete gets all elements from the list without paging.
|
||||
func (client NamespacesClient) ListAuthorizationRulesComplete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan SharedAccessAuthorizationRuleResource, <-chan error) {
|
||||
resultChan := make(chan SharedAccessAuthorizationRuleResource)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAuthorizationRules(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
for list.NextLink != nil {
|
||||
list, err = client.ListAuthorizationRulesNextResults(list)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if list.Value != nil {
|
||||
for _, item := range *list.Value {
|
||||
select {
|
||||
case <-cancel:
|
||||
return
|
||||
case resultChan <- item:
|
||||
// Intentionally left blank
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
return resultChan, errChan
|
||||
}
|
||||
|
||||
// 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.
|
||||
// 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 {
|
||||
@@ -878,9 +1002,8 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Re
|
||||
|
||||
// Patch patches the existing namespace
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the
|
||||
// namespace name. parameters is parameters supplied to patch a Namespace
|
||||
// Resource.
|
||||
// resourceGroupName is the name of the resource group. namespaceName is the namespace name. parameters is parameters
|
||||
// supplied to patch a Namespace Resource.
|
||||
func (client NamespacesClient) Patch(resourceGroupName string, namespaceName string, parameters NamespacePatchParameters) (result NamespaceResource, err error) {
|
||||
req, err := client.PatchPreparer(resourceGroupName, namespaceName, parameters)
|
||||
if err != nil {
|
||||
@@ -945,13 +1068,11 @@ func (client NamespacesClient) PatchResponder(resp *http.Response) (result Names
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the Primary/Secondary Keys to the Namespace
|
||||
// Authorization Rule
|
||||
// RegenerateKeys regenerates the Primary/Secondary Keys to the Namespace Authorization Rule
|
||||
//
|
||||
// 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 the Namespace Authorization Rule Key.
|
||||
// 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 the Namespace Authorization Rule Key.
|
||||
func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters PolicykeyResource) (result ResourceListKeys, err error) {
|
||||
req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters)
|
||||
if err != nil {
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package notificationhubs
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/v10.1.0-beta arm-notificationhubs/2017-04-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-notificationhubs/2017-04-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return "v10.1.0-beta"
|
||||
return "v11.0.0-beta"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user