package botservice

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"encoding/json"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"github.com/Azure/go-autorest/autorest/date"
	"github.com/Azure/go-autorest/autorest/to"
	"github.com/Azure/go-autorest/tracing"
	"net/http"
)

// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice"

// AlexaChannel alexa channel definition
type AlexaChannel struct {
	// Properties - The set of properties specific to Alexa channel resource
	Properties *AlexaChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for AlexaChannel.
func (ac AlexaChannel) MarshalJSON() ([]byte, error) {
	ac.ChannelName = ChannelNameBasicChannelChannelNameAlexaChannel
	objectMap := make(map[string]interface{})
	if ac.Properties != nil {
		objectMap["properties"] = ac.Properties
	}
	if ac.ChannelName != "" {
		objectMap["channelName"] = ac.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return &ac, true
}

// AsFacebookChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for AlexaChannel.
func (ac AlexaChannel) AsBasicChannel() (BasicChannel, bool) {
	return &ac, true
}

// AlexaChannelProperties the parameters to provide for the Alexa channel.
type AlexaChannelProperties struct {
	// AlexaSkillID - The Alexa skill Id
	AlexaSkillID *string `json:"alexaSkillId,omitempty"`
	// URLFragment - READ-ONLY; Url fragment used in part of the Uri configured in Alexa
	URLFragment *string `json:"urlFragment,omitempty"`
	// ServiceEndpointURI - READ-ONLY; Full Uri used to configured the skill in Alexa
	ServiceEndpointURI *string `json:"serviceEndpointUri,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// MarshalJSON is the custom marshaler for AlexaChannelProperties.
func (acp AlexaChannelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if acp.AlexaSkillID != nil {
		objectMap["alexaSkillId"] = acp.AlexaSkillID
	}
	if acp.IsEnabled != nil {
		objectMap["isEnabled"] = acp.IsEnabled
	}
	return json.Marshal(objectMap)
}

// Bot bot resource definition
type Bot struct {
	autorest.Response `json:"-"`
	// Properties - The set of properties specific to bot resource
	Properties *BotProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Specifies the resource ID.
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Specifies the name of the resource.
	Name *string `json:"name,omitempty"`
	// Location - Specifies the location of the resource.
	Location *string `json:"location,omitempty"`
	// Type - READ-ONLY; 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', 'KindAzurebot'
	Kind Kind `json:"kind,omitempty"`
	// Etag - Entity Tag
	Etag *string `json:"etag,omitempty"`
}

// MarshalJSON is the custom marshaler for Bot.
func (b Bot) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if b.Properties != nil {
		objectMap["properties"] = b.Properties
	}
	if b.Location != nil {
		objectMap["location"] = b.Location
	}
	if b.Tags != nil {
		objectMap["tags"] = b.Tags
	}
	if b.Sku != nil {
		objectMap["sku"] = b.Sku
	}
	if b.Kind != "" {
		objectMap["kind"] = b.Kind
	}
	if b.Etag != nil {
		objectMap["etag"] = b.Etag
	}
	return json.Marshal(objectMap)
}

// BotChannel bot channel resource definition
type BotChannel struct {
	autorest.Response `json:"-"`
	// Properties - The set of properties specific to bot channel resource
	Properties BasicChannel `json:"properties,omitempty"`
	// ID - READ-ONLY; Specifies the resource ID.
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Specifies the name of the resource.
	Name *string `json:"name,omitempty"`
	// Location - Specifies the location of the resource.
	Location *string `json:"location,omitempty"`
	// Type - READ-ONLY; 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', 'KindAzurebot'
	Kind Kind `json:"kind,omitempty"`
	// Etag - Entity Tag
	Etag *string `json:"etag,omitempty"`
}

// MarshalJSON is the custom marshaler for BotChannel.
func (bc BotChannel) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["properties"] = bc.Properties
	if bc.Location != nil {
		objectMap["location"] = bc.Location
	}
	if bc.Tags != nil {
		objectMap["tags"] = bc.Tags
	}
	if bc.Sku != nil {
		objectMap["sku"] = bc.Sku
	}
	if bc.Kind != "" {
		objectMap["kind"] = bc.Kind
	}
	if bc.Etag != nil {
		objectMap["etag"] = bc.Etag
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON is the custom unmarshaler for BotChannel struct.
func (bc *BotChannel) 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 {
				properties, err := unmarshalBasicChannel(*v)
				if err != nil {
					return err
				}
				bc.Properties = properties
			}
		case "id":
			if v != nil {
				var ID string
				err = json.Unmarshal(*v, &ID)
				if err != nil {
					return err
				}
				bc.ID = &ID
			}
		case "name":
			if v != nil {
				var name string
				err = json.Unmarshal(*v, &name)
				if err != nil {
					return err
				}
				bc.Name = &name
			}
		case "location":
			if v != nil {
				var location string
				err = json.Unmarshal(*v, &location)
				if err != nil {
					return err
				}
				bc.Location = &location
			}
		case "type":
			if v != nil {
				var typeVar string
				err = json.Unmarshal(*v, &typeVar)
				if err != nil {
					return err
				}
				bc.Type = &typeVar
			}
		case "tags":
			if v != nil {
				var tags map[string]*string
				err = json.Unmarshal(*v, &tags)
				if err != nil {
					return err
				}
				bc.Tags = tags
			}
		case "sku":
			if v != nil {
				var sku Sku
				err = json.Unmarshal(*v, &sku)
				if err != nil {
					return err
				}
				bc.Sku = &sku
			}
		case "kind":
			if v != nil {
				var kind Kind
				err = json.Unmarshal(*v, &kind)
				if err != nil {
					return err
				}
				bc.Kind = kind
			}
		case "etag":
			if v != nil {
				var etag string
				err = json.Unmarshal(*v, &etag)
				if err != nil {
					return err
				}
				bc.Etag = &etag
			}
		}
	}

	return nil
}

// BotProperties the parameters to provide for the Bot.
type BotProperties struct {
	// DisplayName - The Name of the bot
	DisplayName *string `json:"displayName,omitempty"`
	// Description - The description of the bot
	Description *string `json:"description,omitempty"`
	// IconURL - The Icon Url of the bot
	IconURL *string `json:"iconUrl,omitempty"`
	// Endpoint - The bot's endpoint
	Endpoint *string `json:"endpoint,omitempty"`
	// EndpointVersion - READ-ONLY; The bot's endpoint version
	EndpointVersion *string `json:"endpointVersion,omitempty"`
	// MsaAppType - Microsoft App Type for the bot. Possible values include: 'MsaAppTypeUserAssignedMSI', 'MsaAppTypeSingleTenant', 'MsaAppTypeMultiTenant'
	MsaAppType MsaAppType `json:"msaAppType,omitempty"`
	// MsaAppID - Microsoft App Id for the bot
	MsaAppID *string `json:"msaAppId,omitempty"`
	// MsaAppTenantID - Microsoft App Tenant Id for the bot
	MsaAppTenantID *string `json:"msaAppTenantId,omitempty"`
	// MsaAppMSIResourceID - Microsoft App Managed Identity Resource Id for the bot
	MsaAppMSIResourceID *string `json:"msaAppMSIResourceId,omitempty"`
	// ConfiguredChannels - READ-ONLY; Collection of channels for which the bot is configured
	ConfiguredChannels *[]string `json:"configuredChannels,omitempty"`
	// EnabledChannels - READ-ONLY; Collection of channels for which the bot is enabled
	EnabledChannels *[]string `json:"enabledChannels,omitempty"`
	// DeveloperAppInsightKey - The Application Insights key
	DeveloperAppInsightKey *string `json:"developerAppInsightKey,omitempty"`
	// DeveloperAppInsightsAPIKey - The Application Insights Api Key
	DeveloperAppInsightsAPIKey *string `json:"developerAppInsightsApiKey,omitempty"`
	// DeveloperAppInsightsApplicationID - The Application Insights App Id
	DeveloperAppInsightsApplicationID *string `json:"developerAppInsightsApplicationId,omitempty"`
	// LuisAppIds - Collection of LUIS App Ids
	LuisAppIds *[]string `json:"luisAppIds,omitempty"`
	// LuisKey - The LUIS Key
	LuisKey *string `json:"luisKey,omitempty"`
	// IsCmekEnabled - Whether Cmek is enabled
	IsCmekEnabled *bool `json:"isCmekEnabled,omitempty"`
	// CmekKeyVaultURL - The CMK Url
	CmekKeyVaultURL *string `json:"cmekKeyVaultUrl,omitempty"`
	// IsIsolated - Whether the bot is in an isolated network
	IsIsolated *bool `json:"isIsolated,omitempty"`
	// DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
	// SchemaTransformationVersion - The channel schema transformation version for the bot
	SchemaTransformationVersion *string `json:"schemaTransformationVersion,omitempty"`
	// PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the bot
	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
	// OpenWithHint - The hint to browser (e.g. protocol handler) on how to open the bot for authoring
	OpenWithHint *string `json:"openWithHint,omitempty"`
	// AppPasswordHint - The hint (e.g. keyVault secret resourceId) on how to fetch the app secret
	AppPasswordHint *string `json:"appPasswordHint,omitempty"`
}

// MarshalJSON is the custom marshaler for BotProperties.
func (bp BotProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if bp.DisplayName != nil {
		objectMap["displayName"] = bp.DisplayName
	}
	if bp.Description != nil {
		objectMap["description"] = bp.Description
	}
	if bp.IconURL != nil {
		objectMap["iconUrl"] = bp.IconURL
	}
	if bp.Endpoint != nil {
		objectMap["endpoint"] = bp.Endpoint
	}
	if bp.MsaAppType != "" {
		objectMap["msaAppType"] = bp.MsaAppType
	}
	if bp.MsaAppID != nil {
		objectMap["msaAppId"] = bp.MsaAppID
	}
	if bp.MsaAppTenantID != nil {
		objectMap["msaAppTenantId"] = bp.MsaAppTenantID
	}
	if bp.MsaAppMSIResourceID != nil {
		objectMap["msaAppMSIResourceId"] = bp.MsaAppMSIResourceID
	}
	if bp.DeveloperAppInsightKey != nil {
		objectMap["developerAppInsightKey"] = bp.DeveloperAppInsightKey
	}
	if bp.DeveloperAppInsightsAPIKey != nil {
		objectMap["developerAppInsightsApiKey"] = bp.DeveloperAppInsightsAPIKey
	}
	if bp.DeveloperAppInsightsApplicationID != nil {
		objectMap["developerAppInsightsApplicationId"] = bp.DeveloperAppInsightsApplicationID
	}
	if bp.LuisAppIds != nil {
		objectMap["luisAppIds"] = bp.LuisAppIds
	}
	if bp.LuisKey != nil {
		objectMap["luisKey"] = bp.LuisKey
	}
	if bp.IsCmekEnabled != nil {
		objectMap["isCmekEnabled"] = bp.IsCmekEnabled
	}
	if bp.CmekKeyVaultURL != nil {
		objectMap["cmekKeyVaultUrl"] = bp.CmekKeyVaultURL
	}
	if bp.IsIsolated != nil {
		objectMap["isIsolated"] = bp.IsIsolated
	}
	if bp.DisableLocalAuth != nil {
		objectMap["disableLocalAuth"] = bp.DisableLocalAuth
	}
	if bp.SchemaTransformationVersion != nil {
		objectMap["schemaTransformationVersion"] = bp.SchemaTransformationVersion
	}
	if bp.OpenWithHint != nil {
		objectMap["openWithHint"] = bp.OpenWithHint
	}
	if bp.AppPasswordHint != nil {
		objectMap["appPasswordHint"] = bp.AppPasswordHint
	}
	return json.Marshal(objectMap)
}

// BotResponseList the list of  bot service operation response.
type BotResponseList struct {
	autorest.Response `json:"-"`
	// NextLink - The link used to get the next page of bot service resources.
	NextLink *string `json:"nextLink,omitempty"`
	// Value - READ-ONLY; Gets the list of bot service results and their properties.
	Value *[]Bot `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for BotResponseList.
func (brl BotResponseList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if brl.NextLink != nil {
		objectMap["nextLink"] = brl.NextLink
	}
	return json.Marshal(objectMap)
}

// BotResponseListIterator provides access to a complete listing of Bot values.
type BotResponseListIterator struct {
	i    int
	page BotResponseListPage
}

// 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 *BotResponseListIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/BotResponseListIterator.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 *BotResponseListIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter BotResponseListIterator) 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 BotResponseListIterator) Response() BotResponseList {
	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 BotResponseListIterator) Value() Bot {
	if !iter.page.NotDone() {
		return Bot{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the BotResponseListIterator type.
func NewBotResponseListIterator(page BotResponseListPage) BotResponseListIterator {
	return BotResponseListIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (brl BotResponseList) IsEmpty() bool {
	return brl.Value == nil || len(*brl.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (brl BotResponseList) hasNextLink() bool {
	return brl.NextLink != nil && len(*brl.NextLink) != 0
}

// botResponseListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (brl BotResponseList) botResponseListPreparer(ctx context.Context) (*http.Request, error) {
	if !brl.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(brl.NextLink)))
}

// BotResponseListPage contains a page of Bot values.
type BotResponseListPage struct {
	fn  func(context.Context, BotResponseList) (BotResponseList, error)
	brl BotResponseList
}

// 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 *BotResponseListPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/BotResponseListPage.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.brl)
		if err != nil {
			return err
		}
		page.brl = 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 *BotResponseListPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page BotResponseListPage) NotDone() bool {
	return !page.brl.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page BotResponseListPage) Response() BotResponseList {
	return page.brl
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page BotResponseListPage) Values() []Bot {
	if page.brl.IsEmpty() {
		return nil
	}
	return *page.brl.Value
}

// Creates a new instance of the BotResponseListPage type.
func NewBotResponseListPage(cur BotResponseList, getNextPage func(context.Context, BotResponseList) (BotResponseList, error)) BotResponseListPage {
	return BotResponseListPage{
		fn:  getNextPage,
		brl: cur,
	}
}

// BasicChannel channel definition
type BasicChannel interface {
	AsAlexaChannel() (*AlexaChannel, bool)
	AsFacebookChannel() (*FacebookChannel, bool)
	AsEmailChannel() (*EmailChannel, bool)
	AsMsTeamsChannel() (*MsTeamsChannel, bool)
	AsSkypeChannel() (*SkypeChannel, bool)
	AsKikChannel() (*KikChannel, bool)
	AsWebChatChannel() (*WebChatChannel, bool)
	AsDirectLineChannel() (*DirectLineChannel, bool)
	AsTelegramChannel() (*TelegramChannel, bool)
	AsSmsChannel() (*SmsChannel, bool)
	AsSlackChannel() (*SlackChannel, bool)
	AsLineChannel() (*LineChannel, bool)
	AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool)
	AsChannel() (*Channel, bool)
}

// Channel channel definition
type Channel struct {
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

func unmarshalBasicChannel(body []byte) (BasicChannel, error) {
	var m map[string]interface{}
	err := json.Unmarshal(body, &m)
	if err != nil {
		return nil, err
	}

	switch m["channelName"] {
	case string(ChannelNameBasicChannelChannelNameAlexaChannel):
		var ac AlexaChannel
		err := json.Unmarshal(body, &ac)
		return ac, err
	case string(ChannelNameBasicChannelChannelNameFacebookChannel):
		var fc FacebookChannel
		err := json.Unmarshal(body, &fc)
		return fc, err
	case string(ChannelNameBasicChannelChannelNameEmailChannel):
		var ec EmailChannel
		err := json.Unmarshal(body, &ec)
		return ec, err
	case string(ChannelNameBasicChannelChannelNameMsTeamsChannel):
		var mtc MsTeamsChannel
		err := json.Unmarshal(body, &mtc)
		return mtc, err
	case string(ChannelNameBasicChannelChannelNameSkypeChannel):
		var sc SkypeChannel
		err := json.Unmarshal(body, &sc)
		return sc, err
	case string(ChannelNameBasicChannelChannelNameKikChannel):
		var kc KikChannel
		err := json.Unmarshal(body, &kc)
		return kc, err
	case string(ChannelNameBasicChannelChannelNameWebChatChannel):
		var wcc WebChatChannel
		err := json.Unmarshal(body, &wcc)
		return wcc, err
	case string(ChannelNameBasicChannelChannelNameDirectLineChannel):
		var dlc DirectLineChannel
		err := json.Unmarshal(body, &dlc)
		return dlc, err
	case string(ChannelNameBasicChannelChannelNameTelegramChannel):
		var tc TelegramChannel
		err := json.Unmarshal(body, &tc)
		return tc, err
	case string(ChannelNameBasicChannelChannelNameSmsChannel):
		var sc SmsChannel
		err := json.Unmarshal(body, &sc)
		return sc, err
	case string(ChannelNameBasicChannelChannelNameSlackChannel):
		var sc SlackChannel
		err := json.Unmarshal(body, &sc)
		return sc, err
	case string(ChannelNameBasicChannelChannelNameLineChannel):
		var lc LineChannel
		err := json.Unmarshal(body, &lc)
		return lc, err
	case string(ChannelNameBasicChannelChannelNameDirectLineSpeechChannel):
		var dlsc DirectLineSpeechChannel
		err := json.Unmarshal(body, &dlsc)
		return dlsc, err
	default:
		var c Channel
		err := json.Unmarshal(body, &c)
		return c, err
	}
}
func unmarshalBasicChannelArray(body []byte) ([]BasicChannel, error) {
	var rawMessages []*json.RawMessage
	err := json.Unmarshal(body, &rawMessages)
	if err != nil {
		return nil, err
	}

	cArray := make([]BasicChannel, len(rawMessages))

	for index, rawMessage := range rawMessages {
		c, err := unmarshalBasicChannel(*rawMessage)
		if err != nil {
			return nil, err
		}
		cArray[index] = c
	}
	return cArray, nil
}

// MarshalJSON is the custom marshaler for Channel.
func (c Channel) MarshalJSON() ([]byte, error) {
	c.ChannelName = ChannelNameBasicChannelChannelNameChannel
	objectMap := make(map[string]interface{})
	if c.ChannelName != "" {
		objectMap["channelName"] = c.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for Channel.
func (c Channel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for Channel.
func (c Channel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for Channel.
func (c Channel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for Channel.
func (c Channel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for Channel.
func (c Channel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for Channel.
func (c Channel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for Channel.
func (c Channel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for Channel.
func (c Channel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for Channel.
func (c Channel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for Channel.
func (c Channel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for Channel.
func (c Channel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for Channel.
func (c Channel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for Channel.
func (c Channel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for Channel.
func (c Channel) AsChannel() (*Channel, bool) {
	return &c, true
}

// AsBasicChannel is the BasicChannel implementation for Channel.
func (c Channel) AsBasicChannel() (BasicChannel, bool) {
	return &c, true
}

// ChannelResponseList the list of bot service channel operation response.
type ChannelResponseList struct {
	autorest.Response `json:"-"`
	// NextLink - The link used to get the next page of bot service channel resources.
	NextLink *string `json:"nextLink,omitempty"`
	// Value - READ-ONLY; Gets the list of bot service channel results and their properties.
	Value *[]BotChannel `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for ChannelResponseList.
func (crl ChannelResponseList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if crl.NextLink != nil {
		objectMap["nextLink"] = crl.NextLink
	}
	return json.Marshal(objectMap)
}

// ChannelResponseListIterator provides access to a complete listing of BotChannel values.
type ChannelResponseListIterator struct {
	i    int
	page ChannelResponseListPage
}

// 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 *ChannelResponseListIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ChannelResponseListIterator.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 *ChannelResponseListIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ChannelResponseListIterator) 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 ChannelResponseListIterator) Response() ChannelResponseList {
	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 ChannelResponseListIterator) Value() BotChannel {
	if !iter.page.NotDone() {
		return BotChannel{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ChannelResponseListIterator type.
func NewChannelResponseListIterator(page ChannelResponseListPage) ChannelResponseListIterator {
	return ChannelResponseListIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (crl ChannelResponseList) IsEmpty() bool {
	return crl.Value == nil || len(*crl.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (crl ChannelResponseList) hasNextLink() bool {
	return crl.NextLink != nil && len(*crl.NextLink) != 0
}

// channelResponseListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (crl ChannelResponseList) channelResponseListPreparer(ctx context.Context) (*http.Request, error) {
	if !crl.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(crl.NextLink)))
}

// ChannelResponseListPage contains a page of BotChannel values.
type ChannelResponseListPage struct {
	fn  func(context.Context, ChannelResponseList) (ChannelResponseList, error)
	crl ChannelResponseList
}

// 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 *ChannelResponseListPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ChannelResponseListPage.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.crl)
		if err != nil {
			return err
		}
		page.crl = 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 *ChannelResponseListPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ChannelResponseListPage) NotDone() bool {
	return !page.crl.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ChannelResponseListPage) Response() ChannelResponseList {
	return page.crl
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ChannelResponseListPage) Values() []BotChannel {
	if page.crl.IsEmpty() {
		return nil
	}
	return *page.crl.Value
}

// Creates a new instance of the ChannelResponseListPage type.
func NewChannelResponseListPage(cur ChannelResponseList, getNextPage func(context.Context, ChannelResponseList) (ChannelResponseList, error)) ChannelResponseListPage {
	return ChannelResponseListPage{
		fn:  getNextPage,
		crl: cur,
	}
}

// CheckNameAvailabilityRequestBody the request body for a request to Bot Service Management to check
// availability of a bot name.
type CheckNameAvailabilityRequestBody struct {
	// Name - the name of the bot for which availability needs to be checked.
	Name *string `json:"name,omitempty"`
	// Type - the type of the bot for which availability needs to be checked
	Type *string `json:"type,omitempty"`
}

// CheckNameAvailabilityResponseBody the response body returned for a request to Bot Service Management to
// check availability of a bot name.
type CheckNameAvailabilityResponseBody struct {
	autorest.Response `json:"-"`
	// Valid - indicates if the bot name is valid.
	Valid *bool `json:"valid,omitempty"`
	// Message - additional message from the bot management api showing why a bot name is not available
	Message *string `json:"message,omitempty"`
}

// ConnectionItemName the display name of a connection Item Setting registered with the Bot
type ConnectionItemName struct {
	// Name - READ-ONLY; Connection Item name that has been added in the API
	Name *string `json:"name,omitempty"`
}

// MarshalJSON is the custom marshaler for ConnectionItemName.
func (cin ConnectionItemName) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ConnectionSetting bot channel resource definition
type ConnectionSetting struct {
	autorest.Response `json:"-"`
	// Properties - The set of properties specific to bot channel resource
	Properties *ConnectionSettingProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Specifies the resource ID.
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Specifies the name of the resource.
	Name *string `json:"name,omitempty"`
	// Location - Specifies the location of the resource.
	Location *string `json:"location,omitempty"`
	// Type - READ-ONLY; 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', 'KindAzurebot'
	Kind Kind `json:"kind,omitempty"`
	// Etag - Entity Tag
	Etag *string `json:"etag,omitempty"`
}

// MarshalJSON is the custom marshaler for ConnectionSetting.
func (cs ConnectionSetting) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if cs.Properties != nil {
		objectMap["properties"] = cs.Properties
	}
	if cs.Location != nil {
		objectMap["location"] = cs.Location
	}
	if cs.Tags != nil {
		objectMap["tags"] = cs.Tags
	}
	if cs.Sku != nil {
		objectMap["sku"] = cs.Sku
	}
	if cs.Kind != "" {
		objectMap["kind"] = cs.Kind
	}
	if cs.Etag != nil {
		objectMap["etag"] = cs.Etag
	}
	return json.Marshal(objectMap)
}

// ConnectionSettingParameter extra Parameter in a Connection Setting Properties to indicate service
// provider specific properties
type ConnectionSettingParameter struct {
	// Key - Key for the Connection Setting Parameter.
	Key *string `json:"key,omitempty"`
	// Value - Value associated with the Connection Setting Parameter.
	Value *string `json:"value,omitempty"`
}

// ConnectionSettingProperties properties for a Connection Setting Item
type ConnectionSettingProperties struct {
	// ClientID - Client Id associated with the Connection Setting.
	ClientID *string `json:"clientId,omitempty"`
	// SettingID - READ-ONLY; Setting Id set by the service for the Connection Setting.
	SettingID *string `json:"settingId,omitempty"`
	// ClientSecret - Client Secret associated with the Connection Setting
	ClientSecret *string `json:"clientSecret,omitempty"`
	// Scopes - Scopes associated with the Connection Setting
	Scopes *string `json:"scopes,omitempty"`
	// ServiceProviderID - Service Provider Id associated with the Connection Setting
	ServiceProviderID *string `json:"serviceProviderId,omitempty"`
	// ServiceProviderDisplayName - Service Provider Display Name associated with the Connection Setting
	ServiceProviderDisplayName *string `json:"serviceProviderDisplayName,omitempty"`
	// Parameters - Service Provider Parameters associated with the Connection Setting
	Parameters *[]ConnectionSettingParameter `json:"parameters,omitempty"`
}

// MarshalJSON is the custom marshaler for ConnectionSettingProperties.
func (csp ConnectionSettingProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if csp.ClientID != nil {
		objectMap["clientId"] = csp.ClientID
	}
	if csp.ClientSecret != nil {
		objectMap["clientSecret"] = csp.ClientSecret
	}
	if csp.Scopes != nil {
		objectMap["scopes"] = csp.Scopes
	}
	if csp.ServiceProviderID != nil {
		objectMap["serviceProviderId"] = csp.ServiceProviderID
	}
	if csp.ServiceProviderDisplayName != nil {
		objectMap["serviceProviderDisplayName"] = csp.ServiceProviderDisplayName
	}
	if csp.Parameters != nil {
		objectMap["parameters"] = csp.Parameters
	}
	return json.Marshal(objectMap)
}

// ConnectionSettingResponseList the list of bot service connection settings response.
type ConnectionSettingResponseList struct {
	autorest.Response `json:"-"`
	// NextLink - The link used to get the next page of bot service connection setting resources.
	NextLink *string `json:"nextLink,omitempty"`
	// Value - READ-ONLY; Gets the list of bot service connection settings and their properties.
	Value *[]ConnectionSetting `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for ConnectionSettingResponseList.
func (csrl ConnectionSettingResponseList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if csrl.NextLink != nil {
		objectMap["nextLink"] = csrl.NextLink
	}
	return json.Marshal(objectMap)
}

// ConnectionSettingResponseListIterator provides access to a complete listing of ConnectionSetting values.
type ConnectionSettingResponseListIterator struct {
	i    int
	page ConnectionSettingResponseListPage
}

// 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 *ConnectionSettingResponseListIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionSettingResponseListIterator.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 *ConnectionSettingResponseListIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ConnectionSettingResponseListIterator) 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 ConnectionSettingResponseListIterator) Response() ConnectionSettingResponseList {
	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 ConnectionSettingResponseListIterator) Value() ConnectionSetting {
	if !iter.page.NotDone() {
		return ConnectionSetting{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the ConnectionSettingResponseListIterator type.
func NewConnectionSettingResponseListIterator(page ConnectionSettingResponseListPage) ConnectionSettingResponseListIterator {
	return ConnectionSettingResponseListIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (csrl ConnectionSettingResponseList) IsEmpty() bool {
	return csrl.Value == nil || len(*csrl.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (csrl ConnectionSettingResponseList) hasNextLink() bool {
	return csrl.NextLink != nil && len(*csrl.NextLink) != 0
}

// connectionSettingResponseListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (csrl ConnectionSettingResponseList) connectionSettingResponseListPreparer(ctx context.Context) (*http.Request, error) {
	if !csrl.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(csrl.NextLink)))
}

// ConnectionSettingResponseListPage contains a page of ConnectionSetting values.
type ConnectionSettingResponseListPage struct {
	fn   func(context.Context, ConnectionSettingResponseList) (ConnectionSettingResponseList, error)
	csrl ConnectionSettingResponseList
}

// 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 *ConnectionSettingResponseListPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionSettingResponseListPage.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.csrl)
		if err != nil {
			return err
		}
		page.csrl = 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 *ConnectionSettingResponseListPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ConnectionSettingResponseListPage) NotDone() bool {
	return !page.csrl.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page ConnectionSettingResponseListPage) Response() ConnectionSettingResponseList {
	return page.csrl
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page ConnectionSettingResponseListPage) Values() []ConnectionSetting {
	if page.csrl.IsEmpty() {
		return nil
	}
	return *page.csrl.Value
}

// Creates a new instance of the ConnectionSettingResponseListPage type.
func NewConnectionSettingResponseListPage(cur ConnectionSettingResponseList, getNextPage func(context.Context, ConnectionSettingResponseList) (ConnectionSettingResponseList, error)) ConnectionSettingResponseListPage {
	return ConnectionSettingResponseListPage{
		fn:   getNextPage,
		csrl: cur,
	}
}

// DirectLineChannel direct Line channel definition
type DirectLineChannel struct {
	// Properties - The set of properties specific to Direct Line channel resource
	Properties *DirectLineChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for DirectLineChannel.
func (dlc DirectLineChannel) MarshalJSON() ([]byte, error) {
	dlc.ChannelName = ChannelNameBasicChannelChannelNameDirectLineChannel
	objectMap := make(map[string]interface{})
	if dlc.Properties != nil {
		objectMap["properties"] = dlc.Properties
	}
	if dlc.ChannelName != "" {
		objectMap["channelName"] = dlc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return &dlc, true
}

// AsTelegramChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for DirectLineChannel.
func (dlc DirectLineChannel) AsBasicChannel() (BasicChannel, bool) {
	return &dlc, true
}

// DirectLineChannelProperties the parameters to provide for the Direct Line channel.
type DirectLineChannelProperties struct {
	// Sites - The list of Direct Line sites
	Sites *[]DirectLineSite `json:"sites,omitempty"`
}

// DirectLineSite a site for the Direct Line channel
type DirectLineSite struct {
	// SiteID - READ-ONLY; Site Id
	SiteID *string `json:"siteId,omitempty"`
	// SiteName - Site name
	SiteName *string `json:"siteName,omitempty"`
	// Key - READ-ONLY; Primary key. Value only returned through POST to the action Channel List API, otherwise empty.
	Key *string `json:"key,omitempty"`
	// Key2 - READ-ONLY; 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 *bool `json:"isEnabled,omitempty"`
	// 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 *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"`
}

// MarshalJSON is the custom marshaler for DirectLineSite.
func (dls DirectLineSite) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if dls.SiteName != nil {
		objectMap["siteName"] = dls.SiteName
	}
	if dls.IsEnabled != nil {
		objectMap["isEnabled"] = dls.IsEnabled
	}
	if dls.IsV1Enabled != nil {
		objectMap["isV1Enabled"] = dls.IsV1Enabled
	}
	if dls.IsV3Enabled != nil {
		objectMap["isV3Enabled"] = dls.IsV3Enabled
	}
	if dls.IsSecureSiteEnabled != nil {
		objectMap["isSecureSiteEnabled"] = dls.IsSecureSiteEnabled
	}
	if dls.TrustedOrigins != nil {
		objectMap["trustedOrigins"] = dls.TrustedOrigins
	}
	return json.Marshal(objectMap)
}

// DirectLineSpeechChannel directLine Speech channel definition
type DirectLineSpeechChannel struct {
	// Properties - The set of properties specific to DirectLine Speech channel resource
	Properties *DirectLineSpeechChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) MarshalJSON() ([]byte, error) {
	dlsc.ChannelName = ChannelNameBasicChannelChannelNameDirectLineSpeechChannel
	objectMap := make(map[string]interface{})
	if dlsc.Properties != nil {
		objectMap["properties"] = dlsc.Properties
	}
	if dlsc.ChannelName != "" {
		objectMap["channelName"] = dlsc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return &dlsc, true
}

// AsChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for DirectLineSpeechChannel.
func (dlsc DirectLineSpeechChannel) AsBasicChannel() (BasicChannel, bool) {
	return &dlsc, true
}

// DirectLineSpeechChannelProperties the parameters to provide for the DirectLine Speech channel.
type DirectLineSpeechChannelProperties struct {
	// CognitiveServiceRegion - The cognitive service region with this channel registration.
	CognitiveServiceRegion *string `json:"cognitiveServiceRegion,omitempty"`
	// CognitiveServiceSubscriptionKey - The cognitive service subscription key to use with this channel registration.
	CognitiveServiceSubscriptionKey *string `json:"cognitiveServiceSubscriptionKey,omitempty"`
	// IsEnabled - Whether this channel is enabled or not.
	IsEnabled *bool `json:"isEnabled,omitempty"`
	// CustomVoiceDeploymentID - Custom speech model id (optional).
	CustomVoiceDeploymentID *string `json:"customVoiceDeploymentId,omitempty"`
	// CustomSpeechModelID - Custom voice deployment id (optional).
	CustomSpeechModelID *string `json:"customSpeechModelId,omitempty"`
	// IsDefaultBotForCogSvcAccount - Make this a default bot for chosen cognitive service account.
	IsDefaultBotForCogSvcAccount *bool `json:"isDefaultBotForCogSvcAccount,omitempty"`
}

// EmailChannel email channel definition
type EmailChannel struct {
	// Properties - The set of properties specific to email channel resource
	Properties *EmailChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for EmailChannel.
func (ec EmailChannel) MarshalJSON() ([]byte, error) {
	ec.ChannelName = ChannelNameBasicChannelChannelNameEmailChannel
	objectMap := make(map[string]interface{})
	if ec.Properties != nil {
		objectMap["properties"] = ec.Properties
	}
	if ec.ChannelName != "" {
		objectMap["channelName"] = ec.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsEmailChannel() (*EmailChannel, bool) {
	return &ec, true
}

// AsMsTeamsChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for EmailChannel.
func (ec EmailChannel) AsBasicChannel() (BasicChannel, bool) {
	return &ec, true
}

// EmailChannelProperties the parameters to provide for the Email channel.
type EmailChannelProperties struct {
	// EmailAddress - The email address
	EmailAddress *string `json:"emailAddress,omitempty"`
	// Password - The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty.
	Password *string `json:"password,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// Error bot Service error object.
type Error struct {
	// Error - The error body.
	Error *ErrorBody `json:"error,omitempty"`
}

// ErrorBody bot Service error body.
type ErrorBody struct {
	// Code - error code
	Code *string `json:"code,omitempty"`
	// Message - error message
	Message *string `json:"message,omitempty"`
}

// FacebookChannel facebook channel definition
type FacebookChannel struct {
	// Properties - The set of properties specific to bot facebook channel
	Properties *FacebookChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for FacebookChannel.
func (fc FacebookChannel) MarshalJSON() ([]byte, error) {
	fc.ChannelName = ChannelNameBasicChannelChannelNameFacebookChannel
	objectMap := make(map[string]interface{})
	if fc.Properties != nil {
		objectMap["properties"] = fc.Properties
	}
	if fc.ChannelName != "" {
		objectMap["channelName"] = fc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return &fc, true
}

// AsEmailChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for FacebookChannel.
func (fc FacebookChannel) AsBasicChannel() (BasicChannel, bool) {
	return &fc, true
}

// FacebookChannelProperties the parameters to provide for the Facebook channel.
type FacebookChannelProperties struct {
	// VerifyToken - READ-ONLY; Verify token. Value only returned through POST to the action Channel List API, otherwise empty.
	VerifyToken *string `json:"verifyToken,omitempty"`
	// Pages - The list of Facebook pages
	Pages *[]FacebookPage `json:"pages,omitempty"`
	// AppID - Facebook application id
	AppID *string `json:"appId,omitempty"`
	// AppSecret - Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty.
	AppSecret *string `json:"appSecret,omitempty"`
	// CallbackURL - READ-ONLY; Callback Url
	CallbackURL *string `json:"callbackUrl,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// MarshalJSON is the custom marshaler for FacebookChannelProperties.
func (fcp FacebookChannelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if fcp.Pages != nil {
		objectMap["pages"] = fcp.Pages
	}
	if fcp.AppID != nil {
		objectMap["appId"] = fcp.AppID
	}
	if fcp.AppSecret != nil {
		objectMap["appSecret"] = fcp.AppSecret
	}
	if fcp.IsEnabled != nil {
		objectMap["isEnabled"] = fcp.IsEnabled
	}
	return json.Marshal(objectMap)
}

// FacebookPage a Facebook page for Facebook channel registration
type FacebookPage struct {
	// ID - Page id
	ID *string `json:"id,omitempty"`
	// AccessToken - Facebook application access token. Value only returned through POST to the action Channel List API, otherwise empty.
	AccessToken *string `json:"accessToken,omitempty"`
}

// HostSettingsResponse the response body returned for a request to Bot Service Management to check per
// subscription hostSettings
type HostSettingsResponse struct {
	autorest.Response `json:"-"`
	// OAuthURL - For in-conversation bot user authentication
	OAuthURL *string `json:"OAuthUrl,omitempty"`
	// ToBotFromChannelOpenIDMetadataURL - For verifying incoming tokens from the channels
	ToBotFromChannelOpenIDMetadataURL *string `json:"ToBotFromChannelOpenIdMetadataUrl,omitempty"`
	// ToBotFromChannelTokenIssuer - For verifying incoming tokens from the channels
	ToBotFromChannelTokenIssuer *string `json:"ToBotFromChannelTokenIssuer,omitempty"`
	// ToBotFromEmulatorOpenIDMetadataURL - For verifying incoming tokens from bot emulator
	ToBotFromEmulatorOpenIDMetadataURL *string `json:"ToBotFromEmulatorOpenIdMetadataUrl,omitempty"`
	// ToChannelFromBotLoginURL - For getting access token to channels from bot host
	ToChannelFromBotLoginURL *string `json:"ToChannelFromBotLoginUrl,omitempty"`
	// ToChannelFromBotOAuthScope - For getting access token to channels from bot host
	ToChannelFromBotOAuthScope *string `json:"ToChannelFromBotOAuthScope,omitempty"`
	// ValidateAuthority - Per cloud OAuth setting on whether authority is validated
	ValidateAuthority *bool `json:"ValidateAuthority,omitempty"`
	// BotOpenIDMetadata - Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12
	BotOpenIDMetadata *string `json:"BotOpenIdMetadata,omitempty"`
}

// KikChannel kik channel definition
type KikChannel struct {
	// Properties - The set of properties specific to Kik channel resource
	Properties *KikChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for KikChannel.
func (kc KikChannel) MarshalJSON() ([]byte, error) {
	kc.ChannelName = ChannelNameBasicChannelChannelNameKikChannel
	objectMap := make(map[string]interface{})
	if kc.Properties != nil {
		objectMap["properties"] = kc.Properties
	}
	if kc.ChannelName != "" {
		objectMap["channelName"] = kc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsKikChannel() (*KikChannel, bool) {
	return &kc, true
}

// AsWebChatChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for KikChannel.
func (kc KikChannel) AsBasicChannel() (BasicChannel, bool) {
	return &kc, true
}

// KikChannelProperties the parameters to provide for the Kik channel.
type KikChannelProperties struct {
	// UserName - The Kik user name
	UserName *string `json:"userName,omitempty"`
	// APIKey - Kik API key. Value only returned through POST to the action Channel List API, otherwise empty.
	APIKey *string `json:"apiKey,omitempty"`
	// IsValidated - Whether this channel is validated for the bot
	IsValidated *bool `json:"isValidated,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// LineChannel line channel definition
type LineChannel struct {
	// Properties - The set of properties specific to line channel resource
	Properties *LineChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for LineChannel.
func (lc LineChannel) MarshalJSON() ([]byte, error) {
	lc.ChannelName = ChannelNameBasicChannelChannelNameLineChannel
	objectMap := make(map[string]interface{})
	if lc.Properties != nil {
		objectMap["properties"] = lc.Properties
	}
	if lc.ChannelName != "" {
		objectMap["channelName"] = lc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsLineChannel() (*LineChannel, bool) {
	return &lc, true
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for LineChannel.
func (lc LineChannel) AsBasicChannel() (BasicChannel, bool) {
	return &lc, true
}

// LineChannelProperties the parameters to provide for the Line channel.
type LineChannelProperties struct {
	// LineRegistrations - The list of line channel registrations
	LineRegistrations *[]LineRegistration `json:"lineRegistrations,omitempty"`
	// CallbackURL - READ-ONLY; Callback Url to enter in line registration.
	CallbackURL *string `json:"callbackUrl,omitempty"`
	// IsValidated - READ-ONLY; Whether this channel is validated for the bot
	IsValidated *bool `json:"isValidated,omitempty"`
}

// MarshalJSON is the custom marshaler for LineChannelProperties.
func (lcp LineChannelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if lcp.LineRegistrations != nil {
		objectMap["lineRegistrations"] = lcp.LineRegistrations
	}
	return json.Marshal(objectMap)
}

// LineRegistration the properties corresponding to a line channel registration
type LineRegistration struct {
	// GeneratedID - READ-ONLY; Id generated for the line channel registration
	GeneratedID *string `json:"generatedId,omitempty"`
	// ChannelSecret - Secret for the line channel registration
	ChannelSecret *string `json:"channelSecret,omitempty"`
	// ChannelAccessToken - Access token for the line channel registration
	ChannelAccessToken *string `json:"channelAccessToken,omitempty"`
}

// MarshalJSON is the custom marshaler for LineRegistration.
func (lr LineRegistration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if lr.ChannelSecret != nil {
		objectMap["channelSecret"] = lr.ChannelSecret
	}
	if lr.ChannelAccessToken != nil {
		objectMap["channelAccessToken"] = lr.ChannelAccessToken
	}
	return json.Marshal(objectMap)
}

// MsTeamsChannel microsoft Teams channel definition
type MsTeamsChannel struct {
	// Properties - The set of properties specific to Microsoft Teams channel resource
	Properties *MsTeamsChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for MsTeamsChannel.
func (mtc MsTeamsChannel) MarshalJSON() ([]byte, error) {
	mtc.ChannelName = ChannelNameBasicChannelChannelNameMsTeamsChannel
	objectMap := make(map[string]interface{})
	if mtc.Properties != nil {
		objectMap["properties"] = mtc.Properties
	}
	if mtc.ChannelName != "" {
		objectMap["channelName"] = mtc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return &mtc, true
}

// AsSkypeChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for MsTeamsChannel.
func (mtc MsTeamsChannel) AsBasicChannel() (BasicChannel, bool) {
	return &mtc, true
}

// MsTeamsChannelProperties the parameters to provide for the Microsoft Teams channel.
type MsTeamsChannelProperties struct {
	// EnableCalling - Enable calling for Microsoft Teams channel
	EnableCalling *bool `json:"enableCalling,omitempty"`
	// CallingWebHook - Webhook for Microsoft Teams channel calls
	CallingWebHook *string `json:"callingWebHook,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// OperationDisplayInfo the operation supported by Bot Service Management.
type OperationDisplayInfo struct {
	// Description - The description of the operation.
	Description *string `json:"description,omitempty"`
	// Operation - The action that users can perform, based on their permission level.
	Operation *string `json:"operation,omitempty"`
	// Provider - Service provider: Microsoft Bot Service.
	Provider *string `json:"provider,omitempty"`
	// Resource - Resource on which the operation is performed.
	Resource *string `json:"resource,omitempty"`
}

// OperationEntity the operations supported by Bot Service Management.
type OperationEntity struct {
	// Name - Operation name: {provider}/{resource}/{operation}.
	Name *string `json:"name,omitempty"`
	// Display - The operation supported by Bot Service Management.
	Display *OperationDisplayInfo `json:"display,omitempty"`
	// Origin - The origin of the operation.
	Origin *string `json:"origin,omitempty"`
	// Properties - Additional properties.
	Properties interface{} `json:"properties,omitempty"`
}

// OperationEntityListResult the list of bot service operation response.
type OperationEntityListResult struct {
	autorest.Response `json:"-"`
	// NextLink - The link used to get the next page of operations.
	NextLink *string `json:"nextLink,omitempty"`
	// Value - The list of operations.
	Value *[]OperationEntity `json:"value,omitempty"`
}

// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values.
type OperationEntityListResultIterator struct {
	i    int
	page OperationEntityListResultPage
}

// 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 *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.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 *OperationEntityListResultIterator) Next() error {
	return iter.NextWithContext(context.Background())
}

// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter OperationEntityListResultIterator) 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 OperationEntityListResultIterator) Response() OperationEntityListResult {
	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 OperationEntityListResultIterator) Value() OperationEntity {
	if !iter.page.NotDone() {
		return OperationEntity{}
	}
	return iter.page.Values()[iter.i]
}

// Creates a new instance of the OperationEntityListResultIterator type.
func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
	return OperationEntityListResultIterator{page: page}
}

// IsEmpty returns true if the ListResult contains no values.
func (oelr OperationEntityListResult) IsEmpty() bool {
	return oelr.Value == nil || len(*oelr.Value) == 0
}

// hasNextLink returns true if the NextLink is not empty.
func (oelr OperationEntityListResult) hasNextLink() bool {
	return oelr.NextLink != nil && len(*oelr.NextLink) != 0
}

// operationEntityListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
	if !oelr.hasNextLink() {
		return nil, nil
	}
	return autorest.Prepare((&http.Request{}).WithContext(ctx),
		autorest.AsJSON(),
		autorest.AsGet(),
		autorest.WithBaseURL(to.String(oelr.NextLink)))
}

// OperationEntityListResultPage contains a page of OperationEntity values.
type OperationEntityListResultPage struct {
	fn   func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
	oelr OperationEntityListResult
}

// 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 *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.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.oelr)
		if err != nil {
			return err
		}
		page.oelr = 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 *OperationEntityListResultPage) Next() error {
	return page.NextWithContext(context.Background())
}

// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page OperationEntityListResultPage) NotDone() bool {
	return !page.oelr.IsEmpty()
}

// Response returns the raw server response from the last page request.
func (page OperationEntityListResultPage) Response() OperationEntityListResult {
	return page.oelr
}

// Values returns the slice of values for the current page or nil if there are no values.
func (page OperationEntityListResultPage) Values() []OperationEntity {
	if page.oelr.IsEmpty() {
		return nil
	}
	return *page.oelr.Value
}

// Creates a new instance of the OperationEntityListResultPage type.
func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
	return OperationEntityListResultPage{
		fn:   getNextPage,
		oelr: cur,
	}
}

// OperationResultsDescription the properties indicating the operation result of an operation on a service.
type OperationResultsDescription struct {
	autorest.Response `json:"-"`
	// ID - READ-ONLY; The ID of the operation returned.
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the operation result.
	Name *string `json:"name,omitempty"`
	// Status - READ-ONLY; The status of the operation being performed. Possible values include: 'OperationResultStatusCanceled', 'OperationResultStatusSucceeded', 'OperationResultStatusFailed', 'OperationResultStatusRequested', 'OperationResultStatusRunning'
	Status OperationResultStatus `json:"status,omitempty"`
	// StartTime - READ-ONLY; The time that the operation was started.
	StartTime *date.Time `json:"startTime,omitempty"`
}

// MarshalJSON is the custom marshaler for OperationResultsDescription.
func (ord OperationResultsDescription) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// OperationResultsGetFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type OperationResultsGetFuture struct {
	azure.FutureAPI
	// Result returns the result of the asynchronous operation.
	// If the operation has not completed it will return an error.
	Result func(OperationResultsClient) (OperationResultsDescription, error)
}

// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *OperationResultsGetFuture) UnmarshalJSON(body []byte) error {
	var azFuture azure.Future
	if err := json.Unmarshal(body, &azFuture); err != nil {
		return err
	}
	future.FutureAPI = &azFuture
	future.Result = future.result
	return nil
}

// result is the default implementation for OperationResultsGetFuture.Result.
func (future *OperationResultsGetFuture) result(client OperationResultsClient) (ord OperationResultsDescription, err error) {
	var done bool
	done, err = future.DoneWithContext(context.Background(), client)
	if err != nil {
		err = autorest.NewErrorWithError(err, "botservice.OperationResultsGetFuture", "Result", future.Response(), "Polling failure")
		return
	}
	if !done {
		ord.Response.Response = future.Response()
		err = azure.NewAsyncOpIncompleteError("botservice.OperationResultsGetFuture")
		return
	}
	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
	if ord.Response.Response, err = future.GetResult(sender); err == nil && ord.Response.Response.StatusCode != http.StatusNoContent {
		ord, err = client.GetResponder(ord.Response.Response)
		if err != nil {
			err = autorest.NewErrorWithError(err, "botservice.OperationResultsGetFuture", "Result", ord.Response.Response, "Failure responding to request")
		}
	}
	return
}

// PrivateEndpoint the Private Endpoint resource.
type PrivateEndpoint struct {
	// ID - READ-ONLY; The ARM identifier for Private Endpoint
	ID *string `json:"id,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateEndpoint.
func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateEndpointConnection the Private Endpoint Connection resource.
type PrivateEndpointConnection struct {
	autorest.Response `json:"-"`
	// PrivateEndpointConnectionProperties - Resource properties.
	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	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 list of private endpoint connection associated with the specified
// storage account
type PrivateEndpointConnectionListResult struct {
	autorest.Response `json:"-"`
	// Value - Array of private endpoint connections
	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
}

// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
type PrivateEndpointConnectionProperties struct {
	// PrivateEndpoint - The resource of private end point.
	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
}

// PrivateLinkResource a private link resource
type PrivateLinkResource struct {
	// PrivateLinkResourceProperties - Resource properties.
	*PrivateLinkResourceProperties `json:"properties,omitempty"`
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	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
	}
	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
}

// PrivateLinkResourceBase common fields that are returned in the response for all BotService Private Link
// Resources
type PrivateLinkResourceBase struct {
	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`
}

// MarshalJSON is the custom marshaler for PrivateLinkResourceBase.
func (plrb PrivateLinkResourceBase) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// PrivateLinkResourceListResult a list of private link resources
type PrivateLinkResourceListResult struct {
	autorest.Response `json:"-"`
	// Value - Array of private link resources
	Value *[]PrivateLinkResource `json:"value,omitempty"`
}

// PrivateLinkResourceProperties properties of a private link resource.
type PrivateLinkResourceProperties struct {
	// GroupID - READ-ONLY; The private link resource group id.
	GroupID *string `json:"groupId,omitempty"`
	// RequiredMembers - READ-ONLY; 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"`
}

// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if plrp.RequiredZoneNames != nil {
		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
	}
	return json.Marshal(objectMap)
}

// PrivateLinkServiceConnectionState a collection of information about the state of the connection between
// service consumer and provider.
type PrivateLinkServiceConnectionState struct {
	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected'
	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
	// Description - The reason for approval/rejection of the connection.
	Description *string `json:"description,omitempty"`
	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *string `json:"actionsRequired,omitempty"`
}

// Resource azure resource
type Resource struct {
	// ID - READ-ONLY; Specifies the resource ID.
	ID *string `json:"id,omitempty"`
	// Name - READ-ONLY; Specifies the name of the resource.
	Name *string `json:"name,omitempty"`
	// Location - Specifies the location of the resource.
	Location *string `json:"location,omitempty"`
	// Type - READ-ONLY; 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', 'KindAzurebot'
	Kind Kind `json:"kind,omitempty"`
	// Etag - Entity Tag
	Etag *string `json:"etag,omitempty"`
}

// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if r.Location != nil {
		objectMap["location"] = r.Location
	}
	if r.Tags != nil {
		objectMap["tags"] = r.Tags
	}
	if r.Sku != nil {
		objectMap["sku"] = r.Sku
	}
	if r.Kind != "" {
		objectMap["kind"] = r.Kind
	}
	if r.Etag != nil {
		objectMap["etag"] = r.Etag
	}
	return json.Marshal(objectMap)
}

// ServiceProvider service Provider Definition
type ServiceProvider struct {
	// Properties - The Properties of a Service Provider Object
	Properties *ServiceProviderProperties `json:"properties,omitempty"`
}

// ServiceProviderParameter extra Parameters specific to each Service Provider
type ServiceProviderParameter struct {
	// Name - READ-ONLY; Name of the Service Provider
	Name *string `json:"name,omitempty"`
	// Type - READ-ONLY; Type of the Service Provider
	Type *string `json:"type,omitempty"`
	// DisplayName - READ-ONLY; Display Name of the Service Provider
	DisplayName *string `json:"displayName,omitempty"`
	// Description - READ-ONLY; Description of the Service Provider
	Description *string `json:"description,omitempty"`
	// HelpURL - READ-ONLY; Help Url for the  Service Provider
	HelpURL *string `json:"helpUrl,omitempty"`
	// Default - READ-ONLY; Default Name for the Service Provider
	Default *string `json:"default,omitempty"`
}

// MarshalJSON is the custom marshaler for ServiceProviderParameter.
func (spp ServiceProviderParameter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	return json.Marshal(objectMap)
}

// ServiceProviderProperties the Object used to describe a Service Provider supported by Bot Service
type ServiceProviderProperties struct {
	// ID - READ-ONLY; Id for Service Provider
	ID *string `json:"id,omitempty"`
	// DisplayName - READ-ONLY; Display Name of the Service Provider
	DisplayName *string `json:"displayName,omitempty"`
	// ServiceProviderName - READ-ONLY; Display Name of the Service Provider
	ServiceProviderName *string `json:"serviceProviderName,omitempty"`
	// DevPortalURL - READ-ONLY; Display Name of the Service Provider
	DevPortalURL *string `json:"devPortalUrl,omitempty"`
	// IconURL - READ-ONLY; Display Name of the Service Provider
	IconURL *string `json:"iconUrl,omitempty"`
	// Parameters - The list of parameters for the Service Provider
	Parameters *[]ServiceProviderParameter `json:"parameters,omitempty"`
}

// MarshalJSON is the custom marshaler for ServiceProviderProperties.
func (spp ServiceProviderProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if spp.Parameters != nil {
		objectMap["parameters"] = spp.Parameters
	}
	return json.Marshal(objectMap)
}

// ServiceProviderResponseList the list of bot service providers response.
type ServiceProviderResponseList struct {
	autorest.Response `json:"-"`
	// NextLink - The link used to get the next page of bot service providers.
	NextLink *string `json:"nextLink,omitempty"`
	// Value - READ-ONLY; Gets the list of bot service providers and their properties.
	Value *[]ServiceProvider `json:"value,omitempty"`
}

// MarshalJSON is the custom marshaler for ServiceProviderResponseList.
func (sprl ServiceProviderResponseList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if sprl.NextLink != nil {
		objectMap["nextLink"] = sprl.NextLink
	}
	return json.Marshal(objectMap)
}

// SiteInfo site information for WebChat or DirectLine Channels to identify which site to regenerate keys
// for.
type SiteInfo struct {
	// SiteName - The site name
	SiteName *string `json:"siteName,omitempty"`
	// Key - Determines which key is to be regenerated. Possible values include: 'Key1', 'Key2'
	Key Key `json:"key,omitempty"`
}

// Sku the SKU of the cognitive services account.
type Sku struct {
	// Name - The sku name. Possible values include: 'SkuNameF0', 'SkuNameS1'
	Name SkuName `json:"name,omitempty"`
	// Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'SkuTierFree', 'SkuTierStandard'
	Tier SkuTier `json:"tier,omitempty"`
}

// MarshalJSON is the custom marshaler for Sku.
func (s Sku) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if s.Name != "" {
		objectMap["name"] = s.Name
	}
	return json.Marshal(objectMap)
}

// SkypeChannel skype channel definition
type SkypeChannel struct {
	// Properties - The set of properties specific to Skype channel resource
	Properties *SkypeChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for SkypeChannel.
func (sc SkypeChannel) MarshalJSON() ([]byte, error) {
	sc.ChannelName = ChannelNameBasicChannelChannelNameSkypeChannel
	objectMap := make(map[string]interface{})
	if sc.Properties != nil {
		objectMap["properties"] = sc.Properties
	}
	if sc.ChannelName != "" {
		objectMap["channelName"] = sc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return &sc, true
}

// AsKikChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for SkypeChannel.
func (sc SkypeChannel) AsBasicChannel() (BasicChannel, bool) {
	return &sc, true
}

// SkypeChannelProperties the parameters to provide for the Microsoft Teams channel.
type SkypeChannelProperties struct {
	// EnableMessaging - Enable messaging for Skype channel
	EnableMessaging *bool `json:"enableMessaging,omitempty"`
	// EnableMediaCards - Enable media cards for Skype channel
	EnableMediaCards *bool `json:"enableMediaCards,omitempty"`
	// EnableVideo - Enable video for Skype channel
	EnableVideo *bool `json:"enableVideo,omitempty"`
	// EnableCalling - Enable calling for Skype channel
	EnableCalling *bool `json:"enableCalling,omitempty"`
	// EnableScreenSharing - Enable screen sharing for Skype channel
	EnableScreenSharing *bool `json:"enableScreenSharing,omitempty"`
	// EnableGroups - Enable groups for Skype channel
	EnableGroups *bool `json:"enableGroups,omitempty"`
	// GroupsMode - Group mode for Skype channel
	GroupsMode *string `json:"groupsMode,omitempty"`
	// CallingWebHook - Calling web hook for Skype channel
	CallingWebHook *string `json:"callingWebHook,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// SlackChannel slack channel definition
type SlackChannel struct {
	// Properties - The set of properties specific to Slack channel resource
	Properties *SlackChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for SlackChannel.
func (sc SlackChannel) MarshalJSON() ([]byte, error) {
	sc.ChannelName = ChannelNameBasicChannelChannelNameSlackChannel
	objectMap := make(map[string]interface{})
	if sc.Properties != nil {
		objectMap["properties"] = sc.Properties
	}
	if sc.ChannelName != "" {
		objectMap["channelName"] = sc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsSlackChannel() (*SlackChannel, bool) {
	return &sc, true
}

// AsLineChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for SlackChannel.
func (sc SlackChannel) AsBasicChannel() (BasicChannel, bool) {
	return &sc, true
}

// SlackChannelProperties the parameters to provide for the Slack channel.
type SlackChannelProperties struct {
	// ClientID - The Slack client id
	ClientID *string `json:"clientId,omitempty"`
	// ClientSecret - The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty.
	ClientSecret *string `json:"clientSecret,omitempty"`
	// VerificationToken - The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty.
	VerificationToken *string `json:"verificationToken,omitempty"`
	// Scopes - The Slack permission scopes.
	Scopes *string `json:"scopes,omitempty"`
	// LandingPageURL - The Slack landing page Url
	LandingPageURL *string `json:"landingPageUrl,omitempty"`
	// RedirectAction - READ-ONLY; The Slack redirect action
	RedirectAction *string `json:"redirectAction,omitempty"`
	// LastSubmissionID - READ-ONLY; The Sms auth token
	LastSubmissionID *string `json:"lastSubmissionId,omitempty"`
	// RegisterBeforeOAuthFlow - READ-ONLY; Whether to register the settings before OAuth validation is performed. Recommended to True.
	RegisterBeforeOAuthFlow *bool `json:"registerBeforeOAuthFlow,omitempty"`
	// IsValidated - READ-ONLY; Whether this channel is validated for the bot
	IsValidated *bool `json:"isValidated,omitempty"`
	// SigningSecret - The Slack signing secret.
	SigningSecret *string `json:"signingSecret,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// MarshalJSON is the custom marshaler for SlackChannelProperties.
func (scp SlackChannelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if scp.ClientID != nil {
		objectMap["clientId"] = scp.ClientID
	}
	if scp.ClientSecret != nil {
		objectMap["clientSecret"] = scp.ClientSecret
	}
	if scp.VerificationToken != nil {
		objectMap["verificationToken"] = scp.VerificationToken
	}
	if scp.Scopes != nil {
		objectMap["scopes"] = scp.Scopes
	}
	if scp.LandingPageURL != nil {
		objectMap["landingPageUrl"] = scp.LandingPageURL
	}
	if scp.SigningSecret != nil {
		objectMap["signingSecret"] = scp.SigningSecret
	}
	if scp.IsEnabled != nil {
		objectMap["isEnabled"] = scp.IsEnabled
	}
	return json.Marshal(objectMap)
}

// SmsChannel sms channel definition
type SmsChannel struct {
	// Properties - The set of properties specific to Sms channel resource
	Properties *SmsChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for SmsChannel.
func (sc SmsChannel) MarshalJSON() ([]byte, error) {
	sc.ChannelName = ChannelNameBasicChannelChannelNameSmsChannel
	objectMap := make(map[string]interface{})
	if sc.Properties != nil {
		objectMap["properties"] = sc.Properties
	}
	if sc.ChannelName != "" {
		objectMap["channelName"] = sc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsSmsChannel() (*SmsChannel, bool) {
	return &sc, true
}

// AsSlackChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for SmsChannel.
func (sc SmsChannel) AsBasicChannel() (BasicChannel, bool) {
	return &sc, true
}

// SmsChannelProperties the parameters to provide for the Sms channel.
type SmsChannelProperties struct {
	// Phone - The Sms phone
	Phone *string `json:"phone,omitempty"`
	// AccountSID - The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty.
	AccountSID *string `json:"accountSID,omitempty"`
	// AuthToken - The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty.
	AuthToken *string `json:"authToken,omitempty"`
	// IsValidated - Whether this channel is validated for the bot
	IsValidated *bool `json:"isValidated,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// TelegramChannel telegram channel definition
type TelegramChannel struct {
	// Properties - The set of properties specific to Telegram channel resource
	Properties *TelegramChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for TelegramChannel.
func (tc TelegramChannel) MarshalJSON() ([]byte, error) {
	tc.ChannelName = ChannelNameBasicChannelChannelNameTelegramChannel
	objectMap := make(map[string]interface{})
	if tc.Properties != nil {
		objectMap["properties"] = tc.Properties
	}
	if tc.ChannelName != "" {
		objectMap["channelName"] = tc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return nil, false
}

// AsDirectLineChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return &tc, true
}

// AsSmsChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for TelegramChannel.
func (tc TelegramChannel) AsBasicChannel() (BasicChannel, bool) {
	return &tc, true
}

// TelegramChannelProperties the parameters to provide for the Telegram channel.
type TelegramChannelProperties struct {
	// AccessToken - The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty.
	AccessToken *string `json:"accessToken,omitempty"`
	// IsValidated - Whether this channel is validated for the bot
	IsValidated *bool `json:"isValidated,omitempty"`
	// IsEnabled - Whether this channel is enabled for the bot
	IsEnabled *bool `json:"isEnabled,omitempty"`
}

// WebChatChannel web Chat channel definition
type WebChatChannel struct {
	// Properties - The set of properties specific to Web Chat channel resource
	Properties *WebChatChannelProperties `json:"properties,omitempty"`
	// ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel'
	ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"`
}

// MarshalJSON is the custom marshaler for WebChatChannel.
func (wcc WebChatChannel) MarshalJSON() ([]byte, error) {
	wcc.ChannelName = ChannelNameBasicChannelChannelNameWebChatChannel
	objectMap := make(map[string]interface{})
	if wcc.Properties != nil {
		objectMap["properties"] = wcc.Properties
	}
	if wcc.ChannelName != "" {
		objectMap["channelName"] = wcc.ChannelName
	}
	return json.Marshal(objectMap)
}

// AsAlexaChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsAlexaChannel() (*AlexaChannel, bool) {
	return nil, false
}

// AsFacebookChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsFacebookChannel() (*FacebookChannel, bool) {
	return nil, false
}

// AsEmailChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsEmailChannel() (*EmailChannel, bool) {
	return nil, false
}

// AsMsTeamsChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) {
	return nil, false
}

// AsSkypeChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsSkypeChannel() (*SkypeChannel, bool) {
	return nil, false
}

// AsKikChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsKikChannel() (*KikChannel, bool) {
	return nil, false
}

// AsWebChatChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsWebChatChannel() (*WebChatChannel, bool) {
	return &wcc, true
}

// AsDirectLineChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsDirectLineChannel() (*DirectLineChannel, bool) {
	return nil, false
}

// AsTelegramChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsTelegramChannel() (*TelegramChannel, bool) {
	return nil, false
}

// AsSmsChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsSmsChannel() (*SmsChannel, bool) {
	return nil, false
}

// AsSlackChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsSlackChannel() (*SlackChannel, bool) {
	return nil, false
}

// AsLineChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsLineChannel() (*LineChannel, bool) {
	return nil, false
}

// AsDirectLineSpeechChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) {
	return nil, false
}

// AsChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsChannel() (*Channel, bool) {
	return nil, false
}

// AsBasicChannel is the BasicChannel implementation for WebChatChannel.
func (wcc WebChatChannel) AsBasicChannel() (BasicChannel, bool) {
	return &wcc, true
}

// WebChatChannelProperties the parameters to provide for the Web Chat channel.
type WebChatChannelProperties struct {
	// WebChatEmbedCode - READ-ONLY; Web chat control embed code
	WebChatEmbedCode *string `json:"webChatEmbedCode,omitempty"`
	// Sites - The list of Web Chat sites
	Sites *[]WebChatSite `json:"sites,omitempty"`
}

// MarshalJSON is the custom marshaler for WebChatChannelProperties.
func (wccp WebChatChannelProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wccp.Sites != nil {
		objectMap["sites"] = wccp.Sites
	}
	return json.Marshal(objectMap)
}

// WebChatSite a site for the Webchat channel
type WebChatSite struct {
	// SiteID - READ-ONLY; Site Id
	SiteID *string `json:"siteId,omitempty"`
	// SiteName - Site name
	SiteName *string `json:"siteName,omitempty"`
	// Key - READ-ONLY; Primary key. Value only returned through POST to the action Channel List API, otherwise empty.
	Key *string `json:"key,omitempty"`
	// Key2 - READ-ONLY; 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 *bool `json:"isEnabled,omitempty"`
	// EnablePreview - Whether this site is enabled for preview versions of Webchat
	EnablePreview *bool `json:"enablePreview,omitempty"`
}

// MarshalJSON is the custom marshaler for WebChatSite.
func (wcs WebChatSite) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	if wcs.SiteName != nil {
		objectMap["siteName"] = wcs.SiteName
	}
	if wcs.IsEnabled != nil {
		objectMap["isEnabled"] = wcs.IsEnabled
	}
	if wcs.EnablePreview != nil {
		objectMap["enablePreview"] = wcs.EnablePreview
	}
	return json.Marshal(objectMap)
}
