From 283d288f6bf22cbed72d96f2157e88dd23888a47 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Sat, 19 Aug 2017 12:36:04 +0200 Subject: [PATCH 1/6] Vendoring the EventGrid SDK @ v10.3-beta --- .../azure-sdk-for-go/arm/eventgrid/client.go | 51 + .../arm/eventgrid/eventsubscriptions.go | 1040 +++++++++++++++++ .../azure-sdk-for-go/arm/eventgrid/models.go | 292 +++++ .../arm/eventgrid/operations.go | 96 ++ .../azure-sdk-for-go/arm/eventgrid/topics.go | 602 ++++++++++ .../arm/eventgrid/topictypes.go | 222 ++++ .../azure-sdk-for-go/arm/eventgrid/version.go | 28 + vendor/vendor.json | 8 + 8 files changed, 2339 insertions(+) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/eventsubscriptions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topics.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topictypes.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/version.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/client.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/client.go new file mode 100644 index 000000000000..52f4456eae5e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/client.go @@ -0,0 +1,51 @@ +// Package eventgrid implements the Azure ARM Eventgrid service API version 2017-06-15-preview. +// +// Azure EventGrid Management Client +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Eventgrid + DefaultBaseURI = "https://management.azure.com" +) + +// ManagementClient is the base client for Eventgrid. +type ManagementClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the ManagementClient client. +func New(subscriptionID string) ManagementClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the ManagementClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { + return ManagementClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/eventsubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/eventsubscriptions.go new file mode 100644 index 000000000000..994b6048a18d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/eventsubscriptions.go @@ -0,0 +1,1040 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// EventSubscriptionsClient is the azure EventGrid Management Client +type EventSubscriptionsClient struct { + ManagementClient +} + +// NewEventSubscriptionsClient creates an instance of the EventSubscriptionsClient client. +func NewEventSubscriptionsClient(subscriptionID string) EventSubscriptionsClient { + return NewEventSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEventSubscriptionsClientWithBaseURI creates an instance of the EventSubscriptionsClient client. +func NewEventSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) EventSubscriptionsClient { + return EventSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create asynchronously creates a new event subscription to the specified scope. Existing event subscriptions cannot +// be updated with this API and should instead use the Update event subscription API. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// scope is the scope of the resource to which the event subscription needs to be created. The scope can be a +// subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an +// EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' +// for a resource, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' +// for an EventGrid topic. eventSubscriptionName is name of the event subscription to be created. Event subscription +// names must be between 3 and 64 characters in length and use alphanumeric letters only. eventSubscriptionInfo is +// event subscription properties containing the destination and filter information +func (client EventSubscriptionsClient) Create(scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, cancel <-chan struct{}) (<-chan EventSubscription, <-chan error) { + resultChan := make(chan EventSubscription, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result EventSubscription + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreatePreparer(scope, eventSubscriptionName, eventSubscriptionInfo, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Create", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreatePreparer prepares the Create request. +func (client EventSubscriptionsClient) CreatePreparer(scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventSubscriptionName": autorest.Encode("path", eventSubscriptionName), + "scope": scope, + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), + autorest.WithJSON(eventSubscriptionInfo), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) CreateResponder(resp *http.Response) (result EventSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an existing event subscription 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. +// +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level +// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// '/subscriptions/{subscriptionId}/' for a subscription, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' +// for a resource, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' +// for an EventGrid topic. eventSubscriptionName is name of the event subscription +func (client EventSubscriptionsClient) Delete(scope string, eventSubscriptionName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(scope, eventSubscriptionName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client EventSubscriptionsClient) DeletePreparer(scope string, eventSubscriptionName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventSubscriptionName": autorest.Encode("path", eventSubscriptionName), + "scope": scope, + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get properties of an event subscription +// +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level +// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// '/subscriptions/{subscriptionId}/' for a subscription, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' +// for a resource, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' +// for an EventGrid topic. eventSubscriptionName is name of the event subscription +func (client EventSubscriptionsClient) Get(scope string, eventSubscriptionName string) (result EventSubscription, err error) { + req, err := client.GetPreparer(scope, eventSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EventSubscriptionsClient) GetPreparer(scope string, eventSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventSubscriptionName": autorest.Encode("path", eventSubscriptionName), + "scope": scope, + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) GetResponder(resp *http.Response) (result EventSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFullURL get the full endpoint URL for an event subscription +// +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level +// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// '/subscriptions/{subscriptionId}/' for a subscription, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' +// for a resource, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' +// for an EventGrid topic. eventSubscriptionName is name of the event subscription +func (client EventSubscriptionsClient) GetFullURL(scope string, eventSubscriptionName string) (result EventSubscriptionFullURL, err error) { + req, err := client.GetFullURLPreparer(scope, eventSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "GetFullURL", nil, "Failure preparing request") + return + } + + resp, err := client.GetFullURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "GetFullURL", resp, "Failure sending request") + return + } + + result, err = client.GetFullURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "GetFullURL", resp, "Failure responding to request") + } + + return +} + +// GetFullURLPreparer prepares the GetFullURL request. +func (client EventSubscriptionsClient) GetFullURLPreparer(scope string, eventSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventSubscriptionName": autorest.Encode("path", eventSubscriptionName), + "scope": scope, + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetFullURLSender sends the GetFullURL request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) GetFullURLSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetFullURLResponder handles the response to the GetFullURL request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) GetFullURLResponder(resp *http.Response) (result EventSubscriptionFullURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResource list all event subscriptions that have been created for a specific topic +// +// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is namespace +// of the provider of the topic resourceTypeName is name of the resource type resourceName is name of the resource +func (client EventSubscriptionsClient) ListByResource(resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListByResourcePreparer(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListByResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListByResource", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListByResource", resp, "Failure responding to request") + } + + return +} + +// ListByResourcePreparer prepares the ListByResource request. +func (client EventSubscriptionsClient) ListByResourcePreparer(resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceTypeName": autorest.Encode("path", resourceTypeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceSender sends the ListByResource request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListByResourceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceResponder handles the response to the ListByResource request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListByResourceResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGlobalByResourceGroup list all global event subscriptions under a specific Azure subscription and resource group +// +// resourceGroupName is the name of the resource group within the user's subscription. +func (client EventSubscriptionsClient) ListGlobalByResourceGroup(resourceGroupName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListGlobalByResourceGroupPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListGlobalByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListGlobalByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListGlobalByResourceGroupPreparer prepares the ListGlobalByResourceGroup request. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListGlobalByResourceGroupSender sends the ListGlobalByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListGlobalByResourceGroupResponder handles the response to the ListGlobalByResourceGroup request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGlobalByResourceGroupForTopicType list all global event subscriptions under a resource group for a specific +// topic type. +// +// resourceGroupName is the name of the resource group within the user's subscription. topicTypeName is name of the +// topic type +func (client EventSubscriptionsClient) ListGlobalByResourceGroupForTopicType(resourceGroupName string, topicTypeName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListGlobalByResourceGroupForTopicTypePreparer(resourceGroupName, topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroupForTopicType", nil, "Failure preparing request") + return + } + + resp, err := client.ListGlobalByResourceGroupForTopicTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroupForTopicType", resp, "Failure sending request") + return + } + + result, err = client.ListGlobalByResourceGroupForTopicTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalByResourceGroupForTopicType", resp, "Failure responding to request") + } + + return +} + +// ListGlobalByResourceGroupForTopicTypePreparer prepares the ListGlobalByResourceGroupForTopicType request. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupForTopicTypePreparer(resourceGroupName string, topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListGlobalByResourceGroupForTopicTypeSender sends the ListGlobalByResourceGroupForTopicType request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupForTopicTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListGlobalByResourceGroupForTopicTypeResponder handles the response to the ListGlobalByResourceGroupForTopicType request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListGlobalByResourceGroupForTopicTypeResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGlobalBySubscription list all aggregated global event subscriptions under a specific Azure subscription +func (client EventSubscriptionsClient) ListGlobalBySubscription() (result EventSubscriptionsListResult, err error) { + req, err := client.ListGlobalBySubscriptionPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListGlobalBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListGlobalBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListGlobalBySubscriptionPreparer prepares the ListGlobalBySubscription request. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListGlobalBySubscriptionSender sends the ListGlobalBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListGlobalBySubscriptionResponder handles the response to the ListGlobalBySubscription request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListGlobalBySubscriptionForTopicType list all global event subscriptions under an Azure subscription for a topic +// type. +// +// topicTypeName is name of the topic type +func (client EventSubscriptionsClient) ListGlobalBySubscriptionForTopicType(topicTypeName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListGlobalBySubscriptionForTopicTypePreparer(topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscriptionForTopicType", nil, "Failure preparing request") + return + } + + resp, err := client.ListGlobalBySubscriptionForTopicTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscriptionForTopicType", resp, "Failure sending request") + return + } + + result, err = client.ListGlobalBySubscriptionForTopicTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListGlobalBySubscriptionForTopicType", resp, "Failure responding to request") + } + + return +} + +// ListGlobalBySubscriptionForTopicTypePreparer prepares the ListGlobalBySubscriptionForTopicType request. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionForTopicTypePreparer(topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListGlobalBySubscriptionForTopicTypeSender sends the ListGlobalBySubscriptionForTopicType request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionForTopicTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListGlobalBySubscriptionForTopicTypeResponder handles the response to the ListGlobalBySubscriptionForTopicType request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListGlobalBySubscriptionForTopicTypeResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRegionalByResourceGroup list all event subscriptions from the given location under a specific Azure subscription +// and resource group +// +// resourceGroupName is the name of the resource group within the user's subscription. location is name of the location +func (client EventSubscriptionsClient) ListRegionalByResourceGroup(resourceGroupName string, location string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListRegionalByResourceGroupPreparer(resourceGroupName, location) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegionalByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListRegionalByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListRegionalByResourceGroupPreparer prepares the ListRegionalByResourceGroup request. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupPreparer(resourceGroupName string, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListRegionalByResourceGroupSender sends the ListRegionalByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListRegionalByResourceGroupResponder handles the response to the ListRegionalByResourceGroup request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRegionalByResourceGroupForTopicType list all event subscriptions from the given location under a specific Azure +// subscription and resource group and topic type +// +// resourceGroupName is the name of the resource group within the user's subscription. location is name of the location +// topicTypeName is name of the topic type +func (client EventSubscriptionsClient) ListRegionalByResourceGroupForTopicType(resourceGroupName string, location string, topicTypeName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListRegionalByResourceGroupForTopicTypePreparer(resourceGroupName, location, topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroupForTopicType", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegionalByResourceGroupForTopicTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroupForTopicType", resp, "Failure sending request") + return + } + + result, err = client.ListRegionalByResourceGroupForTopicTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalByResourceGroupForTopicType", resp, "Failure responding to request") + } + + return +} + +// ListRegionalByResourceGroupForTopicTypePreparer prepares the ListRegionalByResourceGroupForTopicType request. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupForTopicTypePreparer(resourceGroupName string, location string, topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListRegionalByResourceGroupForTopicTypeSender sends the ListRegionalByResourceGroupForTopicType request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupForTopicTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListRegionalByResourceGroupForTopicTypeResponder handles the response to the ListRegionalByResourceGroupForTopicType request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListRegionalByResourceGroupForTopicTypeResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRegionalBySubscription list all event subscriptions from the given location under a specific Azure subscription +// +// location is name of the location +func (client EventSubscriptionsClient) ListRegionalBySubscription(location string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListRegionalBySubscriptionPreparer(location) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegionalBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListRegionalBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListRegionalBySubscriptionPreparer prepares the ListRegionalBySubscription request. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionPreparer(location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListRegionalBySubscriptionSender sends the ListRegionalBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListRegionalBySubscriptionResponder handles the response to the ListRegionalBySubscription request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRegionalBySubscriptionForTopicType list all event subscriptions from the given location under a specific Azure +// subscription and topic type. +// +// location is name of the location topicTypeName is name of the topic type +func (client EventSubscriptionsClient) ListRegionalBySubscriptionForTopicType(location string, topicTypeName string) (result EventSubscriptionsListResult, err error) { + req, err := client.ListRegionalBySubscriptionForTopicTypePreparer(location, topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscriptionForTopicType", nil, "Failure preparing request") + return + } + + resp, err := client.ListRegionalBySubscriptionForTopicTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscriptionForTopicType", resp, "Failure sending request") + return + } + + result, err = client.ListRegionalBySubscriptionForTopicTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "ListRegionalBySubscriptionForTopicType", resp, "Failure responding to request") + } + + return +} + +// ListRegionalBySubscriptionForTopicTypePreparer prepares the ListRegionalBySubscriptionForTopicType request. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionForTopicTypePreparer(location string, topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListRegionalBySubscriptionForTopicTypeSender sends the ListRegionalBySubscriptionForTopicType request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionForTopicTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListRegionalBySubscriptionForTopicTypeResponder handles the response to the ListRegionalBySubscriptionForTopicType request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) ListRegionalBySubscriptionForTopicTypeResponder(resp *http.Response) (result EventSubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update asynchronously updates an existing event subscription. 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. +// +// scope is the scope of existing event subscription. The scope can be a subscription, or a resource group, or a top +// level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// '/subscriptions/{subscriptionId}/' for a subscription, +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' +// for a resource, and +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' +// for an EventGrid topic. eventSubscriptionName is name of the event subscription to be created +// eventSubscriptionUpdateParameters is updated event subscription information +func (client EventSubscriptionsClient) Update(scope string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, cancel <-chan struct{}) (<-chan EventSubscription, <-chan error) { + resultChan := make(chan EventSubscription, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result EventSubscription + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client EventSubscriptionsClient) UpdatePreparer(scope string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventSubscriptionName": autorest.Encode("path", eventSubscriptionName), + "scope": scope, + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), + autorest.WithJSON(eventSubscriptionUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client EventSubscriptionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client EventSubscriptionsClient) UpdateResponder(resp *http.Response) (result EventSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/models.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/models.go new file mode 100644 index 000000000000..efcf8c3add2d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/models.go @@ -0,0 +1,292 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // WebHook specifies the web hook state for endpoint type. + WebHook EndpointType = "WebHook" +) + +// EventSubscriptionProvisioningState enumerates the values for event subscription provisioning state. +type EventSubscriptionProvisioningState string + +const ( + // Canceled specifies the canceled state for event subscription provisioning state. + Canceled EventSubscriptionProvisioningState = "Canceled" + // Creating specifies the creating state for event subscription provisioning state. + Creating EventSubscriptionProvisioningState = "Creating" + // Deleting specifies the deleting state for event subscription provisioning state. + Deleting EventSubscriptionProvisioningState = "Deleting" + // Failed specifies the failed state for event subscription provisioning state. + Failed EventSubscriptionProvisioningState = "Failed" + // Succeeded specifies the succeeded state for event subscription provisioning state. + Succeeded EventSubscriptionProvisioningState = "Succeeded" + // Updating specifies the updating state for event subscription provisioning state. + Updating EventSubscriptionProvisioningState = "Updating" +) + +// OperationOrigin enumerates the values for operation origin. +type OperationOrigin string + +const ( + // System specifies the system state for operation origin. + System OperationOrigin = "System" + // User specifies the user state for operation origin. + User OperationOrigin = "User" + // UserAndSystem specifies the user and system state for operation origin. + UserAndSystem OperationOrigin = "UserAndSystem" +) + +// ResourceRegionType enumerates the values for resource region type. +type ResourceRegionType string + +const ( + // GlobalResource specifies the global resource state for resource region type. + GlobalResource ResourceRegionType = "GlobalResource" + // RegionalResource specifies the regional resource state for resource region type. + RegionalResource ResourceRegionType = "RegionalResource" +) + +// TopicProvisioningState enumerates the values for topic provisioning state. +type TopicProvisioningState string + +const ( + // TopicProvisioningStateCanceled specifies the topic provisioning state canceled state for topic provisioning + // state. + TopicProvisioningStateCanceled TopicProvisioningState = "Canceled" + // TopicProvisioningStateCreating specifies the topic provisioning state creating state for topic provisioning + // state. + TopicProvisioningStateCreating TopicProvisioningState = "Creating" + // TopicProvisioningStateDeleting specifies the topic provisioning state deleting state for topic provisioning + // state. + TopicProvisioningStateDeleting TopicProvisioningState = "Deleting" + // TopicProvisioningStateFailed specifies the topic provisioning state failed state for topic provisioning state. + TopicProvisioningStateFailed TopicProvisioningState = "Failed" + // TopicProvisioningStateSucceeded specifies the topic provisioning state succeeded state for topic provisioning + // state. + TopicProvisioningStateSucceeded TopicProvisioningState = "Succeeded" + // TopicProvisioningStateUpdating specifies the topic provisioning state updating state for topic provisioning + // state. + TopicProvisioningStateUpdating TopicProvisioningState = "Updating" +) + +// TopicTypeProvisioningState enumerates the values for topic type provisioning state. +type TopicTypeProvisioningState string + +const ( + // TopicTypeProvisioningStateCanceled specifies the topic type provisioning state canceled state for topic type + // provisioning state. + TopicTypeProvisioningStateCanceled TopicTypeProvisioningState = "Canceled" + // TopicTypeProvisioningStateCreating specifies the topic type provisioning state creating state for topic type + // provisioning state. + TopicTypeProvisioningStateCreating TopicTypeProvisioningState = "Creating" + // TopicTypeProvisioningStateDeleting specifies the topic type provisioning state deleting state for topic type + // provisioning state. + TopicTypeProvisioningStateDeleting TopicTypeProvisioningState = "Deleting" + // TopicTypeProvisioningStateFailed specifies the topic type provisioning state failed state for topic type + // provisioning state. + TopicTypeProvisioningStateFailed TopicTypeProvisioningState = "Failed" + // TopicTypeProvisioningStateSucceeded specifies the topic type provisioning state succeeded state for topic type + // provisioning state. + TopicTypeProvisioningStateSucceeded TopicTypeProvisioningState = "Succeeded" + // TopicTypeProvisioningStateUpdating specifies the topic type provisioning state updating state for topic type + // provisioning state. + TopicTypeProvisioningStateUpdating TopicTypeProvisioningState = "Updating" +) + +// EventSubscription is event Subscription +type EventSubscription struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + *EventSubscriptionProperties `json:"properties,omitempty"` +} + +// EventSubscriptionDestination is information about the destination for an event subscription +type EventSubscriptionDestination struct { + EndpointType EndpointType `json:"endpointType,omitempty"` + *EventSubscriptionDestinationProperties `json:"properties,omitempty"` +} + +// EventSubscriptionDestinationProperties is properties of the event subscription destination +type EventSubscriptionDestinationProperties struct { + EndpointURL *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` +} + +// EventSubscriptionFilter is filter for the Event Subscription +type EventSubscriptionFilter struct { + SubjectBeginsWith *string `json:"subjectBeginsWith,omitempty"` + SubjectEndsWith *string `json:"subjectEndsWith,omitempty"` + IncludedEventTypes *[]string `json:"includedEventTypes,omitempty"` + IsSubjectCaseSensitive *bool `json:"isSubjectCaseSensitive,omitempty"` +} + +// EventSubscriptionFullURL is full endpoint url of an event subscription +type EventSubscriptionFullURL struct { + autorest.Response `json:"-"` + EndpointURL *string `json:"endpointUrl,omitempty"` +} + +// EventSubscriptionProperties is properties of the Event Subscription +type EventSubscriptionProperties struct { + Topic *string `json:"topic,omitempty"` + ProvisioningState EventSubscriptionProvisioningState `json:"provisioningState,omitempty"` + Destination *EventSubscriptionDestination `json:"destination,omitempty"` + Filter *EventSubscriptionFilter `json:"filter,omitempty"` + Labels *[]string `json:"labels,omitempty"` +} + +// EventSubscriptionsListResult is result of the List EventSubscriptions operation +type EventSubscriptionsListResult struct { + autorest.Response `json:"-"` + Value *[]EventSubscription `json:"value,omitempty"` +} + +// EventSubscriptionUpdateParameters is properties of the Event Subscription update +type EventSubscriptionUpdateParameters struct { + Destination *EventSubscriptionDestination `json:"destination,omitempty"` + Filter *EventSubscriptionFilter `json:"filter,omitempty"` + Labels *[]string `json:"labels,omitempty"` +} + +// EventType is event Type for a subject under a topic +type EventType struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + *EventTypeProperties `json:"properties,omitempty"` +} + +// EventTypeProperties is properties of the event type +type EventTypeProperties struct { + DisplayName *string `json:"displayName,omitempty"` + Description *string `json:"description,omitempty"` + SchemaURL *string `json:"schemaUrl,omitempty"` +} + +// EventTypesListResult is result of the List Event Types operation +type EventTypesListResult struct { + autorest.Response `json:"-"` + Value *[]EventType `json:"value,omitempty"` +} + +// Operation is represents an operation returned by the GetOperations request +type Operation struct { + Name *string `json:"name,omitempty"` + Display *OperationInfo `json:"display,omitempty"` + Origin OperationOrigin `json:"origin,omitempty"` + Properties *map[string]interface{} `json:"properties,omitempty"` +} + +// OperationInfo is information about an operation +type OperationInfo struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationsListResult is result of the List Operations operation +type OperationsListResult struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` +} + +// Resource is definition of a Resource +type Resource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} + +// Topic is eventGrid Topic +type Topic 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"` + *TopicProperties `json:"properties,omitempty"` +} + +// TopicProperties is properties of the Topic +type TopicProperties struct { + ProvisioningState TopicProvisioningState `json:"provisioningState,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` +} + +// TopicRegenerateKeyRequest is topic regenerate share access key key request +type TopicRegenerateKeyRequest struct { + KeyName *string `json:"keyName,omitempty"` +} + +// TopicSharedAccessKeys is shared access keys of the Topic +type TopicSharedAccessKeys struct { + autorest.Response `json:"-"` + Key1 *string `json:"key1,omitempty"` + Key2 *string `json:"key2,omitempty"` +} + +// TopicsListResult is result of the List Topics operation +type TopicsListResult struct { + autorest.Response `json:"-"` + Value *[]Topic `json:"value,omitempty"` +} + +// TopicTypeInfo is properties of a topic type info. +type TopicTypeInfo struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + *TopicTypeProperties `json:"properties,omitempty"` +} + +// TopicTypeProperties is properties of a topic type. +type TopicTypeProperties struct { + Provider *string `json:"provider,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Description *string `json:"description,omitempty"` + ResourceRegionType ResourceRegionType `json:"resourceRegionType,omitempty"` + ProvisioningState TopicTypeProvisioningState `json:"provisioningState,omitempty"` +} + +// TopicTypesListResult is result of the List Topic Types operation +type TopicTypesListResult struct { + autorest.Response `json:"-"` + Value *[]TopicTypeInfo `json:"value,omitempty"` +} + +// TrackedResource is definition of a Tracked Resource +type TrackedResource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/operations.go new file mode 100644 index 000000000000..8c89d3eb07c0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/operations.go @@ -0,0 +1,96 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the azure EventGrid Management Client +type OperationsClient struct { + ManagementClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list the available operations supported by the Microsoft.EventGrid resource provider +func (client OperationsClient) List() (result OperationsListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer() (*http.Request, error) { + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.EventGrid/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topics.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topics.go new file mode 100644 index 000000000000..e094c867aba7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topics.go @@ -0,0 +1,602 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// TopicsClient is the azure EventGrid Management Client +type TopicsClient struct { + ManagementClient +} + +// NewTopicsClient creates an instance of the TopicsClient client. +func NewTopicsClient(subscriptionID string) TopicsClient { + return NewTopicsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTopicsClientWithBaseURI creates an instance of the TopicsClient client. +func NewTopicsClientWithBaseURI(baseURI string, subscriptionID string) TopicsClient { + return TopicsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate asynchronously creates a new topic with the specified parameters. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +// topicInfo is topic information +func (client TopicsClient) CreateOrUpdate(resourceGroupName string, topicName string, topicInfo Topic, cancel <-chan struct{}) (<-chan Topic, <-chan error) { + resultChan := make(chan Topic, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result Topic + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, topicName, topicInfo, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TopicsClient) CreateOrUpdatePreparer(resourceGroupName string, topicName string, topicInfo Topic, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicName": autorest.Encode("path", topicName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", pathParameters), + autorest.WithJSON(topicInfo), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result Topic, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete existing topic This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +func (client TopicsClient) Delete(resourceGroupName string, topicName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, topicName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client TopicsClient) DeletePreparer(resourceGroupName string, topicName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicName": autorest.Encode("path", topicName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TopicsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get properties of a topic +// +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +func (client TopicsClient) Get(resourceGroupName string, topicName string) (result Topic, err error) { + req, err := client.GetPreparer(resourceGroupName, topicName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TopicsClient) GetPreparer(resourceGroupName string, topicName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicName": autorest.Encode("path", topicName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TopicsClient) GetResponder(resp *http.Response) (result Topic, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list all the topics under a resource group +// +// resourceGroupName is the name of the resource group within the user's subscription. +func (client TopicsClient) ListByResourceGroup(resourceGroupName string) (result TopicsListResult, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client TopicsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client TopicsClient) ListByResourceGroupResponder(resp *http.Response) (result TopicsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription list all the topics under an Azure subscription +func (client TopicsClient) ListBySubscription() (result TopicsListResult, err error) { + req, err := client.ListBySubscriptionPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client TopicsClient) ListBySubscriptionPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics", 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 TopicsClient) 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 TopicsClient) ListBySubscriptionResponder(resp *http.Response) (result TopicsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListEventTypes list event types for a topic +// +// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is namespace +// of the provider of the topic resourceTypeName is name of the topic type resourceName is name of the topic +func (client TopicsClient) ListEventTypes(resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (result EventTypesListResult, err error) { + req, err := client.ListEventTypesPreparer(resourceGroupName, providerNamespace, resourceTypeName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListEventTypes", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventTypesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListEventTypes", resp, "Failure sending request") + return + } + + result, err = client.ListEventTypesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListEventTypes", resp, "Failure responding to request") + } + + return +} + +// ListEventTypesPreparer prepares the ListEventTypes request. +func (client TopicsClient) ListEventTypesPreparer(resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceTypeName": autorest.Encode("path", resourceTypeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListEventTypesSender sends the ListEventTypes request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) ListEventTypesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListEventTypesResponder handles the response to the ListEventTypes request. The method always +// closes the http.Response Body. +func (client TopicsClient) ListEventTypesResponder(resp *http.Response) (result EventTypesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSharedAccessKeys list the two keys used to publish to a topic +// +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +func (client TopicsClient) ListSharedAccessKeys(resourceGroupName string, topicName string) (result TopicSharedAccessKeys, err error) { + req, err := client.ListSharedAccessKeysPreparer(resourceGroupName, topicName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListSharedAccessKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListSharedAccessKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListSharedAccessKeys", resp, "Failure sending request") + return + } + + result, err = client.ListSharedAccessKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "ListSharedAccessKeys", resp, "Failure responding to request") + } + + return +} + +// ListSharedAccessKeysPreparer prepares the ListSharedAccessKeys request. +func (client TopicsClient) ListSharedAccessKeysPreparer(resourceGroupName string, topicName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicName": autorest.Encode("path", topicName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSharedAccessKeysSender sends the ListSharedAccessKeys request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) ListSharedAccessKeysSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListSharedAccessKeysResponder handles the response to the ListSharedAccessKeys request. The method always +// closes the http.Response Body. +func (client TopicsClient) ListSharedAccessKeysResponder(resp *http.Response) (result TopicSharedAccessKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerate a shared access key for a topic +// +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +// regenerateKeyRequest is request body to regenerate key +func (client TopicsClient) RegenerateKey(resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest) (result TopicSharedAccessKeys, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: regenerateKeyRequest, + Constraints: []validation.Constraint{{Target: "regenerateKeyRequest.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "eventgrid.TopicsClient", "RegenerateKey") + } + + req, err := client.RegenerateKeyPreparer(resourceGroupName, topicName, regenerateKeyRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client TopicsClient) RegenerateKeyPreparer(resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "topicName": autorest.Encode("path", topicName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey", pathParameters), + autorest.WithJSON(regenerateKeyRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client TopicsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client TopicsClient) RegenerateKeyResponder(resp *http.Response) (result TopicSharedAccessKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topictypes.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topictypes.go new file mode 100644 index 000000000000..8986cc7353c5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/topictypes.go @@ -0,0 +1,222 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// TopicTypesClient is the azure EventGrid Management Client +type TopicTypesClient struct { + ManagementClient +} + +// NewTopicTypesClient creates an instance of the TopicTypesClient client. +func NewTopicTypesClient(subscriptionID string) TopicTypesClient { + return NewTopicTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTopicTypesClientWithBaseURI creates an instance of the TopicTypesClient client. +func NewTopicTypesClientWithBaseURI(baseURI string, subscriptionID string) TopicTypesClient { + return TopicTypesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get information about a topic type +// +// topicTypeName is name of the topic type +func (client TopicTypesClient) Get(topicTypeName string) (result TopicTypeInfo, err error) { + req, err := client.GetPreparer(topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TopicTypesClient) GetPreparer(topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TopicTypesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TopicTypesClient) GetResponder(resp *http.Response) (result TopicTypeInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all registered topic types +func (client TopicTypesClient) List() (result TopicTypesListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TopicTypesClient) ListPreparer() (*http.Request, error) { + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.EventGrid/topicTypes"), + 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 TopicTypesClient) 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 TopicTypesClient) ListResponder(resp *http.Response) (result TopicTypesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListEventTypes list event types for a topic type +// +// topicTypeName is name of the topic type +func (client TopicTypesClient) ListEventTypes(topicTypeName string) (result EventTypesListResult, err error) { + req, err := client.ListEventTypesPreparer(topicTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "ListEventTypes", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventTypesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "ListEventTypes", resp, "Failure sending request") + return + } + + result, err = client.ListEventTypesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicTypesClient", "ListEventTypes", resp, "Failure responding to request") + } + + return +} + +// ListEventTypesPreparer prepares the ListEventTypes request. +func (client TopicTypesClient) ListEventTypesPreparer(topicTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "topicTypeName": autorest.Encode("path", topicTypeName), + } + + const APIVersion = "2017-06-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListEventTypesSender sends the ListEventTypes request. The method will close the +// http.Response Body if it receives an error. +func (client TopicTypesClient) ListEventTypesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListEventTypesResponder handles the response to the ListEventTypes request. The method always +// closes the http.Response Body. +func (client TopicTypesClient) ListEventTypesResponder(resp *http.Response) (result EventTypesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/version.go b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/version.go new file mode 100644 index 000000000000..0d5c819ba42b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/arm/eventgrid/version.go @@ -0,0 +1,28 @@ +package eventgrid + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 +// 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.3.0-beta arm-eventgrid/2017-06-15-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return "v10.3.0-beta" +} diff --git a/vendor/vendor.json b/vendor/vendor.json index ec7192b63fde..2400acf7adee 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -66,6 +66,14 @@ "version": "=v10.3.0-beta", "versionExact": "v10.3.0-beta" }, + { + "checksumSHA1": "i1pLQMVhrlT9cYp3jQUkGFHfP0A=", + "path": "github.com/Azure/azure-sdk-for-go/arm/eventgrid", + "revision": "57db66900881e9fd21fd041a9d013514700ecab3", + "revisionTime": "2017-08-18T20:19:01Z", + "version": "=v10.3.0-beta", + "versionExact": "v10.3.0-beta" + }, { "checksumSHA1": "AsVckRblHlJt2zcSzEcDHPZZCTs=", "path": "github.com/Azure/azure-sdk-for-go/arm/eventhub", From 20548fe341545c31c0704b17ca5d9a0a64c3c666 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Sat, 19 Aug 2017 15:46:59 +0200 Subject: [PATCH 2/6] Documentation examples should be Standard SKU's to work as expected --- website/docs/r/eventhub.html.markdown | 2 +- website/docs/r/eventhub_namespace.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/eventhub.html.markdown b/website/docs/r/eventhub.html.markdown index 1a37661bd11e..ef342d6326b5 100644 --- a/website/docs/r/eventhub.html.markdown +++ b/website/docs/r/eventhub.html.markdown @@ -22,7 +22,7 @@ resource "azurerm_eventhub_namespace" "test" { name = "acceptanceTestEventHubNamespace" location = "West US" resource_group_name = "${azurerm_resource_group.test.name}" - sku = "Basic" + sku = "Standard" capacity = 1 tags { diff --git a/website/docs/r/eventhub_namespace.html.markdown b/website/docs/r/eventhub_namespace.html.markdown index 0d69bdba3782..11ae113ee5ba 100644 --- a/website/docs/r/eventhub_namespace.html.markdown +++ b/website/docs/r/eventhub_namespace.html.markdown @@ -22,7 +22,7 @@ resource "azurerm_eventhub_namespace" "test" { name = "acceptanceTestEventHubNamespace" location = "West US" resource_group_name = "${azurerm_resource_group.test.name}" - sku = "Basic" + sku = "Standard" capacity = 2 tags { From deeb083f5a7142f6f3ab476978af747251e705d6 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Sat, 19 Aug 2017 15:47:23 +0200 Subject: [PATCH 3/6] Combining EventHub + Service Bus into Messaging Resources --- website/azurerm.erb | 75 +++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/website/azurerm.erb b/website/azurerm.erb index fe3e3867b28c..cdbaf3e0fa89 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -137,24 +137,6 @@ - > - Event Hubs - - - > Key Vault Resources + + + > + Messaging Resources + @@ -284,27 +300,6 @@ - > - ServiceBus - - - > SQL Resources