From 1418dff5c3407b2240ba996bc7b36ee7f253de27 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 31 Aug 2018 21:03:27 -0700 Subject: [PATCH 1/3] Generated from d5c27e873505fb8804609201b23950ab97fe922d (#2599) increment python sdk version for the swagger --- .../mgmt/2018-07-12/botservices/bots.go | 2 +- services/web/mgmt/2016-09-01/web/apps.go | 56 +++++++++---------- services/web/mgmt/2018-02-01/web/apps.go | 56 +++++++++---------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/services/preview/botservice/mgmt/2018-07-12/botservices/bots.go b/services/preview/botservice/mgmt/2018-07-12/botservices/bots.go index e1b15cc2b9ac..fb183bba0bbf 100644 --- a/services/preview/botservice/mgmt/2018-07-12/botservices/bots.go +++ b/services/preview/botservice/mgmt/2018-07-12/botservices/bots.go @@ -319,7 +319,7 @@ func (client BotsClient) GetCheckNameAvailabilityPreparer(ctx context.Context, p preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.BotService/checkNameAvailability"), autorest.WithJSON(parameters), diff --git a/services/web/mgmt/2016-09-01/web/apps.go b/services/web/mgmt/2016-09-01/web/apps.go index 4db43838e3cd..764d2fe35fcf 100644 --- a/services/web/mgmt/2016-09-01/web/apps.go +++ b/services/web/mgmt/2016-09-01/web/apps.go @@ -1686,9 +1686,9 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Con func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -1769,10 +1769,10 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -3831,9 +3831,9 @@ func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, re func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -3909,10 +3909,10 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -7582,9 +7582,9 @@ func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resou func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -7661,10 +7661,10 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, r func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -24930,9 +24930,9 @@ func (client AppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, re func (client AppsClient) UpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" @@ -25013,10 +25013,10 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlot(ctx context.Context func (client AppsClient) UpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2016-08-01" diff --git a/services/web/mgmt/2018-02-01/web/apps.go b/services/web/mgmt/2018-02-01/web/apps.go index 0198b26e5015..57814473f21d 100644 --- a/services/web/mgmt/2018-02-01/web/apps.go +++ b/services/web/mgmt/2018-02-01/web/apps.go @@ -1692,9 +1692,9 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Con func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -1775,10 +1775,10 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -3984,9 +3984,9 @@ func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, re func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -4062,10 +4062,10 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -8034,9 +8034,9 @@ func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resou func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -8113,10 +8113,10 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, r func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -26032,9 +26032,9 @@ func (client AppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, re func (client AppsClient) UpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" @@ -26115,10 +26115,10 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlot(ctx context.Context func (client AppsClient) UpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { pathParameters := map[string]interface{}{ "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "slot": autorest.Encode("path", slot), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2018-02-01" From b9bef17b9f904612f9380a4bd468c7cd42f00e69 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 5 Sep 2018 09:40:01 -0700 Subject: [PATCH 2/3] [AutoPR botservice/resource-manager] Add Bot Framework Enterprise Channel resources. (#2390) * Generated from f6a25fcaa24e7655a3516817b1b348282cc79a12 Add Bot Framework Enterprise Channel resources. * Generated from 43451db3e06fbd878fded096af4118d3647eed78 Use full name for check availability method. * Generated from 0d331dc807d3391a2786e3597c00014fb9359c5c Change node id to be readonly. * Generated from 242277f723ec49847ee1666f113056dee3f117e6 Merge branch 'bfec' of https://github.com/NickEricson/azure-rest-api-specs into bfec * Generated from e4a6e8546af950eee5b39c834a8e5657be2ee56c Make state an Enum. * Generated from 7ade32d7a13a019af2788298337810e27c96df3e Update py package-version to 0.3.0 --- .../botservice/mgmt/botservices/models.go | 54 ++ .../botservices/enterprisechannels.go | 540 ++++++++++++++++++ .../mgmt/2018-07-12/botservices/models.go | 341 +++++++++++ 3 files changed, 935 insertions(+) create mode 100644 services/preview/botservice/mgmt/2018-07-12/botservices/enterprisechannels.go diff --git a/profiles/preview/preview/botservice/mgmt/botservices/models.go b/profiles/preview/preview/botservice/mgmt/botservices/models.go index fb8a95b0ce87..622b8d68b551 100644 --- a/profiles/preview/preview/botservice/mgmt/botservices/models.go +++ b/profiles/preview/preview/botservice/mgmt/botservices/models.go @@ -30,6 +30,7 @@ const ( ) type BaseClient = original.BaseClient +type EnterpriseChannelsClient = original.EnterpriseChannelsClient type ChannelName = original.ChannelName const ( @@ -61,6 +62,36 @@ const ( ChannelNameWebChatChannel1 ChannelNameBasicChannel = original.ChannelNameWebChatChannel1 ) +type EnterpriseChannelNodeState = original.EnterpriseChannelNodeState + +const ( + CreateFailed EnterpriseChannelNodeState = original.CreateFailed + Creating EnterpriseChannelNodeState = original.Creating + DeleteFailed EnterpriseChannelNodeState = original.DeleteFailed + Deleting EnterpriseChannelNodeState = original.Deleting + Started EnterpriseChannelNodeState = original.Started + StartFailed EnterpriseChannelNodeState = original.StartFailed + Starting EnterpriseChannelNodeState = original.Starting + StopFailed EnterpriseChannelNodeState = original.StopFailed + Stopped EnterpriseChannelNodeState = original.Stopped + Stopping EnterpriseChannelNodeState = original.Stopping +) + +type EnterpriseChannelState = original.EnterpriseChannelState + +const ( + EnterpriseChannelStateCreateFailed EnterpriseChannelState = original.EnterpriseChannelStateCreateFailed + EnterpriseChannelStateCreating EnterpriseChannelState = original.EnterpriseChannelStateCreating + EnterpriseChannelStateDeleteFailed EnterpriseChannelState = original.EnterpriseChannelStateDeleteFailed + EnterpriseChannelStateDeleting EnterpriseChannelState = original.EnterpriseChannelStateDeleting + EnterpriseChannelStateStarted EnterpriseChannelState = original.EnterpriseChannelStateStarted + EnterpriseChannelStateStartFailed EnterpriseChannelState = original.EnterpriseChannelStateStartFailed + EnterpriseChannelStateStarting EnterpriseChannelState = original.EnterpriseChannelStateStarting + EnterpriseChannelStateStopFailed EnterpriseChannelState = original.EnterpriseChannelStateStopFailed + EnterpriseChannelStateStopped EnterpriseChannelState = original.EnterpriseChannelStateStopped + EnterpriseChannelStateStopping EnterpriseChannelState = original.EnterpriseChannelStateStopping +) + type Kind = original.Kind const ( @@ -109,6 +140,17 @@ type DirectLineChannelProperties = original.DirectLineChannelProperties type DirectLineSite = original.DirectLineSite type EmailChannel = original.EmailChannel type EmailChannelProperties = original.EmailChannelProperties +type EnterpriseChannel = original.EnterpriseChannel +type EnterpriseChannelCheckNameAvailabilityRequest = original.EnterpriseChannelCheckNameAvailabilityRequest +type EnterpriseChannelCheckNameAvailabilityResponse = original.EnterpriseChannelCheckNameAvailabilityResponse +type EnterpriseChannelNode = original.EnterpriseChannelNode +type EnterpriseChannelProperties = original.EnterpriseChannelProperties +type EnterpriseChannelResponseList = original.EnterpriseChannelResponseList +type EnterpriseChannelResponseListIterator = original.EnterpriseChannelResponseListIterator +type EnterpriseChannelResponseListPage = original.EnterpriseChannelResponseListPage +type EnterpriseChannelsCreateFuture = original.EnterpriseChannelsCreateFuture +type EnterpriseChannelsDeleteFuture = original.EnterpriseChannelsDeleteFuture +type EnterpriseChannelsUpdateFuture = original.EnterpriseChannelsUpdateFuture type Error = original.Error type ErrorBody = original.ErrorBody type FacebookChannel = original.FacebookChannel @@ -166,12 +208,24 @@ func New(subscriptionID string) BaseClient { func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func NewEnterpriseChannelsClient(subscriptionID string) EnterpriseChannelsClient { + return original.NewEnterpriseChannelsClient(subscriptionID) +} +func NewEnterpriseChannelsClientWithBaseURI(baseURI string, subscriptionID string) EnterpriseChannelsClient { + return original.NewEnterpriseChannelsClientWithBaseURI(baseURI, subscriptionID) +} func PossibleChannelNameValues() []ChannelName { return original.PossibleChannelNameValues() } func PossibleChannelNameBasicChannelValues() []ChannelNameBasicChannel { return original.PossibleChannelNameBasicChannelValues() } +func PossibleEnterpriseChannelNodeStateValues() []EnterpriseChannelNodeState { + return original.PossibleEnterpriseChannelNodeStateValues() +} +func PossibleEnterpriseChannelStateValues() []EnterpriseChannelState { + return original.PossibleEnterpriseChannelStateValues() +} func PossibleKindValues() []Kind { return original.PossibleKindValues() } diff --git a/services/preview/botservice/mgmt/2018-07-12/botservices/enterprisechannels.go b/services/preview/botservice/mgmt/2018-07-12/botservices/enterprisechannels.go new file mode 100644 index 000000000000..2be7bcb9e07b --- /dev/null +++ b/services/preview/botservice/mgmt/2018-07-12/botservices/enterprisechannels.go @@ -0,0 +1,540 @@ +package botservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// EnterpriseChannelsClient is the azure Bot Service is a platform for creating smart conversational agents. +type EnterpriseChannelsClient struct { + BaseClient +} + +// NewEnterpriseChannelsClient creates an instance of the EnterpriseChannelsClient client. +func NewEnterpriseChannelsClient(subscriptionID string) EnterpriseChannelsClient { + return NewEnterpriseChannelsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEnterpriseChannelsClientWithBaseURI creates an instance of the EnterpriseChannelsClient client. +func NewEnterpriseChannelsClientWithBaseURI(baseURI string, subscriptionID string) EnterpriseChannelsClient { + return EnterpriseChannelsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability check whether an Enterprise Channel name is available. +// Parameters: +// parameters - the parameters to provide for the Enterprise Channel check name availability request. +func (client EnterpriseChannelsClient) CheckNameAvailability(ctx context.Context, parameters EnterpriseChannelCheckNameAvailabilityRequest) (result EnterpriseChannelCheckNameAvailabilityResponse, err error) { + req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client EnterpriseChannelsClient) CheckNameAvailabilityPreparer(ctx context.Context, parameters EnterpriseChannelCheckNameAvailabilityRequest) (*http.Request, error) { + const APIVersion = "2018-07-12" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.BotService/checkEnterpriseChannelNameAvailability"), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client EnterpriseChannelsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client EnterpriseChannelsClient) CheckNameAvailabilityResponder(resp *http.Response) (result EnterpriseChannelCheckNameAvailabilityResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create creates an Enterprise Channel. +// Parameters: +// resourceGroupName - the name of the Bot resource group in the user subscription. +// resourceName - the name of the Bot resource. +// parameters - the parameters to provide for the new Enterprise Channel. +func (client EnterpriseChannelsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, parameters EnterpriseChannel) (result EnterpriseChannelsCreateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.Nodes", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("botservice.EnterpriseChannelsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client EnterpriseChannelsClient) CreatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters EnterpriseChannel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-12" + 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.BotService/enterpriseChannels/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client EnterpriseChannelsClient) CreateSender(req *http.Request) (future EnterpriseChannelsCreateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client EnterpriseChannelsClient) CreateResponder(resp *http.Response) (result EnterpriseChannel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an Enterprise Channel from the resource group +// Parameters: +// resourceGroupName - the name of the Bot resource group in the user subscription. +// resourceName - the name of the Bot resource. +func (client EnterpriseChannelsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result EnterpriseChannelsDeleteFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("botservice.EnterpriseChannelsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client EnterpriseChannelsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-12" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}", 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 EnterpriseChannelsClient) DeleteSender(req *http.Request) (future EnterpriseChannelsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + 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 EnterpriseChannelsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns an Enterprise Channel specified by the parameters. +// Parameters: +// resourceGroupName - the name of the Bot resource group in the user subscription. +// resourceName - the name of the Bot resource. +func (client EnterpriseChannelsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result EnterpriseChannel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("botservice.EnterpriseChannelsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EnterpriseChannelsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-12" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}", 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 EnterpriseChannelsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client EnterpriseChannelsClient) GetResponder(resp *http.Response) (result EnterpriseChannel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup returns all the resources of a particular type belonging to a resource group. +// Parameters: +// resourceGroupName - the name of the Bot resource group in the user subscription. +func (client EnterpriseChannelsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result EnterpriseChannelResponseListPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("botservice.EnterpriseChannelsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ecrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ecrl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client EnterpriseChannelsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-12" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client EnterpriseChannelsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client EnterpriseChannelsClient) ListByResourceGroupResponder(resp *http.Response) (result EnterpriseChannelResponseList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client EnterpriseChannelsClient) listByResourceGroupNextResults(lastResults EnterpriseChannelResponseList) (result EnterpriseChannelResponseList, err error) { + req, err := lastResults.enterpriseChannelResponseListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client EnterpriseChannelsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result EnterpriseChannelResponseListIterator, err error) { + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates an Enterprise Channel. +// Parameters: +// resourceGroupName - the name of the Bot resource group in the user subscription. +// resourceName - the name of the Bot resource. +// parameters - the parameters to provide to update the Enterprise Channel. +func (client EnterpriseChannelsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters EnterpriseChannel) (result EnterpriseChannelsUpdateFuture, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("botservice.EnterpriseChannelsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client EnterpriseChannelsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters EnterpriseChannel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-12" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client EnterpriseChannelsClient) UpdateSender(req *http.Request) (future EnterpriseChannelsUpdateFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client EnterpriseChannelsClient) UpdateResponder(resp *http.Response) (result EnterpriseChannel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/botservice/mgmt/2018-07-12/botservices/models.go b/services/preview/botservice/mgmt/2018-07-12/botservices/models.go index 3829361135f5..02c39810106e 100644 --- a/services/preview/botservice/mgmt/2018-07-12/botservices/models.go +++ b/services/preview/botservice/mgmt/2018-07-12/botservices/models.go @@ -20,6 +20,7 @@ package botservice import ( "encoding/json" "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" "net/http" ) @@ -88,6 +89,68 @@ func PossibleChannelNameBasicChannelValues() []ChannelNameBasicChannel { return []ChannelNameBasicChannel{ChannelNameChannel, ChannelNameDirectLineChannel1, ChannelNameEmailChannel1, ChannelNameFacebookChannel1, ChannelNameKikChannel1, ChannelNameMsTeamsChannel1, ChannelNameSkypeChannel1, ChannelNameSlackChannel1, ChannelNameSmsChannel1, ChannelNameTelegramChannel1, ChannelNameWebChatChannel1} } +// EnterpriseChannelNodeState enumerates the values for enterprise channel node state. +type EnterpriseChannelNodeState string + +const ( + // CreateFailed ... + CreateFailed EnterpriseChannelNodeState = "CreateFailed" + // Creating ... + Creating EnterpriseChannelNodeState = "Creating" + // DeleteFailed ... + DeleteFailed EnterpriseChannelNodeState = "DeleteFailed" + // Deleting ... + Deleting EnterpriseChannelNodeState = "Deleting" + // Started ... + Started EnterpriseChannelNodeState = "Started" + // StartFailed ... + StartFailed EnterpriseChannelNodeState = "StartFailed" + // Starting ... + Starting EnterpriseChannelNodeState = "Starting" + // StopFailed ... + StopFailed EnterpriseChannelNodeState = "StopFailed" + // Stopped ... + Stopped EnterpriseChannelNodeState = "Stopped" + // Stopping ... + Stopping EnterpriseChannelNodeState = "Stopping" +) + +// PossibleEnterpriseChannelNodeStateValues returns an array of possible values for the EnterpriseChannelNodeState const type. +func PossibleEnterpriseChannelNodeStateValues() []EnterpriseChannelNodeState { + return []EnterpriseChannelNodeState{CreateFailed, Creating, DeleteFailed, Deleting, Started, StartFailed, Starting, StopFailed, Stopped, Stopping} +} + +// EnterpriseChannelState enumerates the values for enterprise channel state. +type EnterpriseChannelState string + +const ( + // EnterpriseChannelStateCreateFailed ... + EnterpriseChannelStateCreateFailed EnterpriseChannelState = "CreateFailed" + // EnterpriseChannelStateCreating ... + EnterpriseChannelStateCreating EnterpriseChannelState = "Creating" + // EnterpriseChannelStateDeleteFailed ... + EnterpriseChannelStateDeleteFailed EnterpriseChannelState = "DeleteFailed" + // EnterpriseChannelStateDeleting ... + EnterpriseChannelStateDeleting EnterpriseChannelState = "Deleting" + // EnterpriseChannelStateStarted ... + EnterpriseChannelStateStarted EnterpriseChannelState = "Started" + // EnterpriseChannelStateStartFailed ... + EnterpriseChannelStateStartFailed EnterpriseChannelState = "StartFailed" + // EnterpriseChannelStateStarting ... + EnterpriseChannelStateStarting EnterpriseChannelState = "Starting" + // EnterpriseChannelStateStopFailed ... + EnterpriseChannelStateStopFailed EnterpriseChannelState = "StopFailed" + // EnterpriseChannelStateStopped ... + EnterpriseChannelStateStopped EnterpriseChannelState = "Stopped" + // EnterpriseChannelStateStopping ... + EnterpriseChannelStateStopping EnterpriseChannelState = "Stopping" +) + +// PossibleEnterpriseChannelStateValues returns an array of possible values for the EnterpriseChannelState const type. +func PossibleEnterpriseChannelStateValues() []EnterpriseChannelState { + return []EnterpriseChannelState{EnterpriseChannelStateCreateFailed, EnterpriseChannelStateCreating, EnterpriseChannelStateDeleteFailed, EnterpriseChannelStateDeleting, EnterpriseChannelStateStarted, EnterpriseChannelStateStartFailed, EnterpriseChannelStateStarting, EnterpriseChannelStateStopFailed, EnterpriseChannelStateStopped, EnterpriseChannelStateStopping} +} + // Kind enumerates the values for kind. type Kind string @@ -1146,6 +1209,284 @@ type EmailChannelProperties struct { IsEnabled *bool `json:"isEnabled,omitempty"` } +// EnterpriseChannel enterprise Channel resource definition +type EnterpriseChannel struct { + autorest.Response `json:"-"` + // Properties - The set of properties specific to an Enterprise Channel resource. + Properties *EnterpriseChannelProperties `json:"properties,omitempty"` + // ID - Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Name - Specifies the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` + // Type - Specifies the type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags"` + // Sku - Gets or sets the SKU of the resource. + Sku *Sku `json:"sku,omitempty"` + // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction' + Kind Kind `json:"kind,omitempty"` + // Etag - Entity Tag + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnterpriseChannel. +func (ec EnterpriseChannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ec.Properties != nil { + objectMap["properties"] = ec.Properties + } + if ec.ID != nil { + objectMap["id"] = ec.ID + } + if ec.Name != nil { + objectMap["name"] = ec.Name + } + if ec.Location != nil { + objectMap["location"] = ec.Location + } + if ec.Type != nil { + objectMap["type"] = ec.Type + } + if ec.Tags != nil { + objectMap["tags"] = ec.Tags + } + if ec.Sku != nil { + objectMap["sku"] = ec.Sku + } + if ec.Kind != "" { + objectMap["kind"] = ec.Kind + } + if ec.Etag != nil { + objectMap["etag"] = ec.Etag + } + return json.Marshal(objectMap) +} + +// EnterpriseChannelCheckNameAvailabilityRequest a request to Bot Service Management to check availability of an +// Enterprise Channel name. +type EnterpriseChannelCheckNameAvailabilityRequest struct { + // Name - The name of the Enterprise Channel for which availability needs to be checked. + Name *string `json:"name,omitempty"` +} + +// EnterpriseChannelCheckNameAvailabilityResponse a request to Bot Service Management to check availability of an +// Enterprise Channel name. +type EnterpriseChannelCheckNameAvailabilityResponse struct { + autorest.Response `json:"-"` + // Valid - Indicates if the Enterprise Channel name is valid. + Valid *bool `json:"valid,omitempty"` + // Message - Additional information about why a bot name is not available. + Message *string `json:"message,omitempty"` +} + +// EnterpriseChannelNode the properties specific to an Enterprise Channel Node. +type EnterpriseChannelNode struct { + // ID - Id of Enterprise Channel Node. This is generated by the Bot Framework. + ID *string `json:"id,omitempty"` + // State - The current state of the Enterprise Channel Node. Possible values include: 'Creating', 'CreateFailed', 'Started', 'Starting', 'StartFailed', 'Stopped', 'Stopping', 'StopFailed', 'Deleting', 'DeleteFailed' + State EnterpriseChannelNodeState `json:"state,omitempty"` + // Name - The name of the Enterprise Channel Node. + Name *string `json:"name,omitempty"` + // AzureSku - The sku of the Enterprise Channel Node. + AzureSku *string `json:"azureSku,omitempty"` + // AzureLocation - The location of the Enterprise Channel Node. + AzureLocation *string `json:"azureLocation,omitempty"` +} + +// EnterpriseChannelProperties the parameters to provide for the Enterprise Channel. +type EnterpriseChannelProperties struct { + // State - The current state of the Enterprise Channel. Possible values include: 'EnterpriseChannelStateCreating', 'EnterpriseChannelStateCreateFailed', 'EnterpriseChannelStateStarted', 'EnterpriseChannelStateStarting', 'EnterpriseChannelStateStartFailed', 'EnterpriseChannelStateStopped', 'EnterpriseChannelStateStopping', 'EnterpriseChannelStateStopFailed', 'EnterpriseChannelStateDeleting', 'EnterpriseChannelStateDeleteFailed' + State EnterpriseChannelState `json:"state,omitempty"` + // Nodes - The nodes associated with the Enterprise Channel. + Nodes *[]EnterpriseChannelNode `json:"nodes,omitempty"` +} + +// EnterpriseChannelResponseList the list of bot service operation response. +type EnterpriseChannelResponseList struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of bot service resources. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of Enterprise Channels and their properties. + Value *[]EnterpriseChannel `json:"value,omitempty"` +} + +// EnterpriseChannelResponseListIterator provides access to a complete listing of EnterpriseChannel values. +type EnterpriseChannelResponseListIterator struct { + i int + page EnterpriseChannelResponseListPage +} + +// Next 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 *EnterpriseChannelResponseListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EnterpriseChannelResponseListIterator) 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 EnterpriseChannelResponseListIterator) Response() EnterpriseChannelResponseList { + 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 EnterpriseChannelResponseListIterator) Value() EnterpriseChannel { + if !iter.page.NotDone() { + return EnterpriseChannel{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (ecrl EnterpriseChannelResponseList) IsEmpty() bool { + return ecrl.Value == nil || len(*ecrl.Value) == 0 +} + +// enterpriseChannelResponseListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ecrl EnterpriseChannelResponseList) enterpriseChannelResponseListPreparer() (*http.Request, error) { + if ecrl.NextLink == nil || len(to.String(ecrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ecrl.NextLink))) +} + +// EnterpriseChannelResponseListPage contains a page of EnterpriseChannel values. +type EnterpriseChannelResponseListPage struct { + fn func(EnterpriseChannelResponseList) (EnterpriseChannelResponseList, error) + ecrl EnterpriseChannelResponseList +} + +// 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. +func (page *EnterpriseChannelResponseListPage) Next() error { + next, err := page.fn(page.ecrl) + if err != nil { + return err + } + page.ecrl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EnterpriseChannelResponseListPage) NotDone() bool { + return !page.ecrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EnterpriseChannelResponseListPage) Response() EnterpriseChannelResponseList { + return page.ecrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EnterpriseChannelResponseListPage) Values() []EnterpriseChannel { + if page.ecrl.IsEmpty() { + return nil + } + return *page.ecrl.Value +} + +// EnterpriseChannelsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EnterpriseChannelsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EnterpriseChannelsCreateFuture) Result(client EnterpriseChannelsClient) (ec EnterpriseChannel, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("botservice.EnterpriseChannelsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ec.Response.Response, err = future.GetResult(sender); err == nil && ec.Response.Response.StatusCode != http.StatusNoContent { + ec, err = client.CreateResponder(ec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsCreateFuture", "Result", ec.Response.Response, "Failure responding to request") + } + } + return +} + +// EnterpriseChannelsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EnterpriseChannelsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EnterpriseChannelsDeleteFuture) Result(client EnterpriseChannelsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("botservice.EnterpriseChannelsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// EnterpriseChannelsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EnterpriseChannelsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EnterpriseChannelsUpdateFuture) Result(client EnterpriseChannelsClient) (ec EnterpriseChannel, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("botservice.EnterpriseChannelsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ec.Response.Response, err = future.GetResult(sender); err == nil && ec.Response.Response.StatusCode != http.StatusNoContent { + ec, err = client.UpdateResponder(ec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "botservice.EnterpriseChannelsUpdateFuture", "Result", ec.Response.Response, "Failure responding to request") + } + } + return +} + // Error bot Service error object. type Error struct { // Error - The error body. From 1e81564f0a52de0da3efbc40a518bd858d147d00 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 6 Sep 2018 13:37:32 -0700 Subject: [PATCH 3/3] [AutoPR botservice/resource-manager] add security fields to directline channel site for botservice (#2625) * Generated from ce0ac2b44c1e5b31b498d43341f9c3f2e7b7c66a add security fields to directline channel site * Generated from 409e6ef7de40c5c43a3e0b2d41750b42208c7192 improve documentation for trusted origins field * Generated from d79326c7ea2061fb0a549e536f4bb5525877cc52 actually fix the description --- .../botservice/mgmt/2018-07-12/botservices/models.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/preview/botservice/mgmt/2018-07-12/botservices/models.go b/services/preview/botservice/mgmt/2018-07-12/botservices/models.go index 02c39810106e..a2652103d471 100644 --- a/services/preview/botservice/mgmt/2018-07-12/botservices/models.go +++ b/services/preview/botservice/mgmt/2018-07-12/botservices/models.go @@ -1110,12 +1110,16 @@ type DirectLineSite struct { Key *string `json:"key,omitempty"` // Key2 - Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. Key2 *string `json:"key2,omitempty"` - // IsEnabled - Whether this site is enabled for DirectLine channel + // IsEnabled - Whether this site is enabled for DirectLine channel. IsEnabled *bool `json:"isEnabled,omitempty"` - // IsV1Enabled - Whether this site is enabled for Bot Framework V1 protocol + // IsV1Enabled - Whether this site is enabled for Bot Framework V1 protocol. IsV1Enabled *bool `json:"isV1Enabled,omitempty"` - // IsV3Enabled - Whether this site is enabled for Bot Framework V1 protocol + // IsV3Enabled - Whether this site is enabled for Bot Framework V1 protocol. IsV3Enabled *bool `json:"isV3Enabled,omitempty"` + // IsSecureSiteEnabled - Whether this site is enabled for authentication with Bot Framework. + IsSecureSiteEnabled *bool `json:"isSecureSiteEnabled,omitempty"` + // TrustedOrigins - List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. + TrustedOrigins *[]string `json:"trustedOrigins,omitempty"` } // EmailChannel email channel definition