From 717e84ea3f76bb26afa27b2a7f3df52a9942387f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Dec 2020 00:43:17 +0000 Subject: [PATCH] CodeGen from PR 11027 in Azure/azure-rest-api-specs Eventhub: Added APIs to 2018-01-01-preview API version (#11027) * Added support for all API in 2018-preview version * removed extra files * fixed UNREFERENCED_JSON_FILE * update * prettier fix Co-authored-by: v-ajnava --- .../2018-01-01-preview/eventhub/CHANGELOG.md | 108 ++++ .../2018-01-01-preview/eventhub/client.go | 2 +- .../eventhub/consumergroups.go | 16 +- .../eventhub/disasterrecoveryconfigs.go | 20 +- .../mgmt/2018-01-01-preview/eventhub/enums.go | 94 +++- .../eventhub/eventhubapi/interfaces.go | 18 + .../2018-01-01-preview/eventhub/eventhubs.go | 38 +- .../2018-01-01-preview/eventhub/models.go | 488 ++++++++++++++++-- .../2018-01-01-preview/eventhub/namespaces.go | 14 +- .../2018-01-01-preview/eventhub/operations.go | 2 +- .../eventhub/privateendpointconnections.go | 433 ++++++++++++++++ .../eventhub/privatelinkresources.go | 129 +++++ .../2018-01-01-preview/eventhub/regions.go | 2 +- 13 files changed, 1255 insertions(+), 109 deletions(-) create mode 100644 services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/CHANGELOG.md create mode 100644 services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privateendpointconnections.go create mode 100644 services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privatelinkresources.go diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/CHANGELOG.md b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/CHANGELOG.md new file mode 100644 index 000000000000..7d23fdb2ec68 --- /dev/null +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/CHANGELOG.md @@ -0,0 +1,108 @@ +Generated from https://github.com/Azure/azure-rest-api-specs/tree/3c764635e7d442b3e74caf593029fcd440b3ef82 + +Code generator @microsoft.azure/autorest.go@~2.1.161 + +## Breaking Changes + +- Const `Creating` type has been changed from `EntityStatus` to `EndPointProvisioningState` +- Const `Deleting` type has been changed from `EntityStatus` to `EndPointProvisioningState` +- Const `Failed` type has been changed from `ProvisioningStateDR` to `EndPointProvisioningState` +- Const `Succeeded` type has been changed from `ProvisioningStateDR` to `EndPointProvisioningState` +- Function `NewVirtualNetworkRuleListResultPage` parameter(s) have been changed from `(func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` to `(VirtualNetworkRuleListResult, func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error))` +- Function `NewMessagingRegionsListResultPage` parameter(s) have been changed from `(func(context.Context, MessagingRegionsListResult) (MessagingRegionsListResult, error))` to `(MessagingRegionsListResult, func(context.Context, MessagingRegionsListResult) (MessagingRegionsListResult, error))` +- Function `NewListResultPage` parameter(s) have been changed from `(func(context.Context, ListResult) (ListResult, error))` to `(ListResult, func(context.Context, ListResult) (ListResult, error))` +- Function `NewClusterListResultPage` parameter(s) have been changed from `(func(context.Context, ClusterListResult) (ClusterListResult, error))` to `(ClusterListResult, func(context.Context, ClusterListResult) (ClusterListResult, error))` +- Function `NewIPFilterRuleListResultPage` parameter(s) have been changed from `(func(context.Context, IPFilterRuleListResult) (IPFilterRuleListResult, error))` to `(IPFilterRuleListResult, func(context.Context, IPFilterRuleListResult) (IPFilterRuleListResult, error))` +- Function `NewConsumerGroupListResultPage` parameter(s) have been changed from `(func(context.Context, ConsumerGroupListResult) (ConsumerGroupListResult, error))` to `(ConsumerGroupListResult, func(context.Context, ConsumerGroupListResult) (ConsumerGroupListResult, error))` +- Function `NewAuthorizationRuleListResultPage` parameter(s) have been changed from `(func(context.Context, AuthorizationRuleListResult) (AuthorizationRuleListResult, error))` to `(AuthorizationRuleListResult, func(context.Context, AuthorizationRuleListResult) (AuthorizationRuleListResult, error))` +- Function `NewEHNamespaceListResultPage` parameter(s) have been changed from `(func(context.Context, EHNamespaceListResult) (EHNamespaceListResult, error))` to `(EHNamespaceListResult, func(context.Context, EHNamespaceListResult) (EHNamespaceListResult, error))` +- Function `NewArmDisasterRecoveryListResultPage` parameter(s) have been changed from `(func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error))` to `(ArmDisasterRecoveryListResult, func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error))` +- Function `NewOperationListResultPage` parameter(s) have been changed from `(func(context.Context, OperationListResult) (OperationListResult, error))` to `(OperationListResult, func(context.Context, OperationListResult) (OperationListResult, error))` +- Const `Accepted` has been removed +- Const `SendDisabled` has been removed +- Const `Active` has been removed +- Const `Restoring` has been removed +- Const `Renaming` has been removed +- Const `Unknown` has been removed +- Const `ReceiveDisabled` has been removed +- Const `Disabled` has been removed + +## New Content + +- New const `EntityStatusRenaming` +- New const `EntityStatusSendDisabled` +- New const `Approved` +- New const `EntityStatusDeleting` +- New const `ProvisioningStateDRFailed` +- New const `Updating` +- New const `EntityStatusRestoring` +- New const `ProvisioningStateDRSucceeded` +- New const `ProvisioningStateDRAccepted` +- New const `EntityStatusDisabled` +- New const `EntityStatusReceiveDisabled` +- New const `EntityStatusUnknown` +- New const `EntityStatusCreating` +- New const `Pending` +- New const `Rejected` +- New const `Disconnected` +- New const `Canceled` +- New const `EntityStatusActive` +- New function `PrivateLinkResourcesClient.GetSender(*http.Request) (*http.Response, error)` +- New function `*PrivateLinkResource.UnmarshalJSON([]byte) error` +- New function `PrivateEndpointConnectionsClient.CreateOrUpdateSender(*http.Request) (*http.Response, error)` +- New function `PrivateEndpointConnectionsClient.ListResponder(*http.Response) (PrivateEndpointConnectionListResult, error)` +- New function `*PrivateEndpointConnectionListResultPage.NextWithContext(context.Context) error` +- New function `PrivateEndpointConnectionsClient.DeleteSender(*http.Request) (PrivateEndpointConnectionsDeleteFuture, error)` +- New function `NewPrivateLinkResourcesClientWithBaseURI(string, string) PrivateLinkResourcesClient` +- New function `NewPrivateLinkResourcesClient(string) PrivateLinkResourcesClient` +- New function `PrivateEndpointConnectionsClient.ListSender(*http.Request) (*http.Response, error)` +- New function `PrivateLinkResourcesClient.GetPreparer(context.Context, string, string) (*http.Request, error)` +- New function `PrivateLinkResourcesClient.Get(context.Context, string, string) (PrivateLinkResourcesListResult, error)` +- New function `PrivateEndpointConnectionListResultPage.NotDone() bool` +- New function `PrivateEndpointConnectionsClient.GetSender(*http.Request) (*http.Response, error)` +- New function `PrivateLinkResource.MarshalJSON() ([]byte, error)` +- New function `*PrivateEndpointConnectionListResultPage.Next() error` +- New function `PossiblePrivateLinkConnectionStatusValues() []PrivateLinkConnectionStatus` +- New function `NewPrivateEndpointConnectionListResultPage(PrivateEndpointConnectionListResult, func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage` +- New function `PrivateEndpointConnectionsClient.DeletePreparer(context.Context, string, string, string) (*http.Request, error)` +- New function `PrivateEndpointConnectionsClient.List(context.Context, string, string) (PrivateEndpointConnectionListResultPage, error)` +- New function `NewPrivateEndpointConnectionListResultIterator(PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator` +- New function `PrivateEndpointConnectionListResultIterator.Response() PrivateEndpointConnectionListResult` +- New function `PrivateEndpointConnectionsClient.Delete(context.Context, string, string, string) (PrivateEndpointConnectionsDeleteFuture, error)` +- New function `PrivateEndpointConnectionsClient.GetResponder(*http.Response) (PrivateEndpointConnection, error)` +- New function `*PrivateEndpointConnection.UnmarshalJSON([]byte) error` +- New function `NewPrivateEndpointConnectionsClient(string) PrivateEndpointConnectionsClient` +- New function `PrivateEndpointConnectionsClient.CreateOrUpdateResponder(*http.Response) (PrivateEndpointConnection, error)` +- New function `PrivateEndpointConnectionListResult.IsEmpty() bool` +- New function `PrivateEndpointConnectionsClient.GetPreparer(context.Context, string, string, string) (*http.Request, error)` +- New function `PrivateEndpointConnectionsClient.DeleteResponder(*http.Response) (autorest.Response, error)` +- New function `PrivateEndpointConnectionsClient.ListComplete(context.Context, string, string) (PrivateEndpointConnectionListResultIterator, error)` +- New function `PrivateEndpointConnectionsClient.CreateOrUpdatePreparer(context.Context, string, string, string, PrivateEndpointConnection) (*http.Request, error)` +- New function `PrivateEndpointConnectionsClient.Get(context.Context, string, string, string) (PrivateEndpointConnection, error)` +- New function `PrivateEndpointConnectionListResultPage.Values() []PrivateEndpointConnection` +- New function `PrivateEndpointConnectionListResultIterator.NotDone() bool` +- New function `PrivateEndpointConnectionListResultPage.Response() PrivateEndpointConnectionListResult` +- New function `PrivateEndpointConnection.MarshalJSON() ([]byte, error)` +- New function `PrivateEndpointConnectionsClient.CreateOrUpdate(context.Context, string, string, string, PrivateEndpointConnection) (PrivateEndpointConnection, error)` +- New function `*PrivateEndpointConnectionListResultIterator.Next() error` +- New function `*PrivateEndpointConnectionsDeleteFuture.Result(PrivateEndpointConnectionsClient) (autorest.Response, error)` +- New function `PrivateEndpointConnectionListResultIterator.Value() PrivateEndpointConnection` +- New function `*PrivateEndpointConnectionListResultIterator.NextWithContext(context.Context) error` +- New function `NewPrivateEndpointConnectionsClientWithBaseURI(string, string) PrivateEndpointConnectionsClient` +- New function `PossibleEndPointProvisioningStateValues() []EndPointProvisioningState` +- New function `PrivateLinkResourcesClient.GetResponder(*http.Response) (PrivateLinkResourcesListResult, error)` +- New function `PrivateEndpointConnectionsClient.ListPreparer(context.Context, string, string) (*http.Request, error)` +- New struct `ConnectionState` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResult` +- New struct `PrivateEndpointConnectionListResultIterator` +- New struct `PrivateEndpointConnectionListResultPage` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateEndpointConnectionsClient` +- New struct `PrivateEndpointConnectionsDeleteFuture` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkResourcesClient` +- New struct `PrivateLinkResourcesListResult` +- New field `TrustedServiceAccessEnabled` in struct `NetworkRuleSetProperties` diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go index a5850f2b3828..fe5c9199b646 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/client.go @@ -1,4 +1,4 @@ -// Package eventhub implements the Azure ARM Eventhub service API version . +// Package eventhub implements the Azure ARM Eventhub service API version 2018-01-01-preview. // // package eventhub diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/consumergroups.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/consumergroups.go index 24490c44b1f9..4e87795470e9 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/consumergroups.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/consumergroups.go @@ -68,7 +68,7 @@ func (client ConsumerGroupsClient) CreateOrUpdate(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, @@ -107,7 +107,7 @@ func (client ConsumerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client ConsumerGroupsClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, @@ -204,7 +204,7 @@ func (client ConsumerGroupsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,7 +259,7 @@ func (client ConsumerGroupsClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, @@ -298,7 +298,7 @@ func (client ConsumerGroupsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -358,7 +358,7 @@ func (client ConsumerGroupsClient) ListByEventHub(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, @@ -407,7 +407,7 @@ func (client ConsumerGroupsClient) ListByEventHubPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/disasterrecoveryconfigs.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/disasterrecoveryconfigs.go index 315e10a70b5c..182ce6269abf 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/disasterrecoveryconfigs.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/disasterrecoveryconfigs.go @@ -103,7 +103,7 @@ func (client DisasterRecoveryConfigsClient) BreakPairingPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -190,7 +190,7 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -283,7 +283,7 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -375,7 +375,7 @@ func (client DisasterRecoveryConfigsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -464,7 +464,7 @@ func (client DisasterRecoveryConfigsClient) FailOverPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -553,7 +553,7 @@ func (client DisasterRecoveryConfigsClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -647,7 +647,7 @@ func (client DisasterRecoveryConfigsClient) GetAuthorizationRulePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -736,7 +736,7 @@ func (client DisasterRecoveryConfigsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -867,7 +867,7 @@ func (client DisasterRecoveryConfigsClient) ListAuthorizationRulesPreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -998,7 +998,7 @@ func (client DisasterRecoveryConfigsClient) ListKeysPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/enums.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/enums.go index 81e34255c54a..e4d33b623de3 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/enums.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/enums.go @@ -64,33 +64,56 @@ func PossibleEncodingCaptureDescriptionValues() []EncodingCaptureDescription { return []EncodingCaptureDescription{Avro, AvroDeflate} } -// EntityStatus enumerates the values for entity status. -type EntityStatus string +// EndPointProvisioningState enumerates the values for end point provisioning state. +type EndPointProvisioningState string const ( - // Active ... - Active EntityStatus = "Active" + // Canceled ... + Canceled EndPointProvisioningState = "Canceled" // Creating ... - Creating EntityStatus = "Creating" + Creating EndPointProvisioningState = "Creating" // Deleting ... - Deleting EntityStatus = "Deleting" - // Disabled ... - Disabled EntityStatus = "Disabled" - // ReceiveDisabled ... - ReceiveDisabled EntityStatus = "ReceiveDisabled" - // Renaming ... - Renaming EntityStatus = "Renaming" - // Restoring ... - Restoring EntityStatus = "Restoring" - // SendDisabled ... - SendDisabled EntityStatus = "SendDisabled" - // Unknown ... - Unknown EntityStatus = "Unknown" + Deleting EndPointProvisioningState = "Deleting" + // Failed ... + Failed EndPointProvisioningState = "Failed" + // Succeeded ... + Succeeded EndPointProvisioningState = "Succeeded" + // Updating ... + Updating EndPointProvisioningState = "Updating" +) + +// PossibleEndPointProvisioningStateValues returns an array of possible values for the EndPointProvisioningState const type. +func PossibleEndPointProvisioningStateValues() []EndPointProvisioningState { + return []EndPointProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// EntityStatus enumerates the values for entity status. +type EntityStatus string + +const ( + // EntityStatusActive ... + EntityStatusActive EntityStatus = "Active" + // EntityStatusCreating ... + EntityStatusCreating EntityStatus = "Creating" + // EntityStatusDeleting ... + EntityStatusDeleting EntityStatus = "Deleting" + // EntityStatusDisabled ... + EntityStatusDisabled EntityStatus = "Disabled" + // EntityStatusReceiveDisabled ... + EntityStatusReceiveDisabled EntityStatus = "ReceiveDisabled" + // EntityStatusRenaming ... + EntityStatusRenaming EntityStatus = "Renaming" + // EntityStatusRestoring ... + EntityStatusRestoring EntityStatus = "Restoring" + // EntityStatusSendDisabled ... + EntityStatusSendDisabled EntityStatus = "SendDisabled" + // EntityStatusUnknown ... + EntityStatusUnknown EntityStatus = "Unknown" ) // PossibleEntityStatusValues returns an array of possible values for the EntityStatus const type. func PossibleEntityStatusValues() []EntityStatus { - return []EntityStatus{Active, Creating, Deleting, Disabled, ReceiveDisabled, Renaming, Restoring, SendDisabled, Unknown} + return []EntityStatus{EntityStatusActive, EntityStatusCreating, EntityStatusDeleting, EntityStatusDisabled, EntityStatusReceiveDisabled, EntityStatusRenaming, EntityStatusRestoring, EntityStatusSendDisabled, EntityStatusUnknown} } // IdentityType enumerates the values for identity type. @@ -162,21 +185,40 @@ func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { return []NetworkRuleIPAction{NetworkRuleIPActionAllow} } +// PrivateLinkConnectionStatus enumerates the values for private link connection status. +type PrivateLinkConnectionStatus string + +const ( + // Approved ... + Approved PrivateLinkConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateLinkConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateLinkConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateLinkConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkConnectionStatusValues returns an array of possible values for the PrivateLinkConnectionStatus const type. +func PossiblePrivateLinkConnectionStatusValues() []PrivateLinkConnectionStatus { + return []PrivateLinkConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + // ProvisioningStateDR enumerates the values for provisioning state dr. type ProvisioningStateDR string const ( - // Accepted ... - Accepted ProvisioningStateDR = "Accepted" - // Failed ... - Failed ProvisioningStateDR = "Failed" - // Succeeded ... - Succeeded ProvisioningStateDR = "Succeeded" + // ProvisioningStateDRAccepted ... + ProvisioningStateDRAccepted ProvisioningStateDR = "Accepted" + // ProvisioningStateDRFailed ... + ProvisioningStateDRFailed ProvisioningStateDR = "Failed" + // ProvisioningStateDRSucceeded ... + ProvisioningStateDRSucceeded ProvisioningStateDR = "Succeeded" ) // PossibleProvisioningStateDRValues returns an array of possible values for the ProvisioningStateDR const type. func PossibleProvisioningStateDRValues() []ProvisioningStateDR { - return []ProvisioningStateDR{Accepted, Failed, Succeeded} + return []ProvisioningStateDR{ProvisioningStateDRAccepted, ProvisioningStateDRFailed, ProvisioningStateDRSucceeded} } // RoleDisasterRecovery enumerates the values for role disaster recovery. diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go index e39eab241bb8..c8e0239d7df1 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go @@ -71,6 +71,24 @@ type NamespacesClientAPI interface { var _ NamespacesClientAPI = (*eventhub.NamespacesClient)(nil) +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters eventhub.PrivateEndpointConnection) (result eventhub.PrivateEndpointConnection, err error) + Delete(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (result eventhub.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (result eventhub.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, namespaceName string) (result eventhub.PrivateEndpointConnectionListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result eventhub.PrivateEndpointConnectionListResultIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*eventhub.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, namespaceName string) (result eventhub.PrivateLinkResourcesListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*eventhub.PrivateLinkResourcesClient)(nil) + // ConfigurationClientAPI contains the set of methods on the ConfigurationClient type. type ConfigurationClientAPI interface { Get(ctx context.Context, resourceGroupName string, clusterName string) (result eventhub.ClusterQuotaConfigurationProperties, err error) diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubs.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubs.go index 74f25139fbae..361c425fca6f 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubs.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubs.go @@ -67,7 +67,7 @@ func (client EventHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, @@ -119,7 +119,7 @@ func (client EventHubsClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -179,7 +179,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRule(ctx context.Contex Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, @@ -220,7 +220,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRulePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,7 +277,7 @@ func (client EventHubsClient) Delete(ctx context.Context, resourceGroupName stri Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("eventhub.EventHubsClient", "Delete", err.Error()) } @@ -312,7 +312,7 @@ func (client EventHubsClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,7 +367,7 @@ func (client EventHubsClient) DeleteAuthorizationRule(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -405,7 +405,7 @@ func (client EventHubsClient) DeleteAuthorizationRulePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -459,7 +459,7 @@ func (client EventHubsClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("eventhub.EventHubsClient", "Get", err.Error()) } @@ -494,7 +494,7 @@ func (client EventHubsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -550,7 +550,7 @@ func (client EventHubsClient) GetAuthorizationRule(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -588,7 +588,7 @@ func (client EventHubsClient) GetAuthorizationRulePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -643,7 +643,7 @@ func (client EventHubsClient) ListAuthorizationRules(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("eventhub.EventHubsClient", "ListAuthorizationRules", err.Error()) } @@ -682,7 +682,7 @@ func (client EventHubsClient) ListAuthorizationRulesPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -822,7 +822,7 @@ func (client EventHubsClient) ListByNamespacePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -921,7 +921,7 @@ func (client EventHubsClient) ListKeys(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -959,7 +959,7 @@ func (client EventHubsClient) ListKeysPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1016,7 +1016,7 @@ func (client EventHubsClient) RegenerateKeys(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, - Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -1054,7 +1054,7 @@ func (client EventHubsClient) RegenerateKeysPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go index 85465e1f7dca..f9c5b327dbc8 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go @@ -141,7 +141,8 @@ func (adrlr ArmDisasterRecoveryListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ArmDisasterRecoveryListResultIterator provides access to a complete listing of ArmDisasterRecovery values. +// ArmDisasterRecoveryListResultIterator provides access to a complete listing of ArmDisasterRecovery +// values. type ArmDisasterRecoveryListResultIterator struct { i int page ArmDisasterRecoveryListResultPage @@ -284,14 +285,17 @@ func (page ArmDisasterRecoveryListResultPage) Values() []ArmDisasterRecovery { } // Creates a new instance of the ArmDisasterRecoveryListResultPage type. -func NewArmDisasterRecoveryListResultPage(getNextPage func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error)) ArmDisasterRecoveryListResultPage { - return ArmDisasterRecoveryListResultPage{fn: getNextPage} +func NewArmDisasterRecoveryListResultPage(cur ArmDisasterRecoveryListResult, getNextPage func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error)) ArmDisasterRecoveryListResultPage { + return ArmDisasterRecoveryListResultPage{ + fn: getNextPage, + adrlr: cur, + } } // ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery // configurations) type ArmDisasterRecoveryProperties struct { - // ProvisioningState - READ-ONLY; Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' + // ProvisioningState - READ-ONLY; Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'ProvisioningStateDRAccepted', 'ProvisioningStateDRSucceeded', 'ProvisioningStateDRFailed' ProvisioningState ProvisioningStateDR `json:"provisioningState,omitempty"` // PartnerNamespace - ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing PartnerNamespace *string `json:"partnerNamespace,omitempty"` @@ -540,8 +544,11 @@ func (page AuthorizationRuleListResultPage) Values() []AuthorizationRule { } // Creates a new instance of the AuthorizationRuleListResultPage type. -func NewAuthorizationRuleListResultPage(getNextPage func(context.Context, AuthorizationRuleListResult) (AuthorizationRuleListResult, error)) AuthorizationRuleListResultPage { - return AuthorizationRuleListResultPage{fn: getNextPage} +func NewAuthorizationRuleListResultPage(cur AuthorizationRuleListResult, getNextPage func(context.Context, AuthorizationRuleListResult) (AuthorizationRuleListResult, error)) AuthorizationRuleListResultPage { + return AuthorizationRuleListResultPage{ + fn: getNextPage, + arlr: cur, + } } // AuthorizationRuleProperties properties supplied to create or update AuthorizationRule @@ -875,8 +882,11 @@ func (page ClusterListResultPage) Values() []Cluster { } // Creates a new instance of the ClusterListResultPage type. -func NewClusterListResultPage(getNextPage func(context.Context, ClusterListResult) (ClusterListResult, error)) ClusterListResultPage { - return ClusterListResultPage{fn: getNextPage} +func NewClusterListResultPage(cur ClusterListResult, getNextPage func(context.Context, ClusterListResult) (ClusterListResult, error)) ClusterListResultPage { + return ClusterListResultPage{ + fn: getNextPage, + clr: cur, + } } // ClusterProperties event Hubs Cluster properties supplied in responses in List or Get operations. @@ -936,7 +946,8 @@ func (future *ClustersCreateOrUpdateFuture) Result(client ClustersClient) (c Clu return } -// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ClustersDeleteFuture struct { azure.Future } @@ -966,7 +977,8 @@ type ClusterSku struct { Capacity *int32 `json:"capacity,omitempty"` } -// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ClustersUpdateFuture struct { azure.Future } @@ -994,6 +1006,14 @@ func (future *ClustersUpdateFuture) Result(client ClustersClient) (c Cluster, er return } +// ConnectionState connectionState information. +type ConnectionState struct { + // Status - Status of the connection. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateLinkConnectionStatus `json:"status,omitempty"` + // Description - Description of the connection state. + Description *string `json:"description,omitempty"` +} + // ConsumerGroup single item in List or Get Consumer group operation type ConsumerGroup struct { autorest.Response `json:"-"` @@ -1219,8 +1239,11 @@ func (page ConsumerGroupListResultPage) Values() []ConsumerGroup { } // Creates a new instance of the ConsumerGroupListResultPage type. -func NewConsumerGroupListResultPage(getNextPage func(context.Context, ConsumerGroupListResult) (ConsumerGroupListResult, error)) ConsumerGroupListResultPage { - return ConsumerGroupListResultPage{fn: getNextPage} +func NewConsumerGroupListResultPage(cur ConsumerGroupListResult, getNextPage func(context.Context, ConsumerGroupListResult) (ConsumerGroupListResult, error)) ConsumerGroupListResultPage { + return ConsumerGroupListResultPage{ + fn: getNextPage, + cglr: cur, + } } // ConsumerGroupProperties single item in List or Get Consumer group operation @@ -1295,8 +1318,8 @@ func (d *Destination) UnmarshalJSON(body []byte) error { return nil } -// DestinationProperties properties describing the storage account, blob container and archive name format for -// capture destination +// DestinationProperties properties describing the storage account, blob container and archive name format +// for capture destination type DestinationProperties struct { // StorageAccountResourceID - Resource id of the storage account to be used to create the blobs StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` @@ -1600,8 +1623,11 @@ func (page EHNamespaceListResultPage) Values() []EHNamespace { } // Creates a new instance of the EHNamespaceListResultPage type. -func NewEHNamespaceListResultPage(getNextPage func(context.Context, EHNamespaceListResult) (EHNamespaceListResult, error)) EHNamespaceListResultPage { - return EHNamespaceListResultPage{fn: getNextPage} +func NewEHNamespaceListResultPage(cur EHNamespaceListResult, getNextPage func(context.Context, EHNamespaceListResult) (EHNamespaceListResult, error)) EHNamespaceListResultPage { + return EHNamespaceListResultPage{ + fn: getNextPage, + enlr: cur, + } } // EHNamespaceProperties namespace properties supplied for create namespace operation. @@ -1662,8 +1688,8 @@ type Encryption struct { KeySource KeySource `json:"keySource,omitempty"` } -// ErrorResponse error response indicates Event Hub service is not able to process the incoming request. The -// reason is provided in the error message. +// ErrorResponse error response indicates Event Hub service is not able to process the incoming request. +// The reason is provided in the error message. type ErrorResponse struct { // Code - Error code. Code *string `json:"code,omitempty"` @@ -1906,8 +1932,11 @@ func (page IPFilterRuleListResultPage) Values() []IPFilterRule { } // Creates a new instance of the IPFilterRuleListResultPage type. -func NewIPFilterRuleListResultPage(getNextPage func(context.Context, IPFilterRuleListResult) (IPFilterRuleListResult, error)) IPFilterRuleListResultPage { - return IPFilterRuleListResultPage{fn: getNextPage} +func NewIPFilterRuleListResultPage(cur IPFilterRuleListResult, getNextPage func(context.Context, IPFilterRuleListResult) (IPFilterRuleListResult, error)) IPFilterRuleListResultPage { + return IPFilterRuleListResultPage{ + fn: getNextPage, + ifrlr: cur, + } } // IPFilterRuleProperties properties supplied to create or update IpFilterRules @@ -2082,8 +2111,11 @@ func (page ListResultPage) Values() []Model { } // Creates a new instance of the ListResultPage type. -func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { - return ListResultPage{fn: getNextPage} +func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{ + fn: getNextPage, + lr: cur, + } } // MessagingRegions messaging Region @@ -2278,8 +2310,11 @@ func (page MessagingRegionsListResultPage) Values() []MessagingRegions { } // Creates a new instance of the MessagingRegionsListResultPage type. -func NewMessagingRegionsListResultPage(getNextPage func(context.Context, MessagingRegionsListResult) (MessagingRegionsListResult, error)) MessagingRegionsListResultPage { - return MessagingRegionsListResultPage{fn: getNextPage} +func NewMessagingRegionsListResultPage(cur MessagingRegionsListResult, getNextPage func(context.Context, MessagingRegionsListResult) (MessagingRegionsListResult, error)) MessagingRegionsListResultPage { + return MessagingRegionsListResultPage{ + fn: getNextPage, + mrlr: cur, + } } // MessagingRegionsProperties properties of Messaging Region @@ -2363,8 +2398,8 @@ func (mVar *Model) UnmarshalJSON(body []byte) error { return nil } -// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type NamespacesCreateOrUpdateFuture struct { azure.Future } @@ -2392,7 +2427,8 @@ func (future *NamespacesCreateOrUpdateFuture) Result(client NamespacesClient) (e return } -// NamespacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// NamespacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type NamespacesDeleteFuture struct { azure.Future } @@ -2489,6 +2525,8 @@ func (nrs *NetworkRuleSet) UnmarshalJSON(body []byte) error { // NetworkRuleSetProperties networkRuleSet properties type NetworkRuleSetProperties struct { + // TrustedServiceAccessEnabled - Value that indicates whether Trusted Service Access is Enabled or not. + TrustedServiceAccessEnabled *bool `json:"trustedServiceAccessEnabled,omitempty"` // DefaultAction - Default Action for Network Rule Set. Possible values include: 'Allow', 'Deny' DefaultAction DefaultAction `json:"defaultAction,omitempty"` // VirtualNetworkRules - List VirtualNetwork Rules @@ -2540,8 +2578,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationListResult result of the request to list Event Hub operations. It contains a list of operations and -// a URL link to get the next set of results. +// OperationListResult result of the request to list Event Hub operations. It contains a list of operations +// and a URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; List of Event Hub operations supported by the Microsoft.EventHub resource provider. @@ -2693,8 +2731,383 @@ func (page OperationListResultPage) Values() []Operation { } // Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{fn: getNextPage} +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// PrivateEndpoint privateEndpoint information. +type PrivateEndpoint struct { + // ID - The ARM identifier for Private Endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection properties of the PrivateEndpointConnection. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnection. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) 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 privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult result of the list of all private endpoint connections operation. +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - A collection of private endpoint connection resources. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - A link for the next page of private endpoint connection resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionListResultIterator provides access to a complete listing of +// PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultIterator struct { + i int + page PrivateEndpointConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateEndpointConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { + if !iter.page.NotDone() { + return PrivateEndpointConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. +func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { + return PrivateEndpointConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { + return peclr.Value == nil || len(*peclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { + return peclr.NextLink != nil && len(*peclr.NextLink) != 0 +} + +// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !peclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peclr.NextLink))) +} + +// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultPage struct { + fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) + peclr PrivateEndpointConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.peclr) + if err != nil { + return err + } + page.peclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionListResultPage) NotDone() bool { + return !page.peclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { + return page.peclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { + if page.peclr.IsEmpty() { + return nil + } + return *page.peclr.Value +} + +// Creates a new instance of the PrivateEndpointConnectionListResultPage type. +func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { + return PrivateEndpointConnectionListResultPage{ + fn: getNextPage, + peclr: cur, + } +} + +// PrivateEndpointConnectionProperties properties of the private endpoint connection resource. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The Private Endpoint resource for this Connection. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Details about the state of the connection. + PrivateLinkServiceConnectionState *ConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - Provisioning state of the Private Endpoint Connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + ProvisioningState EndPointProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("eventhub.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource information of the private link resource. +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Properties of the private link resource. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - Fully qualified identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - Name of the resource + Name *string `json:"name,omitempty"` + // Type - Type of the resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + if plr.ID != nil { + objectMap["id"] = plr.ID + } + if plr.Name != nil { + objectMap["name"] = plr.Name + } + if plr.Type != nil { + objectMap["type"] = plr.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) 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 privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceProperties properties of PrivateLinkResource +type PrivateLinkResourceProperties struct { + // GroupID - The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource Private link DNS zone name. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// PrivateLinkResourcesListResult result of the List private link resources operation. +type PrivateLinkResourcesListResult struct { + autorest.Response `json:"-"` + // Value - A collection of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - A link for the next page of private link resources. + NextLink *string `json:"nextLink,omitempty"` } // Properties properties supplied to the Create Or Update Event Hub operation. @@ -2709,7 +3122,7 @@ type Properties struct { MessageRetentionInDays *int64 `json:"messageRetentionInDays,omitempty"` // PartitionCount - Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. PartitionCount *int64 `json:"partitionCount,omitempty"` - // Status - Enumerates the possible values for the status of the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' + // Status - Enumerates the possible values for the status of the Event Hub. Possible values include: 'EntityStatusActive', 'EntityStatusDisabled', 'EntityStatusRestoring', 'EntityStatusSendDisabled', 'EntityStatusReceiveDisabled', 'EntityStatusCreating', 'EntityStatusDeleting', 'EntityStatusRenaming', 'EntityStatusUnknown' Status EntityStatus `json:"status,omitempty"` // CaptureDescription - Properties of capture description CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` @@ -2733,8 +3146,8 @@ func (p Properties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, specifies -// which key needs to be reset. +// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, +// specifies which key needs to be reset. type RegenerateAccessKeyParameters struct { // KeyType - The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' KeyType KeyType `json:"keyType,omitempty"` @@ -3019,8 +3432,11 @@ func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { } // Creates a new instance of the VirtualNetworkRuleListResultPage type. -func NewVirtualNetworkRuleListResultPage(getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { - return VirtualNetworkRuleListResultPage{fn: getNextPage} +func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage { + return VirtualNetworkRuleListResultPage{ + fn: getNextPage, + vnrlr: cur, + } } // VirtualNetworkRuleProperties properties supplied to create or update VirtualNetworkRules diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go index af695a39b4db..6ca889fd2dac 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/namespaces.go @@ -89,7 +89,7 @@ func (client NamespacesClient) CheckNameAvailabilityPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,7 +286,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -733,7 +733,7 @@ func (client NamespacesClient) DeleteAuthorizationRulePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1082,7 +1082,7 @@ func (client NamespacesClient) GetAuthorizationRulePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1545,7 +1545,7 @@ func (client NamespacesClient) ListAuthorizationRulesPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1918,7 +1918,7 @@ func (client NamespacesClient) ListKeysPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2134,7 +2134,7 @@ func (client NamespacesClient) RegenerateKeysPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go index 465600c1563f..d4688dd07326 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/operations.go @@ -80,7 +80,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privateendpointconnections.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privateendpointconnections.go new file mode 100644 index 000000000000..961c325faac3 --- /dev/null +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privateendpointconnections.go @@ -0,0 +1,433 @@ +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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the client for the PrivateEndpointConnections methods of the Eventhub service. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates PrivateEndpointConnections of service namespace. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +// privateEndpointConnectionName - the PrivateEndpointConnection name +// parameters - parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing namespace. This operation also removes all associated resources under the namespace. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +// privateEndpointConnectionName - the PrivateEndpointConnection name +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-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.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a description for the specified Private Endpoint Connection name. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +// privateEndpointConnectionName - the PrivateEndpointConnection name +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "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.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-01-01-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.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the available PrivateEndpointConnections within a namespace. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, namespaceName string) (result PrivateEndpointConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.peclr.Response.Response != nil { + sc = result.peclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.peclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.peclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + } + if result.peclr.hasNextLink() && result.peclr.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(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 = "2018-01-01-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.EventHub/namespaces/{namespaceName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client PrivateEndpointConnectionsClient) listNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { + req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateEndpointConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, namespaceName string) (result PrivateEndpointConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, namespaceName) + return +} diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privatelinkresources.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privatelinkresources.go new file mode 100644 index 000000000000..cf95cfb0c611 --- /dev/null +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/privatelinkresources.go @@ -0,0 +1,129 @@ +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" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the client for the PrivateLinkResources methods of the Eventhub service. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets lists of resources that supports Privatelinks. +// Parameters: +// resourceGroupName - name of the resource group within the azure subscription. +// namespaceName - the Namespace name +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result PrivateLinkResourcesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + 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.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateLinkResourcesClient", "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.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) 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 = "2018-01-01-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.EventHub/namespaces/{namespaceName}/privateLinkResources", 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 PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResourcesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/regions.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/regions.go index acde9507053e..3c9272238fbb 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/regions.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/regions.go @@ -95,7 +95,7 @@ func (client RegionsClient) ListBySkuPreparer(ctx context.Context, sku string) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-04-01" + const APIVersion = "2018-01-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, }