vendor: update all dependencies to latest versions
This commit is contained in:
+3
-5
@@ -1,5 +1,4 @@
|
||||
// Package eventhub implements the Azure ARM Eventhub service API version
|
||||
// 2015-08-01.
|
||||
// Package eventhub implements the Azure ARM Eventhub service API version 2017-04-01.
|
||||
//
|
||||
// Azure Event Hubs client
|
||||
package eventhub
|
||||
@@ -18,9 +17,8 @@ package eventhub
|
||||
// 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"
|
||||
|
||||
+99
-72
@@ -14,9 +14,8 @@ package eventhub
|
||||
// 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,26 +29,22 @@ type ConsumerGroupsClient struct {
|
||||
ManagementClient
|
||||
}
|
||||
|
||||
// NewConsumerGroupsClient creates an instance of the ConsumerGroupsClient
|
||||
// client.
|
||||
// NewConsumerGroupsClient creates an instance of the ConsumerGroupsClient client.
|
||||
func NewConsumerGroupsClient(subscriptionID string) ConsumerGroupsClient {
|
||||
return NewConsumerGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewConsumerGroupsClientWithBaseURI creates an instance of the
|
||||
// ConsumerGroupsClient client.
|
||||
// NewConsumerGroupsClientWithBaseURI creates an instance of the ConsumerGroupsClient client.
|
||||
func NewConsumerGroupsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerGroupsClient {
|
||||
return ConsumerGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates an Event Hubs consumer group as a nested
|
||||
// resource within a Namespace.
|
||||
// CreateOrUpdate creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name consumerGroupName is the consumer group name parameters is
|
||||
// parameters supplied to create or update a consumer group resource.
|
||||
func (client ConsumerGroupsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroupCreateOrUpdateParameters) (result ConsumerGroupResource, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name consumerGroupName is the consumer group name parameters is parameters supplied to
|
||||
// create or update a consumer group resource.
|
||||
func (client ConsumerGroupsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroup) (result ConsumerGroup, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -58,13 +53,9 @@ func (client ConsumerGroupsClient) CreateOrUpdate(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: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: consumerGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "consumerGroupName", 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: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
@@ -90,7 +81,7 @@ func (client ConsumerGroupsClient) CreateOrUpdate(resourceGroupName string, name
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client ConsumerGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroupCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client ConsumerGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroup) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"consumerGroupName": autorest.Encode("path", consumerGroupName),
|
||||
"eventHubName": autorest.Encode("path", eventHubName),
|
||||
@@ -99,7 +90,7 @@ func (client ConsumerGroupsClient) CreateOrUpdatePreparer(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,
|
||||
}
|
||||
@@ -122,7 +113,7 @@ func (client ConsumerGroupsClient) CreateOrUpdateSender(req *http.Request) (*htt
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ConsumerGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ConsumerGroupResource, err error) {
|
||||
func (client ConsumerGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ConsumerGroup, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -133,12 +124,10 @@ func (client ConsumerGroupsClient) CreateOrUpdateResponder(resp *http.Response)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a consumer group from the specified Event Hub and resource
|
||||
// group.
|
||||
// Delete deletes a consumer group from the specified Event Hub and resource group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name consumerGroupName is the consumer group name
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name consumerGroupName is the consumer group name
|
||||
func (client ConsumerGroupsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -148,11 +137,9 @@ func (client ConsumerGroupsClient) Delete(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: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: consumerGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "Delete")
|
||||
}
|
||||
|
||||
@@ -187,7 +174,7 @@ func (client ConsumerGroupsClient) DeletePreparer(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,
|
||||
}
|
||||
@@ -220,10 +207,9 @@ func (client ConsumerGroupsClient) DeleteResponder(resp *http.Response) (result
|
||||
|
||||
// Get gets a description for the specified consumer group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name consumerGroupName is the consumer group name
|
||||
func (client ConsumerGroupsClient) Get(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result ConsumerGroupResource, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name consumerGroupName is the consumer group name
|
||||
func (client ConsumerGroupsClient) Get(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result ConsumerGroup, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -232,11 +218,9 @@ func (client ConsumerGroupsClient) Get(resourceGroupName string, namespaceName s
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: consumerGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "Get")
|
||||
}
|
||||
|
||||
@@ -271,7 +255,7 @@ func (client ConsumerGroupsClient) GetPreparer(resourceGroupName string, namespa
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -292,7 +276,7 @@ func (client ConsumerGroupsClient) GetSender(req *http.Request) (*http.Response,
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ConsumerGroupsClient) GetResponder(resp *http.Response) (result ConsumerGroupResource, err error) {
|
||||
func (client ConsumerGroupsClient) GetResponder(resp *http.Response) (result ConsumerGroup, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -303,13 +287,12 @@ func (client ConsumerGroupsClient) GetResponder(resp *http.Response) (result Con
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll gets all the consumer groups in a Namespace. An empty feed is
|
||||
// returned if no consumer group exists in the Namespace.
|
||||
// ListByEventHub gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in
|
||||
// the Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name
|
||||
func (client ConsumerGroupsClient) ListAll(resourceGroupName string, namespaceName string, eventHubName string) (result ConsumerGroupListResult, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name
|
||||
func (client ConsumerGroupsClient) ListByEventHub(resourceGroupName string, namespaceName string, eventHubName string) (result ConsumerGroupListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -318,34 +301,33 @@ func (client ConsumerGroupsClient) ListAll(resourceGroupName string, namespaceNa
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "ListAll")
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub")
|
||||
}
|
||||
|
||||
req, err := client.ListAllPreparer(resourceGroupName, namespaceName, eventHubName)
|
||||
req, err := client.ListByEventHubPreparer(resourceGroupName, namespaceName, eventHubName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", nil, "Failure preparing request")
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
resp, err := client.ListByEventHubSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", resp, "Failure sending request")
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
result, err = client.ListByEventHubResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", resp, "Failure responding to request")
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllPreparer prepares the ListAll request.
|
||||
func (client ConsumerGroupsClient) ListAllPreparer(resourceGroupName string, namespaceName string, eventHubName string) (*http.Request, error) {
|
||||
// ListByEventHubPreparer prepares the ListByEventHub request.
|
||||
func (client ConsumerGroupsClient) ListByEventHubPreparer(resourceGroupName string, namespaceName string, eventHubName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"eventHubName": autorest.Encode("path", eventHubName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -353,7 +335,7 @@ func (client ConsumerGroupsClient) ListAllPreparer(resourceGroupName string, nam
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -366,15 +348,15 @@ func (client ConsumerGroupsClient) ListAllPreparer(resourceGroupName string, nam
|
||||
return preparer.Prepare(&http.Request{})
|
||||
}
|
||||
|
||||
// ListAllSender sends the ListAll request. The method will close the
|
||||
// ListByEventHubSender sends the ListByEventHub request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConsumerGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) {
|
||||
func (client ConsumerGroupsClient) ListByEventHubSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req)
|
||||
}
|
||||
|
||||
// ListAllResponder handles the response to the ListAll request. The method always
|
||||
// ListByEventHubResponder handles the response to the ListByEventHub request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ConsumerGroupsClient) ListAllResponder(resp *http.Response) (result ConsumerGroupListResult, err error) {
|
||||
func (client ConsumerGroupsClient) ListByEventHubResponder(resp *http.Response) (result ConsumerGroupListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -385,26 +367,71 @@ func (client ConsumerGroupsClient) ListAllResponder(resp *http.Response) (result
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllNextResults retrieves the next set of results, if any.
|
||||
func (client ConsumerGroupsClient) ListAllNextResults(lastResults ConsumerGroupListResult) (result ConsumerGroupListResult, err error) {
|
||||
// ListByEventHubNextResults retrieves the next set of results, if any.
|
||||
func (client ConsumerGroupsClient) ListByEventHubNextResults(lastResults ConsumerGroupListResult) (result ConsumerGroupListResult, err error) {
|
||||
req, err := lastResults.ConsumerGroupListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", nil, "Failure preparing next results request")
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
resp, err := client.ListByEventHubSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", resp, "Failure sending next results request")
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
result, err = client.ListByEventHubResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListAll", resp, "Failure responding to next results request")
|
||||
err = autorest.NewErrorWithError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByEventHubComplete gets all elements from the list without paging.
|
||||
func (client ConsumerGroupsClient) ListByEventHubComplete(resourceGroupName string, namespaceName string, eventHubName string, cancel <-chan struct{}) (<-chan ConsumerGroup, <-chan error) {
|
||||
resultChan := make(chan ConsumerGroup)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListByEventHub(resourceGroupName, namespaceName, eventHubName)
|
||||
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.ListByEventHubNextResults(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
|
||||
}
|
||||
|
||||
+278
-203
@@ -14,9 +14,8 @@ package eventhub
|
||||
// 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,19 +34,16 @@ func NewEventHubsClient(subscriptionID string) EventHubsClient {
|
||||
return NewEventHubsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewEventHubsClientWithBaseURI creates an instance of the EventHubsClient
|
||||
// client.
|
||||
// NewEventHubsClientWithBaseURI creates an instance of the EventHubsClient client.
|
||||
func NewEventHubsClientWithBaseURI(baseURI string, subscriptionID string) EventHubsClient {
|
||||
return EventHubsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a new Event Hub as a nested resource
|
||||
// within a Namespace.
|
||||
// CreateOrUpdate creates or updates a new Event Hub as a nested resource within a Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name parameters is parameters supplied to create an Event Hub resource.
|
||||
func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, parameters CreateOrUpdateParameters) (result ResourceType, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name parameters is parameters supplied to create an Event Hub resource.
|
||||
func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, parameters Model) (result Model, 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,28 @@ func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespace
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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: "parameters.Properties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.MessageRetentionInDays", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.MessageRetentionInDays", Name: validation.InclusiveMaximum, Rule: 7, Chain: nil},
|
||||
{Target: "parameters.Properties.MessageRetentionInDays", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.Properties.PartitionCount", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.PartitionCount", Name: validation.InclusiveMaximum, Rule: 32, Chain: nil},
|
||||
{Target: "parameters.Properties.PartitionCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.Properties.CaptureDescription", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.InclusiveMaximum, Rule: 900, Chain: nil},
|
||||
{Target: "parameters.Properties.CaptureDescription.IntervalInSeconds", Name: validation.InclusiveMinimum, Rule: 60, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.InclusiveMaximum, Rule: 524288000, Chain: nil},
|
||||
{Target: "parameters.Properties.CaptureDescription.SizeLimitInBytes", Name: validation.InclusiveMinimum, Rule: 10485760, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "CreateOrUpdate")
|
||||
}
|
||||
|
||||
@@ -85,7 +99,7 @@ func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespace
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client EventHubsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, eventHubName string, parameters CreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client EventHubsClient) CreateOrUpdatePreparer(resourceGroupName string, namespaceName string, eventHubName string, parameters Model) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"eventHubName": autorest.Encode("path", eventHubName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -93,7 +107,7 @@ func (client EventHubsClient) CreateOrUpdatePreparer(resourceGroupName string, n
|
||||
"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 +130,7 @@ func (client EventHubsClient) CreateOrUpdateSender(req *http.Request) (*http.Res
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) CreateOrUpdateResponder(resp *http.Response) (result ResourceType, err error) {
|
||||
func (client EventHubsClient) CreateOrUpdateResponder(resp *http.Response) (result Model, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -127,14 +141,12 @@ func (client EventHubsClient) CreateOrUpdateResponder(resp *http.Response) (resu
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for
|
||||
// the specified Event Hub.
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for the specified Event Hub.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name authorizationRuleName is the authorization rule name. parameters is
|
||||
// the shared access AuthorizationRule.
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName 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
|
||||
// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is the shared
|
||||
// access AuthorizationRule.
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters AuthorizationRule) (result AuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -143,14 +155,9 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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, "eventhub.EventHubsClient", "CreateOrUpdateAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -176,7 +183,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRulePreparer prepares the CreateOrUpdateAuthorizationRule request.
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (*http.Request, error) {
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters AuthorizationRule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"eventHubName": autorest.Encode("path", eventHubName),
|
||||
@@ -185,7 +192,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRulePreparer(resourceGr
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -208,7 +215,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRuleSender(req *http.Re
|
||||
|
||||
// CreateOrUpdateAuthorizationRuleResponder handles the response to the CreateOrUpdateAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client EventHubsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.Response) (result AuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -221,9 +228,8 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRuleResponder(resp *htt
|
||||
|
||||
// Delete deletes an Event Hub from the specified Namespace and resource group.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name
|
||||
func (client EventHubsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -233,8 +239,7 @@ func (client EventHubsClient) Delete(resourceGroupName string, namespaceName str
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "Delete")
|
||||
}
|
||||
|
||||
@@ -268,7 +273,7 @@ func (client EventHubsClient) DeletePreparer(resourceGroupName string, namespace
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -301,9 +306,8 @@ func (client EventHubsClient) DeleteResponder(resp *http.Response) (result autor
|
||||
|
||||
// DeleteAuthorizationRule deletes an Event Hub AuthorizationRule.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name authorizationRuleName is the authorization rule name.
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name.
|
||||
func (client EventHubsClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -313,11 +317,9 @@ func (client EventHubsClient) 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: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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, "eventhub.EventHubsClient", "DeleteAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -352,7 +354,7 @@ func (client EventHubsClient) 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,
|
||||
}
|
||||
@@ -385,10 +387,9 @@ func (client EventHubsClient) DeleteAuthorizationRuleResponder(resp *http.Respon
|
||||
|
||||
// Get gets an Event Hubs description for the specified Event Hub.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name
|
||||
func (client EventHubsClient) Get(resourceGroupName string, namespaceName string, eventHubName string) (result ResourceType, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name
|
||||
func (client EventHubsClient) Get(resourceGroupName string, namespaceName string, eventHubName string) (result Model, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -397,8 +398,7 @@ func (client EventHubsClient) Get(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: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "Get")
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ func (client EventHubsClient) GetPreparer(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,
|
||||
}
|
||||
@@ -453,7 +453,7 @@ func (client EventHubsClient) GetSender(req *http.Request) (*http.Response, erro
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) GetResponder(resp *http.Response) (result ResourceType, err error) {
|
||||
func (client EventHubsClient) GetResponder(resp *http.Response) (result Model, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -464,13 +464,11 @@ func (client EventHubsClient) GetResponder(resp *http.Response) (result Resource
|
||||
return
|
||||
}
|
||||
|
||||
// GetAuthorizationRule gets an AuthorizationRule for an Event Hub by rule
|
||||
// name.
|
||||
// GetAuthorizationRule gets an AuthorizationRule for an Event Hub by rule name.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name authorizationRuleName is the authorization rule name.
|
||||
func (client EventHubsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name.
|
||||
func (client EventHubsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result AuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -479,11 +477,9 @@ func (client EventHubsClient) GetAuthorizationRule(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: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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, "eventhub.EventHubsClient", "GetAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -518,7 +514,7 @@ func (client EventHubsClient) GetAuthorizationRulePreparer(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,
|
||||
}
|
||||
@@ -539,7 +535,7 @@ func (client EventHubsClient) GetAuthorizationRuleSender(req *http.Request) (*ht
|
||||
|
||||
// GetAuthorizationRuleResponder handles the response to the GetAuthorizationRule request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) GetAuthorizationRuleResponder(resp *http.Response) (result SharedAccessAuthorizationRuleResource, err error) {
|
||||
func (client EventHubsClient) GetAuthorizationRuleResponder(resp *http.Response) (result AuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -550,112 +546,11 @@ func (client EventHubsClient) GetAuthorizationRuleResponder(resp *http.Response)
|
||||
return
|
||||
}
|
||||
|
||||
// ListAll gets all the Event Hubs in a Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name
|
||||
func (client EventHubsClient) ListAll(resourceGroupName string, namespaceName string) (result ListResult, 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, "eventhub.EventHubsClient", "ListAll")
|
||||
}
|
||||
|
||||
req, err := client.ListAllPreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "ListAll", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAllSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "ListAll", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "ListAll", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAllPreparer prepares the ListAll request.
|
||||
func (client EventHubsClient) 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.EventHub/namespaces/{namespaceName}/eventhubs", 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 EventHubsClient) 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 EventHubsClient) ListAllResponder(resp *http.Response) (result ListResult, 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 EventHubsClient) ListAllNextResults(lastResults ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.ListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "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, "eventhub.EventHubsClient", "ListAll", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListAllResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "ListAll", resp, "Failure responding to next results request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRules gets the authorization rules for an Event Hub.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name
|
||||
func (client EventHubsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, eventHubName string) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name
|
||||
func (client EventHubsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, eventHubName string) (result AuthorizationRuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -664,8 +559,7 @@ func (client EventHubsClient) ListAuthorizationRules(resourceGroupName string, n
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "ListAuthorizationRules")
|
||||
}
|
||||
|
||||
@@ -699,7 +593,7 @@ func (client EventHubsClient) ListAuthorizationRulesPreparer(resourceGroupName s
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -720,7 +614,7 @@ func (client EventHubsClient) ListAuthorizationRulesSender(req *http.Request) (*
|
||||
|
||||
// ListAuthorizationRulesResponder handles the response to the ListAuthorizationRules request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) ListAuthorizationRulesResponder(resp *http.Response) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
func (client EventHubsClient) ListAuthorizationRulesResponder(resp *http.Response) (result AuthorizationRuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -732,8 +626,8 @@ func (client EventHubsClient) ListAuthorizationRulesResponder(resp *http.Respons
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesNextResults retrieves the next set of results, if any.
|
||||
func (client EventHubsClient) ListAuthorizationRulesNextResults(lastResults SharedAccessAuthorizationRuleListResult) (result SharedAccessAuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.SharedAccessAuthorizationRuleListResultPreparer()
|
||||
func (client EventHubsClient) ListAuthorizationRulesNextResults(lastResults AuthorizationRuleListResult) (result AuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.AuthorizationRuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.EventHubsClient", "ListAuthorizationRules", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -755,12 +649,200 @@ func (client EventHubsClient) ListAuthorizationRulesNextResults(lastResults Shar
|
||||
return
|
||||
}
|
||||
|
||||
// ListAuthorizationRulesComplete gets all elements from the list without paging.
|
||||
func (client EventHubsClient) ListAuthorizationRulesComplete(resourceGroupName string, namespaceName string, eventHubName string, cancel <-chan struct{}) (<-chan AuthorizationRule, <-chan error) {
|
||||
resultChan := make(chan AuthorizationRule)
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
list, err := client.ListAuthorizationRules(resourceGroupName, namespaceName, eventHubName)
|
||||
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 Event Hubs in a 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 ListResult, 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, "eventhub.EventHubsClient", "ListByNamespace")
|
||||
}
|
||||
|
||||
req, err := client.ListByNamespacePreparer(resourceGroupName, namespaceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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, "eventhub.EventHubsClient", "ListByNamespace", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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.EventHub/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 ListResult, 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 ListResult) (result ListResult, err error) {
|
||||
req, err := lastResults.ListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.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, "eventhub.EventHubsClient", "ListByNamespace", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListByNamespaceResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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 Model, <-chan error) {
|
||||
resultChan := make(chan Model)
|
||||
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 ACS and SAS connection strings for the Event Hub.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name authorizationRuleName is the authorization rule name.
|
||||
func (client EventHubsClient) ListKeys(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result ResourceListKeys, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name.
|
||||
func (client EventHubsClient) ListKeys(resourceGroupName string, namespaceName string, eventHubName 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},
|
||||
@@ -769,11 +851,9 @@ func (client EventHubsClient) ListKeys(resourceGroupName string, namespaceName s
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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, "eventhub.EventHubsClient", "ListKeys")
|
||||
}
|
||||
|
||||
@@ -808,7 +888,7 @@ func (client EventHubsClient) ListKeysPreparer(resourceGroupName string, namespa
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -829,7 +909,7 @@ func (client EventHubsClient) ListKeysSender(req *http.Request) (*http.Response,
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) ListKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client EventHubsClient) ListKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -840,15 +920,12 @@ func (client EventHubsClient) ListKeysResponder(resp *http.Response) (result Res
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the ACS and SAS connection strings for the Event
|
||||
// Hub.
|
||||
// RegenerateKeys regenerates the ACS and SAS connection strings for the Event Hub.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name eventHubName is the Event
|
||||
// Hub name authorizationRuleName is the authorization rule name. parameters is
|
||||
// parameters supplied to regenerate the AuthorizationRule Keys
|
||||
// (PrimaryKey/SecondaryKey).
|
||||
func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespaceName string, eventHubName 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
|
||||
// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is parameters
|
||||
// supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey).
|
||||
func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespaceName string, eventHubName 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},
|
||||
@@ -857,11 +934,9 @@ func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespace
|
||||
Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}},
|
||||
{TargetValue: eventHubName,
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil},
|
||||
{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
Constraints: []validation.Constraint{{Target: "eventHubName", 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, "eventhub.EventHubsClient", "RegenerateKeys")
|
||||
}
|
||||
|
||||
@@ -887,7 +962,7 @@ func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespace
|
||||
}
|
||||
|
||||
// RegenerateKeysPreparer prepares the RegenerateKeys request.
|
||||
func (client EventHubsClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters RegenerateKeysParameters) (*http.Request, error) {
|
||||
func (client EventHubsClient) RegenerateKeysPreparer(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"eventHubName": autorest.Encode("path", eventHubName),
|
||||
@@ -896,7 +971,7 @@ func (client EventHubsClient) RegenerateKeysPreparer(resourceGroupName string, n
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -919,7 +994,7 @@ func (client EventHubsClient) RegenerateKeysSender(req *http.Request) (*http.Res
|
||||
|
||||
// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client EventHubsClient) RegenerateKeysResponder(resp *http.Response) (result ResourceListKeys, err error) {
|
||||
func (client EventHubsClient) RegenerateKeysResponder(resp *http.Response) (result AccessKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+176
-240
@@ -14,9 +14,8 @@ package eventhub
|
||||
// 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,6 +36,16 @@ const (
|
||||
Send AccessRights = "Send"
|
||||
)
|
||||
|
||||
// EncodingCaptureDescription enumerates the values for encoding capture description.
|
||||
type EncodingCaptureDescription string
|
||||
|
||||
const (
|
||||
// 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
|
||||
|
||||
@@ -61,59 +70,14 @@ const (
|
||||
Unknown EntityStatus = "Unknown"
|
||||
)
|
||||
|
||||
// NamespaceState enumerates the values for namespace state.
|
||||
type NamespaceState string
|
||||
// KeyType enumerates the values for key type.
|
||||
type KeyType 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"
|
||||
)
|
||||
|
||||
// Policykey enumerates the values for policykey.
|
||||
type Policykey 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.
|
||||
@@ -132,8 +96,6 @@ type SkuTier string
|
||||
const (
|
||||
// SkuTierBasic specifies the sku tier basic state for sku tier.
|
||||
SkuTierBasic SkuTier = "Basic"
|
||||
// SkuTierPremium specifies the sku tier premium state for sku tier.
|
||||
SkuTierPremium SkuTier = "Premium"
|
||||
// SkuTierStandard specifies the sku tier standard state for sku tier.
|
||||
SkuTierStandard SkuTier = "Standard"
|
||||
)
|
||||
@@ -144,50 +106,105 @@ 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"
|
||||
)
|
||||
|
||||
// CheckNameAvailabilityParameter is parameter supplied to check Namespace name
|
||||
// availability operation
|
||||
// AccessKeys is namespace/EventHub 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"`
|
||||
}
|
||||
|
||||
// AuthorizationRule is single item in a List or Get AuthorizationRule operation
|
||||
type AuthorizationRule struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*AuthorizationRuleProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// AuthorizationRuleProperties is properties supplied to create or update AuthorizationRule
|
||||
type AuthorizationRuleProperties struct {
|
||||
Rights *[]AccessRights `json:"rights,omitempty"`
|
||||
}
|
||||
|
||||
// AuthorizationRuleListResult is the response from the List namespace operation.
|
||||
type AuthorizationRuleListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]AuthorizationRule `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// AuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client AuthorizationRuleListResult) AuthorizationRuleListResultPreparer() (*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)))
|
||||
}
|
||||
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// CheckNameAvailabilityParameter is parameter supplied to check Namespace name availability operation
|
||||
type CheckNameAvailabilityParameter struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// CheckNameAvailabilityResult is the Result of the CheckNameAvailability
|
||||
// operation
|
||||
// CheckNameAvailabilityResult is the Result of the CheckNameAvailability operation
|
||||
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"`
|
||||
}
|
||||
|
||||
// ConsumerGroupCreateOrUpdateParameters is parameters supplied to the Create
|
||||
// Or Update Consumer Group operation.
|
||||
type ConsumerGroupCreateOrUpdateParameters struct {
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
// ConsumerGroup is single item in List or Get Consumer group operation
|
||||
type ConsumerGroup struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*ConsumerGroupProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ConsumerGroupProperties is single item in List or Get Consumer group operation
|
||||
type ConsumerGroupProperties struct {
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
UserMetadata *string `json:"userMetadata,omitempty"`
|
||||
}
|
||||
|
||||
// ConsumerGroupListResult is the result to the List Consumer Group operation.
|
||||
type ConsumerGroupListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]ConsumerGroupResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]ConsumerGroup `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// ConsumerGroupListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
@@ -202,39 +219,74 @@ func (client ConsumerGroupListResult) ConsumerGroupListResultPreparer() (*http.R
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// ConsumerGroupProperties is properties supplied to the Create Or Update
|
||||
// Consumer Group operation.
|
||||
type ConsumerGroupProperties struct {
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
EventHubPath *string `json:"eventHubPath,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
UserMetadata *string `json:"userMetadata,omitempty"`
|
||||
// Destination is capture storage details for capture description
|
||||
type Destination struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
*DestinationProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// ConsumerGroupResource is single item in List or Get Consumer group operation
|
||||
type ConsumerGroupResource struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*ConsumerGroupProperties `json:"properties,omitempty"`
|
||||
// DestinationProperties is properties describing the storage account, blob container and acrchive anme format for
|
||||
// capture destination
|
||||
type DestinationProperties struct {
|
||||
StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
|
||||
BlobContainer *string `json:"blobContainer,omitempty"`
|
||||
ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"`
|
||||
}
|
||||
|
||||
// CreateOrUpdateParameters is parameters supplied to the Create Or Update
|
||||
// Event Hub operation.
|
||||
type CreateOrUpdateParameters struct {
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
*Properties `json:"properties,omitempty"`
|
||||
// EHNamespace is single Namespace item in List or Get Operation
|
||||
type EHNamespace struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
*EHNamespaceProperties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// EHNamespaceProperties is namespace properties supplied for create namespace operation.
|
||||
type EHNamespaceProperties 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"`
|
||||
IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"`
|
||||
MaximumThroughputUnits *int32 `json:"maximumThroughputUnits,omitempty"`
|
||||
}
|
||||
|
||||
// EHNamespaceListResult is the response of the List Namespace operation
|
||||
type EHNamespaceListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]EHNamespace `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// EHNamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client EHNamespaceListResult) EHNamespaceListResultPreparer() (*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)))
|
||||
}
|
||||
|
||||
// ErrorResponse is error reponse indicates EventHub 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"`
|
||||
}
|
||||
|
||||
// ListResult is the result of the List EventHubs operation.
|
||||
type ListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]ResourceType `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
Value *[]Model `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// ListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
@@ -249,63 +301,13 @@ func (client ListResult) ListResultPreparer() (*http.Request, error) {
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// NamespaceListResult is the response of the List Namespace operation.
|
||||
type NamespaceListResult struct {
|
||||
// Model is single item in List or Get Event Hub operation
|
||||
type Model struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]NamespaceResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// NamespaceProperties is properties of the Namespace supplied for create or
|
||||
// update Namespace operation
|
||||
type NamespaceProperties struct {
|
||||
Status NamespaceState `json:"status,omitempty"`
|
||||
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"`
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
}
|
||||
|
||||
// NamespaceResource is single Namespace item in List or Get Operation
|
||||
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"`
|
||||
}
|
||||
|
||||
// NamespaceUpdateParameter is parameters supplied to the Patch/update
|
||||
// Namespace operation.
|
||||
type NamespaceUpdateParameter struct {
|
||||
Tags *map[string]*string `json:"tags,omitempty"`
|
||||
Sku *Sku `json:"sku,omitempty"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*Properties `json:"properties,omitempty"`
|
||||
}
|
||||
|
||||
// Operation is a Event Hub REST API operation
|
||||
@@ -321,9 +323,8 @@ type OperationDisplay struct {
|
||||
Operation *string `json:"operation,omitempty"`
|
||||
}
|
||||
|
||||
// OperationListResult is result of the request to list Event Hub 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 Event Hub 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"`
|
||||
@@ -342,97 +343,32 @@ func (client OperationListResult) OperationListResultPreparer() (*http.Request,
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// Properties is properties supplied to the Create Or Update Event Hub
|
||||
// operation.
|
||||
// Properties is properties supplied to the Create Or Update Event Hub operation.
|
||||
type Properties struct {
|
||||
CreatedAt *date.Time `json:"createdAt,omitempty"`
|
||||
MessageRetentionInDays *int64 `json:"messageRetentionInDays,omitempty"`
|
||||
PartitionCount *int64 `json:"partitionCount,omitempty"`
|
||||
PartitionIds *[]string `json:"partitionIds,omitempty"`
|
||||
Status EntityStatus `json:"status,omitempty"`
|
||||
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
||||
// RegenerateKeysParameters is parameters supplied to the Regenerate
|
||||
// Authorization Rule keys 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
|
||||
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/EventHub 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"`
|
||||
}
|
||||
|
||||
// ResourceType is single item in List or Get Event Hub operation
|
||||
type ResourceType struct {
|
||||
autorest.Response `json:"-"`
|
||||
ID *string `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
*Properties `json:"properties,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 from the List
|
||||
// Namespace operation.
|
||||
type SharedAccessAuthorizationRuleListResult struct {
|
||||
autorest.Response `json:"-"`
|
||||
Value *[]SharedAccessAuthorizationRuleResource `json:"value,omitempty"`
|
||||
NextLink *string `json:"nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. It returns
|
||||
// nil if no more results exist.
|
||||
func (client SharedAccessAuthorizationRuleListResult) SharedAccessAuthorizationRuleListResultPreparer() (*http.Request, error) {
|
||||
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return autorest.Prepare(&http.Request{},
|
||||
autorest.AsJSON(),
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(to.String(client.NextLink)))
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleProperties is properties supplied to create or
|
||||
// update SharedAccessAuthorizationRule
|
||||
type SharedAccessAuthorizationRuleProperties struct {
|
||||
Rights *[]AccessRights `json:"rights,omitempty"`
|
||||
}
|
||||
|
||||
// SharedAccessAuthorizationRuleResource is single item in a List or Get
|
||||
// AuthorizationRule operation
|
||||
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"`
|
||||
}
|
||||
|
||||
// Sku is sKU parameters supplied to the create Namespace operation
|
||||
// Sku is SKU parameters supplied to the create namespace operation
|
||||
type Sku struct {
|
||||
Name SkuName `json:"name,omitempty"`
|
||||
Tier SkuTier `json:"tier,omitempty"`
|
||||
@@ -443,7 +379,7 @@ type Sku struct {
|
||||
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"`
|
||||
}
|
||||
|
||||
+314
-194
@@ -14,9 +14,8 @@ package eventhub
|
||||
// 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) CheckNameAvailabilityPreparer(parameters CheckNam
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2015-08-01"
|
||||
const APIVersion = "2017-04-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
@@ -112,17 +110,14 @@ func (client NamespacesClient) CheckNameAvailabilityResponder(resp *http.Respons
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a 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 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
|
||||
// for creating 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 for creating a namespace resource.
|
||||
func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters EHNamespace, cancel <-chan struct{}) (<-chan EHNamespace, <-chan error) {
|
||||
resultChan := make(chan EHNamespace, 1)
|
||||
errChan := make(chan error, 1)
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -132,7 +127,18 @@ func (client NamespacesClient) CreateOrUpdate(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: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: 20, Chain: nil},
|
||||
{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.EHNamespaceProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMaximum, Rule: 20, Chain: nil},
|
||||
{Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
errChan <- validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CreateOrUpdate")
|
||||
close(errChan)
|
||||
close(resultChan)
|
||||
@@ -141,10 +147,12 @@ func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespac
|
||||
|
||||
go func() {
|
||||
var err error
|
||||
var result NamespaceResource
|
||||
var result EHNamespace
|
||||
defer func() {
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
}
|
||||
resultChan <- result
|
||||
errChan <- err
|
||||
close(resultChan)
|
||||
close(errChan)
|
||||
}()
|
||||
@@ -170,14 +178,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 EHNamespace, 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,
|
||||
}
|
||||
@@ -202,7 +210,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 EHNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -213,14 +221,11 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for
|
||||
// a Namespace.
|
||||
// CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for a Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name authorizationRuleName is
|
||||
// the authorization rule name. parameters is the shared access
|
||||
// AuthorizationRule.
|
||||
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 authorization rule name. parameters is the shared access AuthorizationRule.
|
||||
func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters AuthorizationRule) (result AuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -229,11 +234,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, "eventhub.NamespacesClient", "CreateOrUpdateAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -259,7 +260,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 AuthorizationRule) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"authorizationRuleName": autorest.Encode("path", authorizationRuleName),
|
||||
"namespaceName": autorest.Encode("path", namespaceName),
|
||||
@@ -267,7 +268,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,
|
||||
}
|
||||
@@ -290,7 +291,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 AuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -301,14 +302,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)
|
||||
@@ -329,8 +327,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)
|
||||
}()
|
||||
@@ -363,7 +363,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,
|
||||
}
|
||||
@@ -398,9 +398,8 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto
|
||||
|
||||
// DeleteAuthorizationRule deletes an AuthorizationRule for a Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name authorizationRuleName is
|
||||
// the authorization rule name.
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// authorizationRuleName is the authorization rule name.
|
||||
func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
@@ -410,8 +409,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, "eventhub.NamespacesClient", "DeleteAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -445,7 +443,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,
|
||||
}
|
||||
@@ -478,9 +476,8 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo
|
||||
|
||||
// Get gets the description of 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 EHNamespace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -520,7 +517,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,
|
||||
}
|
||||
@@ -541,7 +538,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 EHNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -554,10 +551,9 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result Namespa
|
||||
|
||||
// GetAuthorizationRule gets an AuthorizationRule 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 authorization rule 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 authorization rule name.
|
||||
func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result AuthorizationRule, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -566,8 +562,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, "eventhub.NamespacesClient", "GetAuthorizationRule")
|
||||
}
|
||||
|
||||
@@ -601,7 +596,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,
|
||||
}
|
||||
@@ -622,7 +617,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 AuthorizationRule, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -633,11 +628,140 @@ func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all the available Namespaces within a subscription, irrespective of the resource groups.
|
||||
func (client NamespacesClient) List() (result EHNamespaceListResult, err error) {
|
||||
req, err := client.ListPreparer()
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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, "eventhub.NamespacesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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.EventHub/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 EHNamespaceListResult, 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 EHNamespaceListResult) (result EHNamespaceListResult, err error) {
|
||||
req, err := lastResults.EHNamespaceListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.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, "eventhub.NamespacesClient", "List", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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 EHNamespace, <-chan error) {
|
||||
resultChan := make(chan EHNamespace)
|
||||
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 a list of 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 AuthorizationRuleListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -677,7 +801,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,
|
||||
}
|
||||
@@ -698,7 +822,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 AuthorizationRuleListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -710,8 +834,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 AuthorizationRuleListResult) (result AuthorizationRuleListResult, err error) {
|
||||
req, err := lastResults.AuthorizationRuleListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListAuthorizationRules", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -733,11 +857,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 AuthorizationRule, <-chan error) {
|
||||
resultChan := make(chan AuthorizationRule)
|
||||
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 lists 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 EHNamespaceListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -773,7 +941,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,
|
||||
}
|
||||
@@ -794,7 +962,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 EHNamespaceListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
@@ -806,8 +974,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 EHNamespaceListResult) (result EHNamespaceListResult, err error) {
|
||||
req, err := lastResults.EHNamespaceListResultPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "eventhub.NamespacesClient", "ListByResourceGroup", nil, "Failure preparing next results request")
|
||||
}
|
||||
@@ -829,99 +997,56 @@ func (client NamespacesClient) ListByResourceGroupNextResults(lastResults Namesp
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscription lists all the available Namespaces within a 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, "eventhub.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, "eventhub.NamespacesClient", "ListBySubscription", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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 EHNamespace, <-chan error) {
|
||||
resultChan := make(chan EHNamespace)
|
||||
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.EventHub/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, "eventhub.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, "eventhub.NamespacesClient", "ListBySubscription", resp, "Failure sending next results request")
|
||||
}
|
||||
|
||||
result, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "eventhub.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 authorization rule 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 authorization rule 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},
|
||||
@@ -930,8 +1055,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, "eventhub.NamespacesClient", "ListKeys")
|
||||
}
|
||||
|
||||
@@ -965,7 +1089,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,
|
||||
}
|
||||
@@ -986,7 +1110,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(),
|
||||
@@ -997,14 +1121,12 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Re
|
||||
return
|
||||
}
|
||||
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings for
|
||||
// the specified Namespace.
|
||||
// RegenerateKeys regenerates the primary or secondary connection strings for the specified Namespace.
|
||||
//
|
||||
// resourceGroupName is name of the resource group within the azure
|
||||
// subscription. namespaceName is the Namespace name authorizationRuleName is
|
||||
// the authorization rule name. parameters is parameters required to regenerate
|
||||
// the connection string.
|
||||
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 authorization rule name. parameters is parameters required to regenerate the connection
|
||||
// string.
|
||||
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},
|
||||
@@ -1013,8 +1135,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, "eventhub.NamespacesClient", "RegenerateKeys")
|
||||
}
|
||||
|
||||
@@ -1040,7 +1161,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),
|
||||
@@ -1048,7 +1169,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,
|
||||
}
|
||||
@@ -1071,7 +1192,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(),
|
||||
@@ -1082,13 +1203,12 @@ func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (res
|
||||
return
|
||||
}
|
||||
|
||||
// Update creates or updates a namespace. Once created, this namespace's
|
||||
// resource manifest is immutable. This operation is idempotent.
|
||||
// Update creates or updates a 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
|
||||
// for updating a namespace resource.
|
||||
func (client NamespacesClient) Update(resourceGroupName string, namespaceName string, parameters NamespaceUpdateParameter) (result NamespaceResource, err error) {
|
||||
// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name
|
||||
// parameters is parameters for updating a namespace resource.
|
||||
func (client NamespacesClient) Update(resourceGroupName string, namespaceName string, parameters EHNamespace) (result EHNamespace, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
|
||||
@@ -1121,14 +1241,14 @@ func (client NamespacesClient) Update(resourceGroupName string, namespaceName st
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client NamespacesClient) UpdatePreparer(resourceGroupName string, namespaceName string, parameters NamespaceUpdateParameter) (*http.Request, error) {
|
||||
func (client NamespacesClient) UpdatePreparer(resourceGroupName string, namespaceName string, parameters EHNamespace) (*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,
|
||||
}
|
||||
@@ -1151,7 +1271,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 EHNamespace, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
|
||||
+49
-6
@@ -14,9 +14,8 @@ package eventhub
|
||||
// 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
|
||||
}
|
||||
|
||||
+4
-5
@@ -14,16 +14,15 @@ package eventhub
|
||||
// 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-eventhub/2015-08-01"
|
||||
return "Azure-SDK-For-Go/v11.0.0-beta arm-eventhub/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