diff --git a/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go b/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go deleted file mode 100644 index 59eababf32d7..000000000000 --- a/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go +++ /dev/null @@ -1,118 +0,0 @@ -package eventhub - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "net/http" -) - -// MessagingPlanClient is the azure Event Hubs client -type MessagingPlanClient struct { - BaseClient -} - -// NewMessagingPlanClient creates an instance of the MessagingPlanClient client. -func NewMessagingPlanClient(subscriptionID string) MessagingPlanClient { - return NewMessagingPlanClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewMessagingPlanClientWithBaseURI creates an instance of the MessagingPlanClient client. -func NewMessagingPlanClientWithBaseURI(baseURI string, subscriptionID string) MessagingPlanClient { - return MessagingPlanClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a description for the specified namespace. -// -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace -// name -func (client MessagingPlanClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result MessagingPlan, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: namespaceName, - Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewError("eventhub.MessagingPlanClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client MessagingPlanClient) GetPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "namespaceName": autorest.Encode("path", namespaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client MessagingPlanClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client MessagingPlanClient) GetResponder(resp *http.Response) (result MessagingPlan, 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/services/eventhub/mgmt/2017-04-01/eventhub/models.go b/services/eventhub/mgmt/2017-04-01/eventhub/models.go index 23b11d79fcc7..538bef29e889 100644 --- a/services/eventhub/mgmt/2017-04-01/eventhub/models.go +++ b/services/eventhub/mgmt/2017-04-01/eventhub/models.go @@ -1239,127 +1239,6 @@ func (page ListResultPage) Values() []Model { return *page.lr.Value } -// MessagingPlan messaging -type MessagingPlan struct { - autorest.Response `json:"-"` - *MessagingPlanproperties `json:"properties,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for MessagingPlan. -func (mp MessagingPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mp.MessagingPlanproperties != nil { - objectMap["properties"] = mp.MessagingPlanproperties - } - if mp.Location != nil { - objectMap["location"] = mp.Location - } - if mp.Tags != nil { - objectMap["tags"] = mp.Tags - } - if mp.ID != nil { - objectMap["id"] = mp.ID - } - if mp.Name != nil { - objectMap["name"] = mp.Name - } - if mp.Type != nil { - objectMap["type"] = mp.Type - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for MessagingPlan struct. -func (mp *MessagingPlan) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var messagingPlanproperties MessagingPlanproperties - err = json.Unmarshal(*v, &messagingPlanproperties) - if err != nil { - return err - } - mp.MessagingPlanproperties = &messagingPlanproperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mp.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mp.Type = &typeVar - } - } - } - - return nil -} - -// MessagingPlanproperties messaging Region -type MessagingPlanproperties struct { - // Sku - Sku type - Sku *int32 `json:"sku,omitempty"` - // SelectedEventHubUnit - Selected event hub unit - SelectedEventHubUnit *int32 `json:"selectedEventHubUnit,omitempty"` - // UpdatedAt - The exact time the messaging plan was updated. - UpdatedAt *date.Time `json:"updatedAt,omitempty"` - // Revision - revision number - Revision *int64 `json:"revision,omitempty"` -} - // MessagingRegions messaging Region type MessagingRegions struct { Properties *MessagingRegionsProperties `json:"properties,omitempty"`