vendor: update all dependencies to latest versions
This commit is contained in:
+3
-5
@@ -1,5 +1,4 @@
|
||||
// Package servicebus implements the Azure ARM Servicebus service API version
|
||||
// 2015-08-01.
|
||||
// Package servicebus implements the Azure ARM Servicebus service API version 2017-04-01.
|
||||
//
|
||||
// Azure Service Bus client
|
||||
package servicebus
|
||||
@@ -18,9 +17,8 @@ package servicebus
|
||||
// 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"
|
||||
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
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.
|
||||
// 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"
|
||||
)
|
||||
|
||||
// EventHubsClient is the azure Service Bus client
|
||||
type EventHubsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewEventHubsClient creates an instance of the EventHubsClient client.
|
||||
func NewEventHubsClient(subscriptionID string) EventHubsClient {
|
||||
return NewEventHubsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewEventHubsClientWithBaseURI creates an instance of the EventHubsClient client.
|
||||
func NewEventHubsClientWithBaseURI(baseURI string, subscriptionID string) EventHubsClient {
|
||||
return EventHubsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// ListByNamespace gets all the Event Hubs in a service bus Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
func (client EventHubsClient) ListByNamespace(resourceGroupName string, namespaceName string) (result EventHubListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.EventHubsClient", "ListByNamespace")
|
||||
}
|
||||
|
||||
req, err := client.ListByNamespacePreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespacePreparer prepares the ListByNamespace request.
|
||||
func (client EventHubsClient) ListByNamespacePreparer(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),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListByNamespaceSender sends the ListByNamespace request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client EventHubsClient) ListByNamespaceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListByNamespaceResponder handles the response to the ListByNamespace request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) ListByNamespaceResponder(resp *http.Response) (result EventHubListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceNextResults retrieves the next set of results, if any.
|
||||
func (client EventHubsClient) ListByNamespaceNextResults(lastResults EventHubListResult) (result EventHubListResult, err error) {
|
||||
req, err := lastResults.EventHubListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.EventHubsClient", "ListByNamespace", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceComplete gets all elements from the list without paging.
|
||||
func (client EventHubsClient) ListByNamespaceComplete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan Eventhub, <-chan error) {
|
||||
resultChan := make(chan Eventhub)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByNamespace(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.ListByNamespaceNextResults(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
|
||||
}
|
||||
+405
-329
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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"
|
||||
@@ -37,109 +36,58 @@ const (
|
||||
Send AccessRights = "Send"
|
||||
)
|
||||
|
||||
// EntityAvailabilityStatus enumerates the values for entity availability
|
||||
// status.
|
||||
type EntityAvailabilityStatus string
|
||||
// EncodingCaptureDescription enumerates the values for encoding capture description.
|
||||
type EncodingCaptureDescription string
|
||||
|
||||
const (
|
||||
// Available specifies the available state for entity availability status.
|
||||
Available EntityAvailabilityStatus = "Available"
|
||||
// Limited specifies the limited state for entity availability status.
|
||||
Limited EntityAvailabilityStatus = "Limited"
|
||||
// Renaming specifies the renaming state for entity availability status.
|
||||
Renaming EntityAvailabilityStatus = "Renaming"
|
||||
// Restoring specifies the restoring state for entity availability status.
|
||||
Restoring EntityAvailabilityStatus = "Restoring"
|
||||
// Unknown specifies the unknown state for entity availability status.
|
||||
Unknown EntityAvailabilityStatus = "Unknown"
|
||||
// Avro specifies the avro state for encoding capture description.
|
||||
Avro EncodingCaptureDescription = "Avro"
|
||||
// AvroDeflate specifies the avro deflate state for encoding capture description.
|
||||
AvroDeflate EncodingCaptureDescription = "AvroDeflate"
|
||||
)
|
||||
|
||||
// EntityStatus enumerates the values for entity status.
|
||||
type EntityStatus string
|
||||
|
||||
const (
|
||||
// EntityStatusActive specifies the entity status active state for entity
|
||||
// status.
|
||||
EntityStatusActive EntityStatus = "Active"
|
||||
// EntityStatusCreating specifies the entity status creating state for
|
||||
// entity status.
|
||||
EntityStatusCreating EntityStatus = "Creating"
|
||||
// EntityStatusDeleting specifies the entity status deleting state for
|
||||
// entity status.
|
||||
EntityStatusDeleting EntityStatus = "Deleting"
|
||||
// EntityStatusDisabled specifies the entity status disabled state for
|
||||
// entity status.
|
||||
EntityStatusDisabled EntityStatus = "Disabled"
|
||||
// EntityStatusReceiveDisabled specifies the entity status receive disabled
|
||||
// state for entity status.
|
||||
EntityStatusReceiveDisabled EntityStatus = "ReceiveDisabled"
|
||||
// EntityStatusRenaming specifies the entity status renaming state for
|
||||
// entity status.
|
||||
EntityStatusRenaming EntityStatus = "Renaming"
|
||||
// EntityStatusRestoring specifies the entity status restoring state for
|
||||
// entity status.
|
||||
EntityStatusRestoring EntityStatus = "Restoring"
|
||||
// EntityStatusSendDisabled specifies the entity status send disabled state
|
||||
// for entity status.
|
||||
EntityStatusSendDisabled EntityStatus = "SendDisabled"
|
||||
// EntityStatusUnknown specifies the entity status unknown state for entity
|
||||
// status.
|
||||
EntityStatusUnknown EntityStatus = "Unknown"
|
||||
// Active specifies the active state for entity status.
|
||||
Active EntityStatus = "Active"
|
||||
// Creating specifies the creating state for entity status.
|
||||
Creating EntityStatus = "Creating"
|
||||
// Deleting specifies the deleting state for entity status.
|
||||
Deleting EntityStatus = "Deleting"
|
||||
// Disabled specifies the disabled state for entity status.
|
||||
Disabled EntityStatus = "Disabled"
|
||||
// ReceiveDisabled specifies the receive disabled state for entity status.
|
||||
ReceiveDisabled EntityStatus = "ReceiveDisabled"
|
||||
// Renaming specifies the renaming state for entity status.
|
||||
Renaming EntityStatus = "Renaming"
|
||||
// Restoring specifies the restoring state for entity status.
|
||||
Restoring EntityStatus = "Restoring"
|
||||
// SendDisabled specifies the send disabled state for entity status.
|
||||
SendDisabled EntityStatus = "SendDisabled"
|
||||
// Unknown specifies the unknown state for entity status.
|
||||
Unknown EntityStatus = "Unknown"
|
||||
)
|
||||
|
||||
// NamespaceState enumerates the values for namespace state.
|
||||
type NamespaceState string
|
||||
// FilterType enumerates the values for filter type.
|
||||
type FilterType string
|
||||
|
||||
const (
|
||||
// NamespaceStateActivating specifies the namespace state activating state
|
||||
// for namespace state.
|
||||
NamespaceStateActivating NamespaceState = "Activating"
|
||||
// NamespaceStateActive specifies the namespace state active state for
|
||||
// namespace state.
|
||||
NamespaceStateActive NamespaceState = "Active"
|
||||
// NamespaceStateCreated specifies the namespace state created state for
|
||||
// namespace state.
|
||||
NamespaceStateCreated NamespaceState = "Created"
|
||||
// NamespaceStateCreating specifies the namespace state creating state for
|
||||
// namespace state.
|
||||
NamespaceStateCreating NamespaceState = "Creating"
|
||||
// NamespaceStateDisabled specifies the namespace state disabled state for
|
||||
// namespace state.
|
||||
NamespaceStateDisabled NamespaceState = "Disabled"
|
||||
// NamespaceStateDisabling specifies the namespace state disabling state
|
||||
// for namespace state.
|
||||
NamespaceStateDisabling NamespaceState = "Disabling"
|
||||
// NamespaceStateEnabling specifies the namespace state enabling state for
|
||||
// namespace state.
|
||||
NamespaceStateEnabling NamespaceState = "Enabling"
|
||||
// NamespaceStateFailed specifies the namespace state failed state for
|
||||
// namespace state.
|
||||
NamespaceStateFailed NamespaceState = "Failed"
|
||||
// NamespaceStateRemoved specifies the namespace state removed state for
|
||||
// namespace state.
|
||||
NamespaceStateRemoved NamespaceState = "Removed"
|
||||
// NamespaceStateRemoving specifies the namespace state removing state for
|
||||
// namespace state.
|
||||
NamespaceStateRemoving NamespaceState = "Removing"
|
||||
// NamespaceStateSoftDeleted specifies the namespace state soft deleted
|
||||
// state for namespace state.
|
||||
NamespaceStateSoftDeleted NamespaceState = "SoftDeleted"
|
||||
// NamespaceStateSoftDeleting specifies the namespace state soft deleting
|
||||
// state for namespace state.
|
||||
NamespaceStateSoftDeleting NamespaceState = "SoftDeleting"
|
||||
// NamespaceStateUnknown specifies the namespace state unknown state for
|
||||
// namespace state.
|
||||
NamespaceStateUnknown NamespaceState = "Unknown"
|
||||
// FilterTypeCorrelationFilter specifies the filter type correlation filter state for filter type.
|
||||
FilterTypeCorrelationFilter FilterType = "CorrelationFilter"
|
||||
// FilterTypeSQLFilter specifies the filter type sql filter state for filter type.
|
||||
FilterTypeSQLFilter FilterType = "SqlFilter"
|
||||
)
|
||||
|
||||
// Policykey enumerates the values for policykey.
|
||||
type Policykey string
|
||||
// KeyType enumerates the values for key type.
|
||||
type KeyType string
|
||||
|
||||
const (
|
||||
// PrimaryKey specifies the primary key state for policykey.
|
||||
PrimaryKey Policykey = "PrimaryKey"
|
||||
// SecondaryKey specifies the secondary key state for policykey.
|
||||
SecondaryKey Policykey = "SecondaryKey"
|
||||
// PrimaryKey specifies the primary key state for key type.
|
||||
PrimaryKey KeyType = "PrimaryKey"
|
||||
// SecondaryKey specifies the secondary key state for key type.
|
||||
SecondaryKey KeyType = "SecondaryKey"
|
||||
)
|
||||
|
||||
// SkuName enumerates the values for sku name.
|
||||
@@ -172,64 +120,127 @@ type UnavailableReason string
|
||||
const (
|
||||
// InvalidName specifies the invalid name state for unavailable reason.
|
||||
InvalidName UnavailableReason = "InvalidName"
|
||||
// NameInLockdown specifies the name in lockdown state for unavailable
|
||||
// reason.
|
||||
// NameInLockdown specifies the name in lockdown state for unavailable reason.
|
||||
NameInLockdown UnavailableReason = "NameInLockdown"
|
||||
// NameInUse specifies the name in use state for unavailable reason.
|
||||
NameInUse UnavailableReason = "NameInUse"
|
||||
// None specifies the none state for unavailable reason.
|
||||
None UnavailableReason = "None"
|
||||
// SubscriptionIsDisabled specifies the subscription is disabled state for
|
||||
// unavailable reason.
|
||||
// SubscriptionIsDisabled specifies the subscription is disabled state for unavailable reason.
|
||||
SubscriptionIsDisabled UnavailableReason = "SubscriptionIsDisabled"
|
||||
// TooManyNamespaceInCurrentSubscription specifies the too many namespace
|
||||
// in current subscription state for unavailable reason.
|
||||
// TooManyNamespaceInCurrentSubscription specifies the too many namespace in current subscription state for unavailable
|
||||
// reason.
|
||||
TooManyNamespaceInCurrentSubscription UnavailableReason = "TooManyNamespaceInCurrentSubscription"
|
||||
)
|
||||
|
||||
// CheckNameAvailability is description of a Check Name availability request
|
||||
// properties.
|
||||
// AccessKeys is namespace/ServiceBus Connection String
|
||||
type AccessKeys 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"`
|
||||
}
|
||||
|
||||
// Action is represents the filter actions which are allowed for the transformation of a message that have been matched
|
||||
// by a filter expression.
|
||||
type Action struct {
|
||||
SQLExpression *string `json:"sqlExpression,omitempty"`
|
||||
CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"`
|
||||
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
|
||||
}
|
||||
|
||||
// AuthorizationRuleProperties is authorizationRule properties.
|
||||
type AuthorizationRuleProperties struct {
|
||||
Rights *[]AccessRights `json:"rights,omitempty"`
|
||||
}
|
||||
|
||||
// CaptureDescription is properties to configure capture description for eventhub
|
||||
type CaptureDescription struct {
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
Encoding EncodingCaptureDescription `json:"encoding,omitempty"`
|
||||
IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"`
|
||||
SizeLimitInBytes *int32 `json:"sizeLimitInBytes,omitempty"`
|
||||
Destination *Destination `json:"destination,omitempty"`
|
||||
}
|
||||
|
||||
// CheckNameAvailability is description of a Check Name availability request properties.
|
||||
type CheckNameAvailability struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// CheckNameAvailabilityResult is description of a Check Name availability
|
||||
// request properties.
|
||||
// CheckNameAvailabilityResult is description of a Check Name availability request properties.
|
||||
type CheckNameAvailabilityResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
NameAvailable *bool `json:"nameAvailable,omitempty"`
|
||||
Reason UnavailableReason `json:"reason,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// MessageCountDetails is message Count Details.
|
||||
type MessageCountDetails struct {
|
||||
ActiveMessageCount *int64 `json:"activeMessageCount,omitempty"`
|
||||
DeadLetterMessageCount *int64 `json:"deadLetterMessageCount,omitempty"`
|
||||
ScheduledMessageCount *int64 `json:"scheduledMessageCount,omitempty"`
|
||||
TransferDeadLetterMessageCount *int64 `json:"transferDeadLetterMessageCount,omitempty"`
|
||||
TransferMessageCount *int64 `json:"transferMessageCount,omitempty"`
|
||||
// CorrelationFilter is represents the correlation filter expression.
|
||||
type CorrelationFilter struct {
|
||||
CorrelationID *string `json:"correlationId,omitempty"`
|
||||
MessageID *string `json:"messageId,omitempty"`
|
||||
To *string `json:"to,omitempty"`
|
||||
ReplyTo *string `json:"replyTo,omitempty"`
|
||||
Label *string `json:"label,omitempty"`
|
||||
SessionID *string `json:"sessionId,omitempty"`
|
||||
ReplyToSessionID *string `json:"replyToSessionId,omitempty"`
|
||||
ContentType *string `json:"contentType,omitempty"`
|
||||
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceCreateOrUpdateParameters is parameters supplied to the Create Or
|
||||
// Update Namespace operation.
|
||||
type NamespaceCreateOrUpdateParameters struct {
|
||||
Location *string `json:"location,omitempty"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
*NamespaceProperties `json:"properties,omitempty"`
|
||||
// Destination is capture storage details for capture description
|
||||
type Destination struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
*DestinationProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceListResult is the response of the List Namespace operation.
|
||||
type NamespaceListResult struct {
|
||||
// DestinationProperties is properties describing the storage account, blob container and acrchive name format for
|
||||
// capture destination
|
||||
type DestinationProperties struct {
|
||||
StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
|
||||
BlobContainer *string `json:"blobContainer,omitempty"`
|
||||
ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse is error reponse indicates ServiceBus service is not able to process the incoming request. The reason
|
||||
// is provided in the error message.
|
||||
type ErrorResponse struct {
|
||||
Code *string `json:"code,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Eventhub is single item in List or Get Event Hub operation
|
||||
type Eventhub struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*EventhubProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// EventhubProperties is properties supplied to the Create Or Update Event Hub operation.
|
||||
type EventhubProperties struct {
|
||||
PartitionIds *[]string `json:"partitionIds,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
MessageRetentionInDays *int64 `json:"messageRetentionInDays,omitempty"`
|
||||
PartitionCount *int64 `json:"partitionCount,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"`
|
||||
}
|
||||
|
||||
// EventHubListResult is the result of the List EventHubs operation.
|
||||
type EventHubListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]NamespaceResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]Eventhub `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// EventHubListResultPreparer 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) {
|
||||
func (client EventHubListResult) EventHubListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -239,34 +250,13 @@ func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request,
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// NamespaceProperties is properties of the namespace.
|
||||
type NamespaceProperties struct {
|
||||
ProvisioningState *string `json:"provisioningState,omitempty"`
|
||||
Status NamespaceState `json:"status,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"`
|
||||
CreateACSNamespace *bool `json:"createACSNamespace,omitempty"`
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceResource is description of a namespace resource.
|
||||
type NamespaceResource 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"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
*NamespaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceUpdateParameters is parameters supplied to the Patch Namespace
|
||||
// operation.
|
||||
type NamespaceUpdateParameters struct {
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
// MessageCountDetails is message Count Details.
|
||||
type MessageCountDetails struct {
|
||||
ActiveMessageCount *int64 `json:"activeMessageCount,omitempty"`
|
||||
DeadLetterMessageCount *int64 `json:"deadLetterMessageCount,omitempty"`
|
||||
ScheduledMessageCount *int64 `json:"scheduledMessageCount,omitempty"`
|
||||
TransferMessageCount *int64 `json:"transferMessageCount,omitempty"`
|
||||
TransferDeadLetterMessageCount *int64 `json:"transferDeadLetterMessageCount,omitempty"`
|
||||
}
|
||||
|
||||
// Operation is a ServiceBus REST API operation
|
||||
@@ -282,9 +272,8 @@ type OperationDisplay struct {
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult is result of the request to list ServiceBus operations.
|
||||
// It contains a list of operations and a URL link to get the next set of
|
||||
// results.
|
||||
// OperationListResult is result of the request to list ServiceBus operations. It contains a list of operations and a
|
||||
// URL link to get the next set of results.
|
||||
type OperationListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]Operation `json:"value,omitempty"`
|
||||
@@ -303,24 +292,32 @@ func (client OperationListResult) OperationListResultPreparer() (*http.Request,
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// QueueCreateOrUpdateParameters is parameters supplied to the Create Or Update
|
||||
// Queue operation.
|
||||
type QueueCreateOrUpdateParameters struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
*QueueProperties `json:"properties,omitempty"`
|
||||
// PremiumMessagingRegions is premium Messaging Region
|
||||
type PremiumMessagingRegions 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 *PremiumMessagingRegionsProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// QueueListResult is the response to the List Queues operation.
|
||||
type QueueListResult struct {
|
||||
// PremiumMessagingRegionsProperties is
|
||||
type PremiumMessagingRegionsProperties struct {
|
||||
Code *string `json:"code,omitempty"`
|
||||
FullName *string `json:"fullName,omitempty"`
|
||||
}
|
||||
|
||||
// PremiumMessagingRegionsListResult is the response of the List PremiumMessagingRegions operation.
|
||||
type PremiumMessagingRegionsListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]QueueResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]PremiumMessagingRegions `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// QueueListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// PremiumMessagingRegionsListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client QueueListResult) QueueListResultPreparer() (*http.Request, error) {
|
||||
func (client PremiumMessagingRegionsListResult) PremiumMessagingRegionsListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -330,85 +327,48 @@ func (client QueueListResult) QueueListResultPreparer() (*http.Request, error) {
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// QueueProperties is the Queue Properties definition.
|
||||
type QueueProperties struct {
|
||||
LockDuration *string `json:"lockDuration,omitempty"`
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
EntityAvailabilityStatus EntityAvailabilityStatus `json:"entityAvailabilityStatus,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"`
|
||||
EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"`
|
||||
DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"`
|
||||
EnableExpress *bool `json:"enableExpress,omitempty"`
|
||||
EnablePartitioning *bool `json:"enablePartitioning,omitempty"`
|
||||
IsAnonymousAccessible *bool `json:"isAnonymousAccessible,omitempty"`
|
||||
MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
|
||||
MaxSizeInMegabytes *int64 `json:"maxSizeInMegabytes,omitempty"`
|
||||
MessageCount *int64 `json:"messageCount,omitempty"`
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"`
|
||||
RequiresSession *bool `json:"requiresSession,omitempty"`
|
||||
SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
SupportOrdering *bool `json:"supportOrdering,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
}
|
||||
|
||||
// QueueResource is description of queue Resource.
|
||||
type QueueResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*QueueProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// RegenerateKeysParameters is parameters supplied to the Regenerate
|
||||
// Authorization Rule operation.
|
||||
type RegenerateKeysParameters struct {
|
||||
Policykey Policykey `json:"Policykey,omitempty"`
|
||||
// RegenerateAccessKeyParameters is parameters supplied to the Regenerate Authorization Rule operation, specifies which
|
||||
// key neeeds to be reset.
|
||||
type RegenerateAccessKeyParameters struct {
|
||||
KeyType KeyType `json:"keyType,omitempty"`
|
||||
Key *string `json:"key,omitempty"`
|
||||
}
|
||||
|
||||
// Resource is the Resource definition for other than namespace.
|
||||
type Resource struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,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"`
|
||||
// ResourceNamespacePatch is the Resource definition.
|
||||
type ResourceNamespacePatch 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"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters supplied
|
||||
// to the Create Or Update Authorization Rules operation.
|
||||
type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
|
||||
Location *string `json:"location,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
*SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleListResult is the response to the List
|
||||
// Namespace operation.
|
||||
type SharedAccessAuthorizationRuleListResult struct {
|
||||
// Rule is description of Rule Resource.
|
||||
type Rule struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SharedAccessAuthorizationRuleResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*Ruleproperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// RuleListResult is the response of the List rule operation.
|
||||
type RuleListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]Rule `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// RuleListResultPreparer 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) {
|
||||
func (client RuleListResult) RuleListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -418,48 +378,174 @@ func (client SharedAccessAuthorizationRuleListResult) SharedAccessAuthorizationR
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleProperties is sharedAccessAuthorizationRule
|
||||
// properties.
|
||||
type SharedAccessAuthorizationRuleProperties struct {
|
||||
// Ruleproperties is description of Rule Resource.
|
||||
type Ruleproperties struct {
|
||||
Action *Action `json:"action,omitempty"`
|
||||
FilterType FilterType `json:"filterType,omitempty"`
|
||||
SQLFilter *SQLFilter `json:"sqlFilter,omitempty"`
|
||||
CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"`
|
||||
}
|
||||
|
||||
// SBAuthorizationRule is description of a namespace authorization rule.
|
||||
type SBAuthorizationRule struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SBAuthorizationRuleProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SBAuthorizationRuleProperties is authorizationRule properties.
|
||||
type SBAuthorizationRuleProperties struct {
|
||||
Rights *[]AccessRights `json:"rights,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleResource is description of a namespace
|
||||
// authorization rule.
|
||||
type SharedAccessAuthorizationRuleResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
|
||||
// SBAuthorizationRuleListResult is the response to the List Namespace operation.
|
||||
type SBAuthorizationRuleListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SBAuthorizationRule `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// Sku is sKU of the namespace.
|
||||
type Sku struct {
|
||||
// SBAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client SBAuthorizationRuleListResult) SBAuthorizationRuleListResultPreparer() (*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)))
|
||||
}
|
||||
|
||||
// SBNamespace is description of a namespace resource.
|
||||
type SBNamespace 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 *SBSku `json:"sku,omitempty"`
|
||||
*SBNamespaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SBNamespaceListResult is the response of the List Namespace operation.
|
||||
type SBNamespaceListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SBNamespace `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// SBNamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client SBNamespaceListResult) SBNamespaceListResultPreparer() (*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)))
|
||||
}
|
||||
|
||||
// SBNamespaceProperties is properties of the namespace.
|
||||
type SBNamespaceProperties struct {
|
||||
ProvisioningState *string `json:"provisioningState,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"`
|
||||
MetricID *string `json:"metricId,omitempty"`
|
||||
}
|
||||
|
||||
// SBNamespaceUpdateParameters is description of a namespace resource.
|
||||
type SBNamespaceUpdateParameters 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"`
|
||||
Sku *SBSku `json:"sku,omitempty"`
|
||||
*SBNamespaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SBQueue is description of queue Resource.
|
||||
type SBQueue struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SBQueueProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SBQueueListResult is the response to the List Queues operation.
|
||||
type SBQueueListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SBQueue `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// SBQueueListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client SBQueueListResult) SBQueueListResultPreparer() (*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)))
|
||||
}
|
||||
|
||||
// SBQueueProperties is the Queue Properties definition.
|
||||
type SBQueueProperties struct {
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
|
||||
MessageCount *int64 `json:"messageCount,omitempty"`
|
||||
LockDuration *string `json:"lockDuration,omitempty"`
|
||||
MaxSizeInMegabytes *int32 `json:"maxSizeInMegabytes,omitempty"`
|
||||
RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"`
|
||||
RequiresSession *bool `json:"requiresSession,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"`
|
||||
DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"`
|
||||
MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
EnablePartitioning *bool `json:"enablePartitioning,omitempty"`
|
||||
EnableExpress *bool `json:"enableExpress,omitempty"`
|
||||
}
|
||||
|
||||
// SBSku is SKU of the namespace.
|
||||
type SBSku struct {
|
||||
Name SkuName `json:"name,omitempty"`
|
||||
Tier SkuTier `json:"tier,omitempty"`
|
||||
Capacity *int32 `json:"capacity,omitempty"`
|
||||
}
|
||||
|
||||
// SubscriptionCreateOrUpdateParameters is parameters supplied to the Create Or
|
||||
// Update Subscription operation.
|
||||
type SubscriptionCreateOrUpdateParameters struct {
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SubscriptionProperties `json:"properties,omitempty"`
|
||||
// SBSubscription is description of subscription resource.
|
||||
type SBSubscription struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SBSubscriptionProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// SubscriptionListResult is the response to the List Subscriptions operation.
|
||||
type SubscriptionListResult struct {
|
||||
// SBSubscriptionListResult is the response to the List Subscriptions operation.
|
||||
type SBSubscriptionListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SubscriptionResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]SBSubscription `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// SubscriptionListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// SBSubscriptionListResultPreparer 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) {
|
||||
func (client SBSubscriptionListResult) SBSubscriptionListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -469,54 +555,43 @@ func (client SubscriptionListResult) SubscriptionListResultPreparer() (*http.Req
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// SubscriptionProperties is description of Subscription Resource.
|
||||
type SubscriptionProperties struct {
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"`
|
||||
DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"`
|
||||
EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"`
|
||||
EntityAvailabilityStatus EntityAvailabilityStatus `json:"entityAvailabilityStatus,omitempty"`
|
||||
IsReadOnly *bool `json:"isReadOnly,omitempty"`
|
||||
LockDuration *string `json:"lockDuration,omitempty"`
|
||||
MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
|
||||
MessageCount *int64 `json:"messageCount,omitempty"`
|
||||
RequiresSession *bool `json:"requiresSession,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
// SBSubscriptionProperties is description of Subscription Resource.
|
||||
type SBSubscriptionProperties struct {
|
||||
MessageCount *int64 `json:"messageCount,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
LockDuration *string `json:"lockDuration,omitempty"`
|
||||
RequiresSession *bool `json:"requiresSession,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"`
|
||||
DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"`
|
||||
MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
}
|
||||
|
||||
// SubscriptionResource is description of subscription resource.
|
||||
type SubscriptionResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SubscriptionProperties `json:"properties,omitempty"`
|
||||
// SBTopic is description of topic resource.
|
||||
type SBTopic struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*SBTopicProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// TopicCreateOrUpdateParameters is parameters supplied to the Create Or Update
|
||||
// Topic operation.
|
||||
type TopicCreateOrUpdateParameters struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
*TopicProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// TopicListResult is the response to the List Topics operation.
|
||||
type TopicListResult struct {
|
||||
// SBTopicListResult is the response to the List Topics operation.
|
||||
type SBTopicListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]TopicResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]SBTopic `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// TopicListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// SBTopicListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client TopicListResult) TopicListResultPreparer() (*http.Request, error) {
|
||||
func (client SBTopicListResult) SBTopicListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -526,46 +601,47 @@ func (client TopicListResult) TopicListResultPreparer() (*http.Request, error) {
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// TopicProperties is the Tpoic Properties definition.
|
||||
type TopicProperties struct {
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
EntityAvailabilityStatus EntityAvailabilityStatus `json:"entityAvailabilityStatus,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"`
|
||||
EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"`
|
||||
EnableExpress *bool `json:"enableExpress,omitempty"`
|
||||
EnablePartitioning *bool `json:"enablePartitioning,omitempty"`
|
||||
EnableSubscriptionPartitioning *bool `json:"enableSubscriptionPartitioning,omitempty"`
|
||||
FilteringMessagesBeforePublishing *bool `json:"filteringMessagesBeforePublishing,omitempty"`
|
||||
IsAnonymousAccessible *bool `json:"isAnonymousAccessible,omitempty"`
|
||||
IsExpress *bool `json:"isExpress,omitempty"`
|
||||
MaxSizeInMegabytes *int64 `json:"maxSizeInMegabytes,omitempty"`
|
||||
RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"`
|
||||
SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
SubscriptionCount *int32 `json:"subscriptionCount,omitempty"`
|
||||
SupportOrdering *bool `json:"supportOrdering,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
// SBTopicProperties is the Tpoic Properties definition.
|
||||
type SBTopicProperties struct {
|
||||
SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
AccessedAt *date.Time `json:"accessedAt,omitempty"`
|
||||
SubscriptionCount *int32 `json:"subscriptionCount,omitempty"`
|
||||
CountDetails *MessageCountDetails `json:"countDetails,omitempty"`
|
||||
DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"`
|
||||
MaxSizeInMegabytes *int32 `json:"maxSizeInMegabytes,omitempty"`
|
||||
RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"`
|
||||
DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"`
|
||||
EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
SupportOrdering *bool `json:"supportOrdering,omitempty"`
|
||||
AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"`
|
||||
EnablePartitioning *bool `json:"enablePartitioning,omitempty"`
|
||||
EnableExpress *bool `json:"enableExpress,omitempty"`
|
||||
}
|
||||
|
||||
// TopicResource is description of topic resource.
|
||||
type TopicResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*TopicProperties `json:"properties,omitempty"`
|
||||
// SQLFilter is represents a filter which is a composition of an expression and an action that is executed in the
|
||||
// pub/sub pipeline.
|
||||
type SQLFilter struct {
|
||||
SQLExpression *string `json:"sqlExpression,omitempty"`
|
||||
CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"`
|
||||
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
|
||||
}
|
||||
|
||||
// SQLRuleAction is represents set of actions written in SQL language-based syntax that is performed against a
|
||||
// ServiceBus.Messaging.BrokeredMessage
|
||||
type SQLRuleAction struct {
|
||||
SQLExpression *string `json:"sqlExpression,omitempty"`
|
||||
CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"`
|
||||
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
|
||||
}
|
||||
|
||||
// TrackedResource is the Resource definition.
|
||||
type TrackedResource struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
+304
-198
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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,8 +34,7 @@ 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)}
|
||||
}
|
||||
@@ -78,7 +76,7 @@ func (client NamespacesClient) CheckNameAvailabilityMethodPreparer(parameters Ch
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -112,24 +110,19 @@ func (client NamespacesClient) CheckNameAvailabilityMethodResponder(resp *http.R
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or 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.
|
||||
// CreateOrUpdate creates or 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 name of the Resource group within the Azure
|
||||
// subscription. 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{}) (<-chan NamespaceResource, <-chan error) {
|
||||
resultChan := make(chan NamespaceResource, 1)
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name.
|
||||
// parameters is parameters supplied to create a namespace resource.
|
||||
func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters SBNamespace, cancel <-chan struct{}) (<-chan SBNamespace, <-chan error) {
|
||||
resultChan := make(chan SBNamespace, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
errChan <- validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "CreateOrUpdate")
|
||||
close(errChan)
|
||||
close(resultChan)
|
||||
@@ -138,10 +131,12 @@ func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespac
|
||||
|
||||
go func() {
|
||||
var err error
|
||||
var result NamespaceResource
|
||||
var result SBNamespace
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -167,14 +162,14 @@ func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespac
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client NamespacesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
|
||||
func (client NamespacesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, parameters SBNamespace, 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),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -199,7 +194,7 @@ func (client NamespacesClient) CreateOrUpdateSender(req *http.Request) (*http.Re
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (result SBNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -210,14 +205,11 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an authorization rule for
|
||||
// a namespace.
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an authorization rule for a namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name authorizationRuleName is
|
||||
// the authorizationrule name. parameters is the shared access authorization
|
||||
// rule.
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// authorizationRuleName is the authorizationrule name. parameters is the shared access authorization rule.
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -226,11 +218,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -256,7 +244,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -264,7 +252,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(resourceG
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -287,7 +275,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleSender(req *http.R
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -298,14 +286,11 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *ht
|
||||
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.
|
||||
// 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 name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. 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)
|
||||
@@ -326,8 +311,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)
|
||||
}()
|
||||
@@ -360,7 +347,7 @@ func (client NamespacesClient) DeletePreparer(resourceGroupName string, namespac
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -395,9 +382,8 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto
|
||||
|
||||
// DeleteAuthorizationRule deletes a namespace authorization rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name authorizationRuleName is
|
||||
// the authorizationrule name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// authorizationRuleName is the authorizationrule name.
|
||||
func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -407,8 +393,7 @@ func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "DeleteAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -442,7 +427,7 @@ func (client NamespacesClient) DeleteAuthorizationRulePreparer(resourceGroupName
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -475,9 +460,8 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo
|
||||
|
||||
// Get gets a description for the specified namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name
|
||||
func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result NamespaceResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result SBNamespace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -517,7 +501,7 @@ func (client NamespacesClient) GetPreparer(resourceGroupName string, namespaceNa
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -538,7 +522,7 @@ func (client NamespacesClient) GetSender(req *http.Request) (*http.Response, err
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) GetResponder(resp *http.Response) (result SBNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -549,13 +533,11 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result Namespa
|
||||
return
|
||||
}
|
||||
|
||||
// GetAuthorizationRule gets an authorization rule for a namespace by rule
|
||||
// name.
|
||||
// GetAuthorizationRule gets an authorization rule for a namespace by rule name.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name authorizationRuleName is
|
||||
// the authorizationrule name.
|
||||
func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// authorizationRuleName is the authorizationrule name.
|
||||
func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -564,8 +546,7 @@ func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, na
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "GetAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -599,7 +580,7 @@ func (client NamespacesClient) GetAuthorizationRulePreparer(resourceGroupName st
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -620,7 +601,7 @@ func (client NamespacesClient) GetAuthorizationRuleSender(req *http.Request) (*h
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -631,11 +612,140 @@ func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response
|
||||
return
|
||||
}
|
||||
|
||||
// List gets all the available namespaces within the subscription, irrespective of the resource groups.
|
||||
func (client NamespacesClient) List() (result SBNamespaceListResult, err error) {
|
||||
req, err := client.ListPreparer()
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client NamespacesClient) ListPreparer() (*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.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/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 SBNamespaceListResult, 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 SBNamespaceListResult) (result SBNamespaceListResult, err error) {
|
||||
req, err := lastResults.SBNamespaceListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "List", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client NamespacesClient) ListComplete(cancel <-chan struct{}) (<-chan SBNamespace, <-chan error) {
|
||||
resultChan := make(chan SBNamespace)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.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
|
||||
}
|
||||
}
|
||||
}
|
||||
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 namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name
|
||||
func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SBAuthorizationRuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -675,7 +785,7 @@ func (client NamespacesClient) ListAuthorizationRulesPreparer(resourceGroupName
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -696,7 +806,7 @@ func (client NamespacesClient) ListAuthorizationRulesSender(req *http.Request) (
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SBAuthorizationRuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -708,8 +818,8 @@ func (client NamespacesClient) ListAuthorizationRulesResponder(resp *http.Respon
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
|
||||
func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
|
||||
func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults SBAuthorizationRuleListResult) (result SBAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SBAuthorizationRuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -731,11 +841,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 SBAuthorizationRule, <-chan error) {
|
||||
resultChan := make(chan SBAuthorizationRule)
|
||||
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
|
||||
}
|
||||
|
||||
// ListByResourceGroup gets the available namespaces within a resource group.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription.
|
||||
func (client NamespacesClient) ListByResourceGroup(resourceGroupName string) (result NamespaceListResult, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription.
|
||||
func (client NamespacesClient) ListByResourceGroup(resourceGroupName string) (result SBNamespaceListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -771,7 +925,7 @@ func (client NamespacesClient) ListByResourceGroupPreparer(resourceGroupName str
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -792,7 +946,7 @@ func (client NamespacesClient) ListByResourceGroupSender(req *http.Request) (*ht
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) ListByResourceGroupResponder(resp *http.Response) (result SBNamespaceListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -804,8 +958,8 @@ func (client NamespacesClient) ListByResourceGroupResponder(resp *http.Response)
|
||||
}
|
||||
|
||||
// ListByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client NamespacesClient) ListByResourceGroupNextResults(lastResults NamespaceListResult) (result NamespaceListResult, err error) {
|
||||
req, err := lastResults.NamespaceListResultPreparer()
|
||||
func (client NamespacesClient) ListByResourceGroupNextResults(lastResults SBNamespaceListResult) (result SBNamespaceListResult, err error) {
|
||||
req, err := lastResults.SBNamespaceListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -827,99 +981,56 @@ func (client NamespacesClient) ListByResourceGroupNextResults(lastResults Namesp
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscription gets all the available namespaces within the
|
||||
// subscription, irrespective of the resource groups.
|
||||
func (client NamespacesClient) ListBySubscription() (result NamespaceListResult, err error) {
|
||||
req, err := client.ListBySubscriptionPreparer()
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
// ListByResourceGroupComplete gets all elements from the list without paging.
|
||||
func (client NamespacesClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan SBNamespace, <-chan error) {
|
||||
resultChan := make(chan SBNamespace)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByResourceGroup(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.ListByResourceGroupNextResults(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
|
||||
}
|
||||
|
||||
// ListBySubscriptionPreparer prepares the ListBySubscription request.
|
||||
func (client NamespacesClient) ListBySubscriptionPreparer() (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": 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")
|
||||
}
|
||||
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")
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.NamespacesClient", "ListBySubscription", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys gets the primary and secondary connection strings for the
|
||||
// namespace.
|
||||
// ListKeys gets the primary and secondary connection strings for the namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name authorizationRuleName is
|
||||
// the authorizationrule name.
|
||||
func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// authorizationRuleName is the authorizationrule name.
|
||||
func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -928,8 +1039,7 @@ func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "ListKeys")
|
||||
}
|
||||
|
||||
@@ -963,7 +1073,7 @@ func (client NamespacesClient) ListKeysPreparer(resourceGroupName string, namesp
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -984,7 +1094,7 @@ func (client NamespacesClient) ListKeysSender(req *http.Request) (*http.Response
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -995,14 +1105,12 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Re
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings for
|
||||
// the namespace.
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings for the namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name authorizationRuleName is
|
||||
// the authorizationrule name. parameters is parameters supplied to regenerate
|
||||
// the authorization rule.
|
||||
func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// authorizationRuleName is the authorizationrule name. parameters is parameters supplied to regenerate the
|
||||
// authorization rule.
|
||||
func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -1011,8 +1119,7 @@ func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespac
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "RegenerateKeys")
|
||||
}
|
||||
|
||||
@@ -1038,7 +1145,7 @@ func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespac
|
||||
}
|
||||
|
||||
// RegenerateKeysPreparer prepares the RegenerateKeys request.
|
||||
func (client NamespacesClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (*http.Request, error) {
|
||||
func (client NamespacesClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -1046,7 +1153,7 @@ func (client NamespacesClient) RegenerateKeysPreparer(resourceGroupName string,
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -1069,7 +1176,7 @@ func (client NamespacesClient) RegenerateKeysSender(req *http.Request) (*http.Re
|
||||
|
||||
// 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) {
|
||||
func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -1080,13 +1187,12 @@ func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates a service namespace. Once created, this namespace's resource
|
||||
// manifest is immutable. This operation is idempotent.
|
||||
// Update updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is
|
||||
// idempotent.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name parameters is parameters
|
||||
// supplied to update a namespace resource.
|
||||
func (client NamespacesClient) Update(resourceGroupName string, namespaceName string, parameters NamespaceUpdateParameters) (result NamespaceResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// parameters is parameters supplied to update a namespace resource.
|
||||
func (client NamespacesClient) Update(resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters) (result SBNamespace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -1119,14 +1225,14 @@ func (client NamespacesClient) Update(resourceGroupName string, namespaceName st
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client NamespacesClient) UpdatePreparer(resourceGroupName string, namespaceName string, parameters NamespaceUpdateParameters) (*http.Request, error) {
|
||||
func (client NamespacesClient) UpdatePreparer(resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters) (*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 = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -1149,7 +1255,7 @@ func (client NamespacesClient) UpdateSender(req *http.Request) (*http.Response,
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client NamespacesClient) UpdateResponder(resp *http.Response) (result NamespaceResource, err error) {
|
||||
func (client NamespacesClient) UpdateResponder(resp *http.Response) (result SBNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+49
-6
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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"
|
||||
@@ -34,8 +33,7 @@ func NewOperationsClient(subscriptionID string) OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient
|
||||
// client.
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
@@ -65,7 +63,7 @@ func (client OperationsClient) List() (result OperationListResult, err error) {
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer() (*http.Request, error) {
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -120,3 +118,48 @@ func (client OperationsClient) ListNextResults(lastResults OperationListResult)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client OperationsClient) ListComplete(cancel <-chan struct{}) (<-chan Operation, <-chan error) {
|
||||
resultChan := make(chan Operation)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.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
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
Generated
Vendored
+169
@@ -0,0 +1,169 @@
|
||||
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.
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PremiumMessagingRegionsClient is the azure Service Bus client
|
||||
type PremiumMessagingRegionsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewPremiumMessagingRegionsClient creates an instance of the PremiumMessagingRegionsClient client.
|
||||
func NewPremiumMessagingRegionsClient(subscriptionID string) PremiumMessagingRegionsClient {
|
||||
return NewPremiumMessagingRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewPremiumMessagingRegionsClientWithBaseURI creates an instance of the PremiumMessagingRegionsClient client.
|
||||
func NewPremiumMessagingRegionsClientWithBaseURI(baseURI string, subscriptionID string) PremiumMessagingRegionsClient {
|
||||
return PremiumMessagingRegionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List gets the available premium messaging regions for servicebus
|
||||
func (client PremiumMessagingRegionsClient) List() (result PremiumMessagingRegionsListResult, err error) {
|
||||
req, err := client.ListPreparer()
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client PremiumMessagingRegionsClient) ListPreparer() (*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.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions", 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 PremiumMessagingRegionsClient) 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 PremiumMessagingRegionsClient) ListResponder(resp *http.Response) (result PremiumMessagingRegionsListResult, 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 PremiumMessagingRegionsClient) ListNextResults(lastResults PremiumMessagingRegionsListResult) (result PremiumMessagingRegionsListResult, err error) {
|
||||
req, err := lastResults.PremiumMessagingRegionsListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.PremiumMessagingRegionsClient", "List", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete gets all elements from the list without paging.
|
||||
func (client PremiumMessagingRegionsClient) ListComplete(cancel <-chan struct{}) (<-chan PremiumMessagingRegions, <-chan error) {
|
||||
resultChan := make(chan PremiumMessagingRegions)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.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
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
+255
-198
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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,14 +39,11 @@ func NewQueuesClientWithBaseURI(baseURI string, subscriptionID string) QueuesCli
|
||||
return QueuesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a Service Bus queue. This operation is
|
||||
// idempotent.
|
||||
// CreateOrUpdate creates or updates a Service Bus queue. This operation is idempotent.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. parameters is parameters supplied to create or update a queue
|
||||
// resource.
|
||||
func (client QueuesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, queueName string, parameters QueueCreateOrUpdateParameters) (result QueueResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. parameters is parameters supplied to create or update a queue resource.
|
||||
func (client QueuesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, queueName string, parameters SBQueue) (result SBQueue, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -56,10 +52,7 @@ func (client QueuesClient) CreateOrUpdate(resourceGroupName string, namespaceNam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
@@ -85,7 +78,7 @@ func (client QueuesClient) CreateOrUpdate(resourceGroupName string, namespaceNam
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client QueuesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, queueName string, parameters QueueCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client QueuesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, queueName string, parameters SBQueue) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"queueName": autorest.Encode("path", queueName),
|
||||
@@ -93,7 +86,7 @@ func (client QueuesClient) CreateOrUpdatePreparer(resourceGroupName string, name
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -116,7 +109,7 @@ func (client QueuesClient) CreateOrUpdateSender(req *http.Request) (*http.Respon
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) CreateOrUpdateResponder(resp *http.Response) (result QueueResource, err error) {
|
||||
func (client QueuesClient) CreateOrUpdateResponder(resp *http.Response) (result SBQueue, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -129,11 +122,10 @@ func (client QueuesClient) CreateOrUpdateResponder(resp *http.Response) (result
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates an authorization rule for a queue.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. authorizationRuleName is the authorizationrule name. parameters is the
|
||||
// shared access authorization rule.
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is the shared access
|
||||
// authorization rule.
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -142,14 +134,9 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRule(resourceGroupName str
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -175,7 +162,7 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRule(resourceGroupName str
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -184,7 +171,7 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroup
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -207,7 +194,7 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRuleSender(req *http.Reque
|
||||
|
||||
// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client QueuesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -220,9 +207,8 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.R
|
||||
|
||||
// Delete deletes a queue from the specified namespace in a resource group.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name.
|
||||
func (client QueuesClient) Delete(resourceGroupName string, namespaceName string, queueName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -232,8 +218,7 @@ func (client QueuesClient) Delete(resourceGroupName string, namespaceName string
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "Delete")
|
||||
}
|
||||
|
||||
@@ -267,7 +252,7 @@ func (client QueuesClient) DeletePreparer(resourceGroupName string, namespaceNam
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -300,9 +285,8 @@ func (client QueuesClient) DeleteResponder(resp *http.Response) (result autorest
|
||||
|
||||
// DeleteAuthorizationRule deletes a queue authorization rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. authorizationRuleName is the authorizationrule name.
|
||||
func (client QueuesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -312,11 +296,9 @@ func (client QueuesClient) DeleteAuthorizationRule(resourceGroupName string, nam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "DeleteAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -351,7 +333,7 @@ func (client QueuesClient) DeleteAuthorizationRulePreparer(resourceGroupName str
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -384,10 +366,9 @@ func (client QueuesClient) DeleteAuthorizationRuleResponder(resp *http.Response)
|
||||
|
||||
// Get returns a description for the specified queue.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name.
|
||||
func (client QueuesClient) Get(resourceGroupName string, namespaceName string, queueName string) (result QueueResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name.
|
||||
func (client QueuesClient) Get(resourceGroupName string, namespaceName string, queueName string) (result SBQueue, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -396,8 +377,7 @@ func (client QueuesClient) Get(resourceGroupName string, namespaceName string, q
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "Get")
|
||||
}
|
||||
|
||||
@@ -431,7 +411,7 @@ func (client QueuesClient) GetPreparer(resourceGroupName string, namespaceName s
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -452,7 +432,7 @@ func (client QueuesClient) GetSender(req *http.Request) (*http.Response, error)
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) GetResponder(resp *http.Response) (result QueueResource, err error) {
|
||||
func (client QueuesClient) GetResponder(resp *http.Response) (result SBQueue, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -465,10 +445,9 @@ func (client QueuesClient) GetResponder(resp *http.Response) (result QueueResour
|
||||
|
||||
// GetAuthorizationRule gets an authorization rule for a queue by rule name.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
func (client QueuesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. authorizationRuleName is the authorizationrule name.
|
||||
func (client QueuesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -477,11 +456,9 @@ func (client QueuesClient) GetAuthorizationRule(resourceGroupName string, namesp
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "GetAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -516,7 +493,7 @@ func (client QueuesClient) GetAuthorizationRulePreparer(resourceGroupName string
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -537,7 +514,7 @@ func (client QueuesClient) GetAuthorizationRuleSender(req *http.Request) (*http.
|
||||
|
||||
// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client QueuesClient) GetAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -548,112 +525,11 @@ func (client QueuesClient) GetAuthorizationRuleResponder(resp *http.Response) (r
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll gets the queues within a namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name
|
||||
func (client QueuesClient) ListAll(resourceGroupName string, namespaceName string) (result QueueListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListAll")
|
||||
}
|
||||
|
||||
req, err := client.ListAllPreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllPreparer prepares the ListAll request.
|
||||
func (client QueuesClient) ListAllPreparer(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),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues", 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 QueuesClient) 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 QueuesClient) ListAllResponder(resp *http.Response) (result QueueListResult, 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 QueuesClient) ListAllNextResults(lastResults QueueListResult) (result QueueListResult, err error) {
|
||||
req, err := lastResults.QueueListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAll", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRules gets all authorization rules for a queue.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name.
|
||||
func (client QueuesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, queueName string) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name.
|
||||
func (client QueuesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, queueName string) (result SBAuthorizationRuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -662,8 +538,7 @@ func (client QueuesClient) ListAuthorizationRules(resourceGroupName string, name
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListAuthorizationRules")
|
||||
}
|
||||
|
||||
@@ -697,7 +572,7 @@ func (client QueuesClient) ListAuthorizationRulesPreparer(resourceGroupName stri
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -718,7 +593,7 @@ func (client QueuesClient) ListAuthorizationRulesSender(req *http.Request) (*htt
|
||||
|
||||
// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
func (client QueuesClient) ListAuthorizationRulesResponder(resp *http.Response) (result SBAuthorizationRuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -730,8 +605,8 @@ func (client QueuesClient) ListAuthorizationRulesResponder(resp *http.Response)
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
|
||||
func (client QueuesClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
|
||||
func (client QueuesClient) ListAuthorizationRulesNextResults(lastResults SBAuthorizationRuleListResult) (result SBAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SBAuthorizationRuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListAuthorizationRules", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -753,12 +628,200 @@ func (client QueuesClient) ListAuthorizationRulesNextResults(lastResults SharedA
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesComplete gets all elements from the list without paging.
|
||||
func (client QueuesClient) ListAuthorizationRulesComplete(resourceGroupName string, namespaceName string, queueName string, cancel <-chan struct{}) (<-chan SBAuthorizationRule, <-chan error) {
|
||||
resultChan := make(chan SBAuthorizationRule)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAuthorizationRules(resourceGroupName, namespaceName, queueName)
|
||||
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
|
||||
}
|
||||
|
||||
// ListByNamespace gets the queues within a namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
func (client QueuesClient) ListByNamespace(resourceGroupName string, namespaceName string) (result SBQueueListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListByNamespace")
|
||||
}
|
||||
|
||||
req, err := client.ListByNamespacePreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespacePreparer prepares the ListByNamespace request.
|
||||
func (client QueuesClient) ListByNamespacePreparer(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),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListByNamespaceSender sends the ListByNamespace request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client QueuesClient) ListByNamespaceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListByNamespaceResponder handles the response to the ListByNamespace request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) ListByNamespaceResponder(resp *http.Response) (result SBQueueListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceNextResults retrieves the next set of results, if any.
|
||||
func (client QueuesClient) ListByNamespaceNextResults(lastResults SBQueueListResult) (result SBQueueListResult, err error) {
|
||||
req, err := lastResults.SBQueueListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.QueuesClient", "ListByNamespace", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceComplete gets all elements from the list without paging.
|
||||
func (client QueuesClient) ListByNamespaceComplete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan SBQueue, <-chan error) {
|
||||
resultChan := make(chan SBQueue)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByNamespace(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.ListByNamespaceNextResults(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 primary and secondary connection strings to the queue.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
func (client QueuesClient) ListKeys(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. authorizationRuleName is the authorizationrule name.
|
||||
func (client QueuesClient) ListKeys(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -767,11 +830,9 @@ func (client QueuesClient) ListKeys(resourceGroupName string, namespaceName stri
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListKeys")
|
||||
}
|
||||
|
||||
@@ -806,7 +867,7 @@ func (client QueuesClient) ListKeysPreparer(resourceGroupName string, namespaceN
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -827,7 +888,7 @@ func (client QueuesClient) ListKeysSender(req *http.Request) (*http.Response, er
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client QueuesClient) ListKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -838,14 +899,12 @@ func (client QueuesClient) ListKeysResponder(resp *http.Response) (result Resour
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings to
|
||||
// the queue.
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings to the queue.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name queueName is the queue
|
||||
// name. authorizationRuleName is the authorizationrule name. parameters is
|
||||
// parameters supplied to regenerate the authorization rule.
|
||||
func (client QueuesClient) RegenerateKeys(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is parameters supplied
|
||||
// to regenerate the authorization rule.
|
||||
func (client QueuesClient) RegenerateKeys(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -854,11 +913,9 @@ func (client QueuesClient) RegenerateKeys(resourceGroupName string, namespaceNam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: queueName,
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "RegenerateKeys")
|
||||
}
|
||||
|
||||
@@ -884,7 +941,7 @@ func (client QueuesClient) RegenerateKeys(resourceGroupName string, namespaceNam
|
||||
}
|
||||
|
||||
// RegenerateKeysPreparer prepares the RegenerateKeys request.
|
||||
func (client QueuesClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateKeysParameters) (*http.Request, error) {
|
||||
func (client QueuesClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -893,7 +950,7 @@ func (client QueuesClient) RegenerateKeysPreparer(resourceGroupName string, name
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -916,7 +973,7 @@ func (client QueuesClient) RegenerateKeysSender(req *http.Request) (*http.Respon
|
||||
|
||||
// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client QueuesClient) RegenerateKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client QueuesClient) RegenerateKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
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.
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RegionsClient is the azure Service Bus client
|
||||
type RegionsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewRegionsClient creates an instance of the RegionsClient client.
|
||||
func NewRegionsClient(subscriptionID string) RegionsClient {
|
||||
return NewRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewRegionsClientWithBaseURI creates an instance of the RegionsClient client.
|
||||
func NewRegionsClientWithBaseURI(baseURI string, subscriptionID string) RegionsClient {
|
||||
return RegionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// ListBySku gets the available Regions for a given sku
|
||||
//
|
||||
// sku is the sku type.
|
||||
func (client RegionsClient) ListBySku(sku string) (result PremiumMessagingRegionsListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: sku,
|
||||
Constraints: []validation.Constraint{{Target: "sku", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.RegionsClient", "ListBySku")
|
||||
}
|
||||
|
||||
req, err := client.ListBySkuPreparer(sku)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySkuSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListBySkuResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySkuPreparer prepares the ListBySku request.
|
||||
func (client RegionsClient) ListBySkuPreparer(sku string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"sku": autorest.Encode("path", sku),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListBySkuSender sends the ListBySku request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client RegionsClient) ListBySkuSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListBySkuResponder handles the response to the ListBySku request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client RegionsClient) ListBySkuResponder(resp *http.Response) (result PremiumMessagingRegionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySkuNextResults retrieves the next set of results, if any.
|
||||
func (client RegionsClient) ListBySkuNextResults(lastResults PremiumMessagingRegionsListResult) (result PremiumMessagingRegionsListResult, err error) {
|
||||
req, err := lastResults.PremiumMessagingRegionsListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySkuSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListBySkuResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RegionsClient", "ListBySku", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySkuComplete gets all elements from the list without paging.
|
||||
func (client RegionsClient) ListBySkuComplete(sku string, cancel <-chan struct{}) (<-chan PremiumMessagingRegions, <-chan error) {
|
||||
resultChan := make(chan PremiumMessagingRegions)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListBySku(sku)
|
||||
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.ListBySkuNextResults(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
|
||||
}
|
||||
+448
@@ -0,0 +1,448 @@
|
||||
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.
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RulesClient is the azure Service Bus client
|
||||
type RulesClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewRulesClient creates an instance of the RulesClient client.
|
||||
func NewRulesClient(subscriptionID string) RulesClient {
|
||||
return NewRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewRulesClientWithBaseURI creates an instance of the RulesClient client.
|
||||
func NewRulesClientWithBaseURI(baseURI string, subscriptionID string) RulesClient {
|
||||
return RulesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a new rule and updates an existing rule
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. parameters is
|
||||
// parameters supplied to create a rule.
|
||||
func (client RulesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule) (result Rule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: ruleName,
|
||||
Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client RulesClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"ruleName": autorest.Encode("path", ruleName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"subscriptionName": autorest.Encode("path", subscriptionName),
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsJSON(),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", 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 RulesClient) 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 RulesClient) CreateOrUpdateResponder(resp *http.Response) (result Rule, 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 rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name.
|
||||
func (client RulesClient) Delete(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: ruleName,
|
||||
Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "Delete")
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Delete", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client RulesClient) DeletePreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"ruleName": autorest.Encode("path", ruleName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"subscriptionName": autorest.Encode("path", subscriptionName),
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", 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 RulesClient) 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 RulesClient) 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 retrieves the description for the specified rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name.
|
||||
func (client RulesClient) Get(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (result Rule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: ruleName,
|
||||
Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "Get")
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(resourceGroupName, namespaceName, topicName, subscriptionName, ruleName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "Get", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client RulesClient) GetPreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"ruleName": autorest.Encode("path", ruleName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"subscriptionName": autorest.Encode("path", subscriptionName),
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", 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 RulesClient) 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 RulesClient) GetResponder(resp *http.Response) (result Rule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptions list all the rules within given topic-subscription
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name.
|
||||
func (client RulesClient) ListBySubscriptions(resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result RuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "ListBySubscriptions")
|
||||
}
|
||||
|
||||
req, err := client.ListBySubscriptionsPreparer(resourceGroupName, namespaceName, topicName, subscriptionName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionsPreparer prepares the ListBySubscriptions request.
|
||||
func (client RulesClient) ListBySubscriptionsPreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"subscriptionName": autorest.Encode("path", subscriptionName),
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListBySubscriptionsSender sends the ListBySubscriptions request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client RulesClient) ListBySubscriptionsSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListBySubscriptionsResponder handles the response to the ListBySubscriptions request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client RulesClient) ListBySubscriptionsResponder(resp *http.Response) (result RuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionsNextResults retrieves the next set of results, if any.
|
||||
func (client RulesClient) ListBySubscriptionsNextResults(lastResults RuleListResult) (result RuleListResult, err error) {
|
||||
req, err := lastResults.RuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.RulesClient", "ListBySubscriptions", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionsComplete gets all elements from the list without paging.
|
||||
func (client RulesClient) ListBySubscriptionsComplete(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, cancel <-chan struct{}) (<-chan Rule, <-chan error) {
|
||||
resultChan := make(chan Rule)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListBySubscriptions(resourceGroupName, namespaceName, topicName, subscriptionName)
|
||||
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.ListBySubscriptionsNextResults(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
|
||||
}
|
||||
+97
-68
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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"
|
||||
@@ -30,25 +29,22 @@ type SubscriptionsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewSubscriptionsClient creates an instance of the SubscriptionsClient
|
||||
// client.
|
||||
// NewSubscriptionsClient creates an instance of the SubscriptionsClient client.
|
||||
func NewSubscriptionsClient(subscriptionID string) SubscriptionsClient {
|
||||
return NewSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewSubscriptionsClientWithBaseURI creates an instance of the
|
||||
// SubscriptionsClient client.
|
||||
// NewSubscriptionsClientWithBaseURI creates an instance of the SubscriptionsClient client.
|
||||
func NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionsClient {
|
||||
return SubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates a topic subscription.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. subscriptionName is the subscription name. parameters is parameters
|
||||
// supplied to create a subscription resource.
|
||||
func (client SubscriptionsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SubscriptionCreateOrUpdateParameters) (result SubscriptionResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name. parameters is parameters supplied to create
|
||||
// a subscription resource.
|
||||
func (client SubscriptionsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription) (result SBSubscription, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -57,13 +53,9 @@ func (client SubscriptionsClient) CreateOrUpdate(resourceGroupName string, names
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
@@ -89,7 +81,7 @@ func (client SubscriptionsClient) CreateOrUpdate(resourceGroupName string, names
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client SubscriptionsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SubscriptionCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client SubscriptionsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
@@ -98,7 +90,7 @@ func (client SubscriptionsClient) CreateOrUpdatePreparer(resourceGroupName strin
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -121,7 +113,7 @@ func (client SubscriptionsClient) CreateOrUpdateSender(req *http.Request) (*http
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SubscriptionsClient) CreateOrUpdateResponder(resp *http.Response) (result SubscriptionResource, err error) {
|
||||
func (client SubscriptionsClient) CreateOrUpdateResponder(resp *http.Response) (result SBSubscription, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -134,9 +126,8 @@ func (client SubscriptionsClient) CreateOrUpdateResponder(resp *http.Response) (
|
||||
|
||||
// Delete deletes a subscription from the specified topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. subscriptionName is the subscription name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name.
|
||||
func (client SubscriptionsClient) Delete(resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -146,11 +137,9 @@ func (client SubscriptionsClient) Delete(resourceGroupName string, namespaceName
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "Delete")
|
||||
}
|
||||
|
||||
@@ -185,7 +174,7 @@ func (client SubscriptionsClient) DeletePreparer(resourceGroupName string, names
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -218,10 +207,9 @@ func (client SubscriptionsClient) DeleteResponder(resp *http.Response) (result a
|
||||
|
||||
// Get returns a subscription description for the specified topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. subscriptionName is the subscription name.
|
||||
func (client SubscriptionsClient) Get(resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result SubscriptionResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. subscriptionName is the subscription name.
|
||||
func (client SubscriptionsClient) Get(resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result SBSubscription, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -230,11 +218,9 @@ func (client SubscriptionsClient) Get(resourceGroupName string, namespaceName st
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: subscriptionName,
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "Get")
|
||||
}
|
||||
|
||||
@@ -269,7 +255,7 @@ func (client SubscriptionsClient) GetPreparer(resourceGroupName string, namespac
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -290,7 +276,7 @@ func (client SubscriptionsClient) GetSender(req *http.Request) (*http.Response,
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SubscriptionsClient) GetResponder(resp *http.Response) (result SubscriptionResource, err error) {
|
||||
func (client SubscriptionsClient) GetResponder(resp *http.Response) (result SBSubscription, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -301,12 +287,11 @@ func (client SubscriptionsClient) GetResponder(resp *http.Response) (result Subs
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll list all the subscriptions under a specified topic.
|
||||
// ListByTopic list all the subscriptions under a specified topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name.
|
||||
func (client SubscriptionsClient) ListAll(resourceGroupName string, namespaceName string, topicName string) (result SubscriptionListResult, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name.
|
||||
func (client SubscriptionsClient) ListByTopic(resourceGroupName string, namespaceName string, topicName string) (result SBSubscriptionListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -315,34 +300,33 @@ func (client SubscriptionsClient) ListAll(resourceGroupName string, namespaceNam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "ListAll")
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "ListByTopic")
|
||||
}
|
||||
|
||||
req, err := client.ListAllPreparer(resourceGroupName, namespaceName, topicName)
|
||||
req, err := client.ListByTopicPreparer(resourceGroupName, namespaceName, topicName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", nil, "Failure preparing request")
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
resp, err := client.ListByTopicSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", resp, "Failure sending request")
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
result, err = client.ListByTopicResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", resp, "Failure responding to request")
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllPreparer prepares the ListAll request.
|
||||
func (client SubscriptionsClient) ListAllPreparer(resourceGroupName string, namespaceName string, topicName string) (*http.Request, error) {
|
||||
// ListByTopicPreparer prepares the ListByTopic request.
|
||||
func (client SubscriptionsClient) ListByTopicPreparer(resourceGroupName string, namespaceName string, topicName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
@@ -350,7 +334,7 @@ func (client SubscriptionsClient) ListAllPreparer(resourceGroupName string, name
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -363,15 +347,15 @@ func (client SubscriptionsClient) ListAllPreparer(resourceGroupName string, name
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListAllSender sends the ListAll request. The method will close the
|
||||
// ListByTopicSender sends the ListByTopic request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SubscriptionsClient) ListAllSender(req *http.Request) (*http.Response, error) {
|
||||
func (client SubscriptionsClient) ListByTopicSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListAllResponder handles the response to the ListAll request. The method always
|
||||
// ListByTopicResponder handles the response to the ListByTopic request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SubscriptionsClient) ListAllResponder(resp *http.Response) (result SubscriptionListResult, err error) {
|
||||
func (client SubscriptionsClient) ListByTopicResponder(resp *http.Response) (result SBSubscriptionListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -382,26 +366,71 @@ func (client SubscriptionsClient) ListAllResponder(resp *http.Response) (result
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllNextResults retrieves the next set of results, if any.
|
||||
func (client SubscriptionsClient) ListAllNextResults(lastResults SubscriptionListResult) (result SubscriptionListResult, err error) {
|
||||
req, err := lastResults.SubscriptionListResultPreparer()
|
||||
// ListByTopicNextResults retrieves the next set of results, if any.
|
||||
func (client SubscriptionsClient) ListByTopicNextResults(lastResults SBSubscriptionListResult) (result SBSubscriptionListResult, err error) {
|
||||
req, err := lastResults.SBSubscriptionListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", nil, "Failure preparing next results request")
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
resp, err := client.ListByTopicSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", resp, "Failure sending next results request")
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
result, err = client.ListByTopicResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListAll", resp, "Failure responding to next results request")
|
||||
err = autorest.NewErrorWithError(err, "servicebus.SubscriptionsClient", "ListByTopic", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByTopicComplete gets all elements from the list without paging.
|
||||
func (client SubscriptionsClient) ListByTopicComplete(resourceGroupName string, namespaceName string, topicName string, cancel <-chan struct{}) (<-chan SBSubscription, <-chan error) {
|
||||
resultChan := make(chan SBSubscription)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByTopic(resourceGroupName, namespaceName, topicName)
|
||||
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.ListByTopicNextResults(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
|
||||
}
|
||||
|
||||
+255
-197
@@ -14,9 +14,8 @@ package servicebus
|
||||
// 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"
|
||||
@@ -42,10 +41,9 @@ func NewTopicsClientWithBaseURI(baseURI string, subscriptionID string) TopicsCli
|
||||
|
||||
// CreateOrUpdate creates a topic in the specified namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. parameters is parameters supplied to create a topic resource.
|
||||
func (client TopicsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, topicName string, parameters TopicCreateOrUpdateParameters) (result TopicResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. parameters is parameters supplied to create a topic resource.
|
||||
func (client TopicsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, topicName string, parameters SBTopic) (result SBTopic, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -54,10 +52,7 @@ func (client TopicsClient) CreateOrUpdate(resourceGroupName string, namespaceNam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
@@ -83,7 +78,7 @@ func (client TopicsClient) CreateOrUpdate(resourceGroupName string, namespaceNam
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client TopicsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, topicName string, parameters TopicCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client TopicsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, topicName string, parameters SBTopic) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
@@ -91,7 +86,7 @@ func (client TopicsClient) CreateOrUpdatePreparer(resourceGroupName string, name
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -114,7 +109,7 @@ func (client TopicsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result TopicResource, err error) {
|
||||
func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result SBTopic, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -125,14 +120,12 @@ func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates an authorizatio rule for the
|
||||
// specified topic.
|
||||
// CreateOrUpdateAuthorizationRule creates an authorizatio rule for the specified topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. authorizationRuleName is the authorizationrule name. parameters is the
|
||||
// shared access authorization rule.
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is the shared access
|
||||
// authorization rule.
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -141,14 +134,9 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRule(resourceGroupName str
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "CreateOrUpdateAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -174,7 +162,7 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRule(resourceGroupName str
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -183,7 +171,7 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroup
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -206,7 +194,7 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRuleSender(req *http.Reque
|
||||
|
||||
// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client TopicsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -219,9 +207,8 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.R
|
||||
|
||||
// Delete deletes a topic from the specified namespace and resource group.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name.
|
||||
func (client TopicsClient) Delete(resourceGroupName string, namespaceName string, topicName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -231,8 +218,7 @@ func (client TopicsClient) Delete(resourceGroupName string, namespaceName string
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "Delete")
|
||||
}
|
||||
|
||||
@@ -266,7 +252,7 @@ func (client TopicsClient) DeletePreparer(resourceGroupName string, namespaceNam
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -299,9 +285,8 @@ func (client TopicsClient) DeleteResponder(resp *http.Response) (result autorest
|
||||
|
||||
// DeleteAuthorizationRule deletes a topic authorization rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. authorizationRuleName is the authorizationrule name.
|
||||
func (client TopicsClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -311,11 +296,9 @@ func (client TopicsClient) DeleteAuthorizationRule(resourceGroupName string, nam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "DeleteAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -350,7 +333,7 @@ func (client TopicsClient) DeleteAuthorizationRulePreparer(resourceGroupName str
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -383,10 +366,9 @@ func (client TopicsClient) DeleteAuthorizationRuleResponder(resp *http.Response)
|
||||
|
||||
// Get returns a description for the specified topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name.
|
||||
func (client TopicsClient) Get(resourceGroupName string, namespaceName string, topicName string) (result TopicResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name.
|
||||
func (client TopicsClient) Get(resourceGroupName string, namespaceName string, topicName string) (result SBTopic, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -395,8 +377,7 @@ func (client TopicsClient) Get(resourceGroupName string, namespaceName string, t
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "Get")
|
||||
}
|
||||
|
||||
@@ -430,7 +411,7 @@ func (client TopicsClient) GetPreparer(resourceGroupName string, namespaceName s
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -451,7 +432,7 @@ func (client TopicsClient) GetSender(req *http.Request) (*http.Response, error)
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) GetResponder(resp *http.Response) (result TopicResource, err error) {
|
||||
func (client TopicsClient) GetResponder(resp *http.Response) (result SBTopic, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -464,10 +445,9 @@ func (client TopicsClient) GetResponder(resp *http.Response) (result TopicResour
|
||||
|
||||
// GetAuthorizationRule returns the specified authorization rule.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
func (client TopicsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. authorizationRuleName is the authorizationrule name.
|
||||
func (client TopicsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result SBAuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -476,11 +456,9 @@ func (client TopicsClient) GetAuthorizationRule(resourceGroupName string, namesp
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "GetAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -515,7 +493,7 @@ func (client TopicsClient) GetAuthorizationRulePreparer(resourceGroupName string
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -536,7 +514,7 @@ func (client TopicsClient) GetAuthorizationRuleSender(req *http.Request) (*http.
|
||||
|
||||
// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client TopicsClient) GetAuthorizationRuleResponder(resp *http.Response) (result SBAuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -547,112 +525,11 @@ func (client TopicsClient) GetAuthorizationRuleResponder(resp *http.Response) (r
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll gets all the topics in a namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name
|
||||
func (client TopicsClient) ListAll(resourceGroupName string, namespaceName string) (result TopicListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListAll")
|
||||
}
|
||||
|
||||
req, err := client.ListAllPreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllPreparer prepares the ListAll request.
|
||||
func (client TopicsClient) ListAllPreparer(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),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics", 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 TopicsClient) 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 TopicsClient) ListAllResponder(resp *http.Response) (result TopicListResult, 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 TopicsClient) ListAllNextResults(lastResults TopicListResult) (result TopicListResult, err error) {
|
||||
req, err := lastResults.TopicListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAll", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRules gets authorization rules for a topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name.
|
||||
func (client TopicsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, topicName string) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name.
|
||||
func (client TopicsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, topicName string) (result SBAuthorizationRuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -661,8 +538,7 @@ func (client TopicsClient) ListAuthorizationRules(resourceGroupName string, name
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListAuthorizationRules")
|
||||
}
|
||||
|
||||
@@ -696,7 +572,7 @@ func (client TopicsClient) ListAuthorizationRulesPreparer(resourceGroupName stri
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -717,7 +593,7 @@ func (client TopicsClient) ListAuthorizationRulesSender(req *http.Request) (*htt
|
||||
|
||||
// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
func (client TopicsClient) ListAuthorizationRulesResponder(resp *http.Response) (result SBAuthorizationRuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -729,8 +605,8 @@ func (client TopicsClient) ListAuthorizationRulesResponder(resp *http.Response)
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
|
||||
func (client TopicsClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
|
||||
func (client TopicsClient) ListAuthorizationRulesNextResults(lastResults SBAuthorizationRuleListResult) (result SBAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SBAuthorizationRuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListAuthorizationRules", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -752,12 +628,200 @@ func (client TopicsClient) ListAuthorizationRulesNextResults(lastResults SharedA
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesComplete gets all elements from the list without paging.
|
||||
func (client TopicsClient) ListAuthorizationRulesComplete(resourceGroupName string, namespaceName string, topicName string, cancel <-chan struct{}) (<-chan SBAuthorizationRule, <-chan error) {
|
||||
resultChan := make(chan SBAuthorizationRule)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAuthorizationRules(resourceGroupName, namespaceName, topicName)
|
||||
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
|
||||
}
|
||||
|
||||
// ListByNamespace gets all the topics in a namespace.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
func (client TopicsClient) ListByNamespace(resourceGroupName string, namespaceName string) (result SBTopicListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: namespaceName,
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListByNamespace")
|
||||
}
|
||||
|
||||
req, err := client.ListByNamespacePreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespacePreparer prepares the ListByNamespace request.
|
||||
func (client TopicsClient) ListByNamespacePreparer(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),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListByNamespaceSender sends the ListByNamespace request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client TopicsClient) ListByNamespaceSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListByNamespaceResponder handles the response to the ListByNamespace request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) ListByNamespaceResponder(resp *http.Response) (result SBTopicListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceNextResults retrieves the next set of results, if any.
|
||||
func (client TopicsClient) ListByNamespaceNextResults(lastResults SBTopicListResult) (result SBTopicListResult, err error) {
|
||||
req, err := lastResults.SBTopicListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByNamespaceSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "servicebus.TopicsClient", "ListByNamespace", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByNamespaceComplete gets all elements from the list without paging.
|
||||
func (client TopicsClient) ListByNamespaceComplete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (<-chan SBTopic, <-chan error) {
|
||||
resultChan := make(chan SBTopic)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByNamespace(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.ListByNamespaceNextResults(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 connection strings for the topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. authorizationRuleName is the authorizationrule name.
|
||||
func (client TopicsClient) ListKeys(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. authorizationRuleName is the authorizationrule name.
|
||||
func (client TopicsClient) ListKeys(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -766,11 +830,9 @@ func (client TopicsClient) ListKeys(resourceGroupName string, namespaceName stri
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListKeys")
|
||||
}
|
||||
|
||||
@@ -805,7 +867,7 @@ func (client TopicsClient) ListKeysPreparer(resourceGroupName string, namespaceN
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -826,7 +888,7 @@ func (client TopicsClient) ListKeysSender(req *http.Request) (*http.Response, er
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client TopicsClient) ListKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -837,14 +899,12 @@ func (client TopicsClient) ListKeysResponder(resp *http.Response) (result Resour
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates primary or secondary connection strings for the
|
||||
// topic.
|
||||
// RegenerateKeys regenerates primary or secondary connection strings for the topic.
|
||||
//
|
||||
// resourceGroupName is name of the Resource group within the Azure
|
||||
// subscription. namespaceName is the namespace name topicName is the topic
|
||||
// name. authorizationRuleName is the authorizationrule name. parameters is
|
||||
// parameters supplied to regenerate the authorization rule.
|
||||
func (client TopicsClient) RegenerateKeys(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name
|
||||
// topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is parameters supplied
|
||||
// to regenerate the authorization rule.
|
||||
func (client TopicsClient) RegenerateKeys(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -853,11 +913,9 @@ func (client TopicsClient) RegenerateKeys(resourceGroupName string, namespaceNam
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: topicName,
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: authorizationRuleName,
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "RegenerateKeys")
|
||||
}
|
||||
|
||||
@@ -883,7 +941,7 @@ func (client TopicsClient) RegenerateKeys(resourceGroupName string, namespaceNam
|
||||
}
|
||||
|
||||
// RegenerateKeysPreparer prepares the RegenerateKeys request.
|
||||
func (client TopicsClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateKeysParameters) (*http.Request, error) {
|
||||
func (client TopicsClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -892,7 +950,7 @@ func (client TopicsClient) RegenerateKeysPreparer(resourceGroupName string, name
|
||||
"topicName": autorest.Encode("path", topicName),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -915,7 +973,7 @@ func (client TopicsClient) RegenerateKeysSender(req *http.Request) (*http.Respon
|
||||
|
||||
// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client TopicsClient) RegenerateKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client TopicsClient) RegenerateKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package servicebus
|
||||
// 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-servicebus/2015-08-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-servicebus/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