1package botservice 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/to" 14 "github.com/Azure/go-autorest/tracing" 15 "net/http" 16) 17 18// The package's fully qualified name. 19const fqdn = "github.com/Azure/azure-sdk-for-go/services/botservice/mgmt/2021-03-01/botservice" 20 21// AlexaChannel alexa channel definition 22type AlexaChannel struct { 23 // Properties - The set of properties specific to Alexa channel resource 24 Properties *AlexaChannelProperties `json:"properties,omitempty"` 25 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 26 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 27} 28 29// MarshalJSON is the custom marshaler for AlexaChannel. 30func (ac AlexaChannel) MarshalJSON() ([]byte, error) { 31 ac.ChannelName = ChannelNameBasicChannelChannelNameAlexaChannel 32 objectMap := make(map[string]interface{}) 33 if ac.Properties != nil { 34 objectMap["properties"] = ac.Properties 35 } 36 if ac.ChannelName != "" { 37 objectMap["channelName"] = ac.ChannelName 38 } 39 return json.Marshal(objectMap) 40} 41 42// AsAlexaChannel is the BasicChannel implementation for AlexaChannel. 43func (ac AlexaChannel) AsAlexaChannel() (*AlexaChannel, bool) { 44 return &ac, true 45} 46 47// AsFacebookChannel is the BasicChannel implementation for AlexaChannel. 48func (ac AlexaChannel) AsFacebookChannel() (*FacebookChannel, bool) { 49 return nil, false 50} 51 52// AsEmailChannel is the BasicChannel implementation for AlexaChannel. 53func (ac AlexaChannel) AsEmailChannel() (*EmailChannel, bool) { 54 return nil, false 55} 56 57// AsMsTeamsChannel is the BasicChannel implementation for AlexaChannel. 58func (ac AlexaChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 59 return nil, false 60} 61 62// AsSkypeChannel is the BasicChannel implementation for AlexaChannel. 63func (ac AlexaChannel) AsSkypeChannel() (*SkypeChannel, bool) { 64 return nil, false 65} 66 67// AsKikChannel is the BasicChannel implementation for AlexaChannel. 68func (ac AlexaChannel) AsKikChannel() (*KikChannel, bool) { 69 return nil, false 70} 71 72// AsWebChatChannel is the BasicChannel implementation for AlexaChannel. 73func (ac AlexaChannel) AsWebChatChannel() (*WebChatChannel, bool) { 74 return nil, false 75} 76 77// AsDirectLineChannel is the BasicChannel implementation for AlexaChannel. 78func (ac AlexaChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 79 return nil, false 80} 81 82// AsTelegramChannel is the BasicChannel implementation for AlexaChannel. 83func (ac AlexaChannel) AsTelegramChannel() (*TelegramChannel, bool) { 84 return nil, false 85} 86 87// AsSmsChannel is the BasicChannel implementation for AlexaChannel. 88func (ac AlexaChannel) AsSmsChannel() (*SmsChannel, bool) { 89 return nil, false 90} 91 92// AsSlackChannel is the BasicChannel implementation for AlexaChannel. 93func (ac AlexaChannel) AsSlackChannel() (*SlackChannel, bool) { 94 return nil, false 95} 96 97// AsLineChannel is the BasicChannel implementation for AlexaChannel. 98func (ac AlexaChannel) AsLineChannel() (*LineChannel, bool) { 99 return nil, false 100} 101 102// AsDirectLineSpeechChannel is the BasicChannel implementation for AlexaChannel. 103func (ac AlexaChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 104 return nil, false 105} 106 107// AsChannel is the BasicChannel implementation for AlexaChannel. 108func (ac AlexaChannel) AsChannel() (*Channel, bool) { 109 return nil, false 110} 111 112// AsBasicChannel is the BasicChannel implementation for AlexaChannel. 113func (ac AlexaChannel) AsBasicChannel() (BasicChannel, bool) { 114 return &ac, true 115} 116 117// AlexaChannelProperties the parameters to provide for the Alexa channel. 118type AlexaChannelProperties struct { 119 // AlexaSkillID - The Alexa skill Id 120 AlexaSkillID *string `json:"alexaSkillId,omitempty"` 121 // URLFragment - READ-ONLY; Url fragment used in part of the Uri configured in Alexa 122 URLFragment *string `json:"urlFragment,omitempty"` 123 // ServiceEndpointURI - READ-ONLY; Full Uri used to configured the skill in Alexa 124 ServiceEndpointURI *string `json:"serviceEndpointUri,omitempty"` 125 // IsEnabled - Whether this channel is enabled for the bot 126 IsEnabled *bool `json:"isEnabled,omitempty"` 127} 128 129// MarshalJSON is the custom marshaler for AlexaChannelProperties. 130func (acp AlexaChannelProperties) MarshalJSON() ([]byte, error) { 131 objectMap := make(map[string]interface{}) 132 if acp.AlexaSkillID != nil { 133 objectMap["alexaSkillId"] = acp.AlexaSkillID 134 } 135 if acp.IsEnabled != nil { 136 objectMap["isEnabled"] = acp.IsEnabled 137 } 138 return json.Marshal(objectMap) 139} 140 141// Bot bot resource definition 142type Bot struct { 143 autorest.Response `json:"-"` 144 // Properties - The set of properties specific to bot resource 145 Properties *BotProperties `json:"properties,omitempty"` 146 // ID - READ-ONLY; Specifies the resource ID. 147 ID *string `json:"id,omitempty"` 148 // Name - READ-ONLY; Specifies the name of the resource. 149 Name *string `json:"name,omitempty"` 150 // Location - Specifies the location of the resource. 151 Location *string `json:"location,omitempty"` 152 // Type - READ-ONLY; Specifies the type of the resource. 153 Type *string `json:"type,omitempty"` 154 // Tags - Contains resource tags defined as key/value pairs. 155 Tags map[string]*string `json:"tags"` 156 // Sku - Gets or sets the SKU of the resource. 157 Sku *Sku `json:"sku,omitempty"` 158 // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction', 'KindAzurebot' 159 Kind Kind `json:"kind,omitempty"` 160 // Etag - Entity Tag 161 Etag *string `json:"etag,omitempty"` 162} 163 164// MarshalJSON is the custom marshaler for Bot. 165func (b Bot) MarshalJSON() ([]byte, error) { 166 objectMap := make(map[string]interface{}) 167 if b.Properties != nil { 168 objectMap["properties"] = b.Properties 169 } 170 if b.Location != nil { 171 objectMap["location"] = b.Location 172 } 173 if b.Tags != nil { 174 objectMap["tags"] = b.Tags 175 } 176 if b.Sku != nil { 177 objectMap["sku"] = b.Sku 178 } 179 if b.Kind != "" { 180 objectMap["kind"] = b.Kind 181 } 182 if b.Etag != nil { 183 objectMap["etag"] = b.Etag 184 } 185 return json.Marshal(objectMap) 186} 187 188// BotChannel bot channel resource definition 189type BotChannel struct { 190 autorest.Response `json:"-"` 191 // Properties - The set of properties specific to bot channel resource 192 Properties BasicChannel `json:"properties,omitempty"` 193 // ID - READ-ONLY; Specifies the resource ID. 194 ID *string `json:"id,omitempty"` 195 // Name - READ-ONLY; Specifies the name of the resource. 196 Name *string `json:"name,omitempty"` 197 // Location - Specifies the location of the resource. 198 Location *string `json:"location,omitempty"` 199 // Type - READ-ONLY; Specifies the type of the resource. 200 Type *string `json:"type,omitempty"` 201 // Tags - Contains resource tags defined as key/value pairs. 202 Tags map[string]*string `json:"tags"` 203 // Sku - Gets or sets the SKU of the resource. 204 Sku *Sku `json:"sku,omitempty"` 205 // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction', 'KindAzurebot' 206 Kind Kind `json:"kind,omitempty"` 207 // Etag - Entity Tag 208 Etag *string `json:"etag,omitempty"` 209} 210 211// MarshalJSON is the custom marshaler for BotChannel. 212func (bc BotChannel) MarshalJSON() ([]byte, error) { 213 objectMap := make(map[string]interface{}) 214 objectMap["properties"] = bc.Properties 215 if bc.Location != nil { 216 objectMap["location"] = bc.Location 217 } 218 if bc.Tags != nil { 219 objectMap["tags"] = bc.Tags 220 } 221 if bc.Sku != nil { 222 objectMap["sku"] = bc.Sku 223 } 224 if bc.Kind != "" { 225 objectMap["kind"] = bc.Kind 226 } 227 if bc.Etag != nil { 228 objectMap["etag"] = bc.Etag 229 } 230 return json.Marshal(objectMap) 231} 232 233// UnmarshalJSON is the custom unmarshaler for BotChannel struct. 234func (bc *BotChannel) UnmarshalJSON(body []byte) error { 235 var m map[string]*json.RawMessage 236 err := json.Unmarshal(body, &m) 237 if err != nil { 238 return err 239 } 240 for k, v := range m { 241 switch k { 242 case "properties": 243 if v != nil { 244 properties, err := unmarshalBasicChannel(*v) 245 if err != nil { 246 return err 247 } 248 bc.Properties = properties 249 } 250 case "id": 251 if v != nil { 252 var ID string 253 err = json.Unmarshal(*v, &ID) 254 if err != nil { 255 return err 256 } 257 bc.ID = &ID 258 } 259 case "name": 260 if v != nil { 261 var name string 262 err = json.Unmarshal(*v, &name) 263 if err != nil { 264 return err 265 } 266 bc.Name = &name 267 } 268 case "location": 269 if v != nil { 270 var location string 271 err = json.Unmarshal(*v, &location) 272 if err != nil { 273 return err 274 } 275 bc.Location = &location 276 } 277 case "type": 278 if v != nil { 279 var typeVar string 280 err = json.Unmarshal(*v, &typeVar) 281 if err != nil { 282 return err 283 } 284 bc.Type = &typeVar 285 } 286 case "tags": 287 if v != nil { 288 var tags map[string]*string 289 err = json.Unmarshal(*v, &tags) 290 if err != nil { 291 return err 292 } 293 bc.Tags = tags 294 } 295 case "sku": 296 if v != nil { 297 var sku Sku 298 err = json.Unmarshal(*v, &sku) 299 if err != nil { 300 return err 301 } 302 bc.Sku = &sku 303 } 304 case "kind": 305 if v != nil { 306 var kind Kind 307 err = json.Unmarshal(*v, &kind) 308 if err != nil { 309 return err 310 } 311 bc.Kind = kind 312 } 313 case "etag": 314 if v != nil { 315 var etag string 316 err = json.Unmarshal(*v, &etag) 317 if err != nil { 318 return err 319 } 320 bc.Etag = &etag 321 } 322 } 323 } 324 325 return nil 326} 327 328// BotProperties the parameters to provide for the Bot. 329type BotProperties struct { 330 // DisplayName - The Name of the bot 331 DisplayName *string `json:"displayName,omitempty"` 332 // Description - The description of the bot 333 Description *string `json:"description,omitempty"` 334 // IconURL - The Icon Url of the bot 335 IconURL *string `json:"iconUrl,omitempty"` 336 // Endpoint - The bot's endpoint 337 Endpoint *string `json:"endpoint,omitempty"` 338 // EndpointVersion - READ-ONLY; The bot's endpoint version 339 EndpointVersion *string `json:"endpointVersion,omitempty"` 340 // MsaAppID - Microsoft App Id for the bot 341 MsaAppID *string `json:"msaAppId,omitempty"` 342 // ConfiguredChannels - READ-ONLY; Collection of channels for which the bot is configured 343 ConfiguredChannels *[]string `json:"configuredChannels,omitempty"` 344 // EnabledChannels - READ-ONLY; Collection of channels for which the bot is enabled 345 EnabledChannels *[]string `json:"enabledChannels,omitempty"` 346 // DeveloperAppInsightKey - The Application Insights key 347 DeveloperAppInsightKey *string `json:"developerAppInsightKey,omitempty"` 348 // DeveloperAppInsightsAPIKey - The Application Insights Api Key 349 DeveloperAppInsightsAPIKey *string `json:"developerAppInsightsApiKey,omitempty"` 350 // DeveloperAppInsightsApplicationID - The Application Insights App Id 351 DeveloperAppInsightsApplicationID *string `json:"developerAppInsightsApplicationId,omitempty"` 352 // LuisAppIds - Collection of LUIS App Ids 353 LuisAppIds *[]string `json:"luisAppIds,omitempty"` 354 // LuisKey - The LUIS Key 355 LuisKey *string `json:"luisKey,omitempty"` 356 // IsCmekEnabled - Whether Cmek is enabled 357 IsCmekEnabled *bool `json:"isCmekEnabled,omitempty"` 358 // CmekKeyVaultURL - The CMK Url 359 CmekKeyVaultURL *string `json:"cmekKeyVaultUrl,omitempty"` 360 // IsIsolated - Whether the bot is in an isolated network 361 IsIsolated *bool `json:"isIsolated,omitempty"` 362 // SchemaTransformationVersion - The channel schema transformation version for the bot 363 SchemaTransformationVersion *string `json:"schemaTransformationVersion,omitempty"` 364} 365 366// MarshalJSON is the custom marshaler for BotProperties. 367func (bp BotProperties) MarshalJSON() ([]byte, error) { 368 objectMap := make(map[string]interface{}) 369 if bp.DisplayName != nil { 370 objectMap["displayName"] = bp.DisplayName 371 } 372 if bp.Description != nil { 373 objectMap["description"] = bp.Description 374 } 375 if bp.IconURL != nil { 376 objectMap["iconUrl"] = bp.IconURL 377 } 378 if bp.Endpoint != nil { 379 objectMap["endpoint"] = bp.Endpoint 380 } 381 if bp.MsaAppID != nil { 382 objectMap["msaAppId"] = bp.MsaAppID 383 } 384 if bp.DeveloperAppInsightKey != nil { 385 objectMap["developerAppInsightKey"] = bp.DeveloperAppInsightKey 386 } 387 if bp.DeveloperAppInsightsAPIKey != nil { 388 objectMap["developerAppInsightsApiKey"] = bp.DeveloperAppInsightsAPIKey 389 } 390 if bp.DeveloperAppInsightsApplicationID != nil { 391 objectMap["developerAppInsightsApplicationId"] = bp.DeveloperAppInsightsApplicationID 392 } 393 if bp.LuisAppIds != nil { 394 objectMap["luisAppIds"] = bp.LuisAppIds 395 } 396 if bp.LuisKey != nil { 397 objectMap["luisKey"] = bp.LuisKey 398 } 399 if bp.IsCmekEnabled != nil { 400 objectMap["isCmekEnabled"] = bp.IsCmekEnabled 401 } 402 if bp.CmekKeyVaultURL != nil { 403 objectMap["cmekKeyVaultUrl"] = bp.CmekKeyVaultURL 404 } 405 if bp.IsIsolated != nil { 406 objectMap["isIsolated"] = bp.IsIsolated 407 } 408 if bp.SchemaTransformationVersion != nil { 409 objectMap["schemaTransformationVersion"] = bp.SchemaTransformationVersion 410 } 411 return json.Marshal(objectMap) 412} 413 414// BotResponseList the list of bot service operation response. 415type BotResponseList struct { 416 autorest.Response `json:"-"` 417 // NextLink - The link used to get the next page of bot service resources. 418 NextLink *string `json:"nextLink,omitempty"` 419 // Value - READ-ONLY; Gets the list of bot service results and their properties. 420 Value *[]Bot `json:"value,omitempty"` 421} 422 423// MarshalJSON is the custom marshaler for BotResponseList. 424func (brl BotResponseList) MarshalJSON() ([]byte, error) { 425 objectMap := make(map[string]interface{}) 426 if brl.NextLink != nil { 427 objectMap["nextLink"] = brl.NextLink 428 } 429 return json.Marshal(objectMap) 430} 431 432// BotResponseListIterator provides access to a complete listing of Bot values. 433type BotResponseListIterator struct { 434 i int 435 page BotResponseListPage 436} 437 438// NextWithContext advances to the next value. If there was an error making 439// the request the iterator does not advance and the error is returned. 440func (iter *BotResponseListIterator) NextWithContext(ctx context.Context) (err error) { 441 if tracing.IsEnabled() { 442 ctx = tracing.StartSpan(ctx, fqdn+"/BotResponseListIterator.NextWithContext") 443 defer func() { 444 sc := -1 445 if iter.Response().Response.Response != nil { 446 sc = iter.Response().Response.Response.StatusCode 447 } 448 tracing.EndSpan(ctx, sc, err) 449 }() 450 } 451 iter.i++ 452 if iter.i < len(iter.page.Values()) { 453 return nil 454 } 455 err = iter.page.NextWithContext(ctx) 456 if err != nil { 457 iter.i-- 458 return err 459 } 460 iter.i = 0 461 return nil 462} 463 464// Next advances to the next value. If there was an error making 465// the request the iterator does not advance and the error is returned. 466// Deprecated: Use NextWithContext() instead. 467func (iter *BotResponseListIterator) Next() error { 468 return iter.NextWithContext(context.Background()) 469} 470 471// NotDone returns true if the enumeration should be started or is not yet complete. 472func (iter BotResponseListIterator) NotDone() bool { 473 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 474} 475 476// Response returns the raw server response from the last page request. 477func (iter BotResponseListIterator) Response() BotResponseList { 478 return iter.page.Response() 479} 480 481// Value returns the current value or a zero-initialized value if the 482// iterator has advanced beyond the end of the collection. 483func (iter BotResponseListIterator) Value() Bot { 484 if !iter.page.NotDone() { 485 return Bot{} 486 } 487 return iter.page.Values()[iter.i] 488} 489 490// Creates a new instance of the BotResponseListIterator type. 491func NewBotResponseListIterator(page BotResponseListPage) BotResponseListIterator { 492 return BotResponseListIterator{page: page} 493} 494 495// IsEmpty returns true if the ListResult contains no values. 496func (brl BotResponseList) IsEmpty() bool { 497 return brl.Value == nil || len(*brl.Value) == 0 498} 499 500// hasNextLink returns true if the NextLink is not empty. 501func (brl BotResponseList) hasNextLink() bool { 502 return brl.NextLink != nil && len(*brl.NextLink) != 0 503} 504 505// botResponseListPreparer prepares a request to retrieve the next set of results. 506// It returns nil if no more results exist. 507func (brl BotResponseList) botResponseListPreparer(ctx context.Context) (*http.Request, error) { 508 if !brl.hasNextLink() { 509 return nil, nil 510 } 511 return autorest.Prepare((&http.Request{}).WithContext(ctx), 512 autorest.AsJSON(), 513 autorest.AsGet(), 514 autorest.WithBaseURL(to.String(brl.NextLink))) 515} 516 517// BotResponseListPage contains a page of Bot values. 518type BotResponseListPage struct { 519 fn func(context.Context, BotResponseList) (BotResponseList, error) 520 brl BotResponseList 521} 522 523// NextWithContext advances to the next page of values. If there was an error making 524// the request the page does not advance and the error is returned. 525func (page *BotResponseListPage) NextWithContext(ctx context.Context) (err error) { 526 if tracing.IsEnabled() { 527 ctx = tracing.StartSpan(ctx, fqdn+"/BotResponseListPage.NextWithContext") 528 defer func() { 529 sc := -1 530 if page.Response().Response.Response != nil { 531 sc = page.Response().Response.Response.StatusCode 532 } 533 tracing.EndSpan(ctx, sc, err) 534 }() 535 } 536 for { 537 next, err := page.fn(ctx, page.brl) 538 if err != nil { 539 return err 540 } 541 page.brl = next 542 if !next.hasNextLink() || !next.IsEmpty() { 543 break 544 } 545 } 546 return nil 547} 548 549// Next advances to the next page of values. If there was an error making 550// the request the page does not advance and the error is returned. 551// Deprecated: Use NextWithContext() instead. 552func (page *BotResponseListPage) Next() error { 553 return page.NextWithContext(context.Background()) 554} 555 556// NotDone returns true if the page enumeration should be started or is not yet complete. 557func (page BotResponseListPage) NotDone() bool { 558 return !page.brl.IsEmpty() 559} 560 561// Response returns the raw server response from the last page request. 562func (page BotResponseListPage) Response() BotResponseList { 563 return page.brl 564} 565 566// Values returns the slice of values for the current page or nil if there are no values. 567func (page BotResponseListPage) Values() []Bot { 568 if page.brl.IsEmpty() { 569 return nil 570 } 571 return *page.brl.Value 572} 573 574// Creates a new instance of the BotResponseListPage type. 575func NewBotResponseListPage(cur BotResponseList, getNextPage func(context.Context, BotResponseList) (BotResponseList, error)) BotResponseListPage { 576 return BotResponseListPage{ 577 fn: getNextPage, 578 brl: cur, 579 } 580} 581 582// BasicChannel channel definition 583type BasicChannel interface { 584 AsAlexaChannel() (*AlexaChannel, bool) 585 AsFacebookChannel() (*FacebookChannel, bool) 586 AsEmailChannel() (*EmailChannel, bool) 587 AsMsTeamsChannel() (*MsTeamsChannel, bool) 588 AsSkypeChannel() (*SkypeChannel, bool) 589 AsKikChannel() (*KikChannel, bool) 590 AsWebChatChannel() (*WebChatChannel, bool) 591 AsDirectLineChannel() (*DirectLineChannel, bool) 592 AsTelegramChannel() (*TelegramChannel, bool) 593 AsSmsChannel() (*SmsChannel, bool) 594 AsSlackChannel() (*SlackChannel, bool) 595 AsLineChannel() (*LineChannel, bool) 596 AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) 597 AsChannel() (*Channel, bool) 598} 599 600// Channel channel definition 601type Channel struct { 602 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 603 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 604} 605 606func unmarshalBasicChannel(body []byte) (BasicChannel, error) { 607 var m map[string]interface{} 608 err := json.Unmarshal(body, &m) 609 if err != nil { 610 return nil, err 611 } 612 613 switch m["channelName"] { 614 case string(ChannelNameBasicChannelChannelNameAlexaChannel): 615 var ac AlexaChannel 616 err := json.Unmarshal(body, &ac) 617 return ac, err 618 case string(ChannelNameBasicChannelChannelNameFacebookChannel): 619 var fc FacebookChannel 620 err := json.Unmarshal(body, &fc) 621 return fc, err 622 case string(ChannelNameBasicChannelChannelNameEmailChannel): 623 var ec EmailChannel 624 err := json.Unmarshal(body, &ec) 625 return ec, err 626 case string(ChannelNameBasicChannelChannelNameMsTeamsChannel): 627 var mtc MsTeamsChannel 628 err := json.Unmarshal(body, &mtc) 629 return mtc, err 630 case string(ChannelNameBasicChannelChannelNameSkypeChannel): 631 var sc SkypeChannel 632 err := json.Unmarshal(body, &sc) 633 return sc, err 634 case string(ChannelNameBasicChannelChannelNameKikChannel): 635 var kc KikChannel 636 err := json.Unmarshal(body, &kc) 637 return kc, err 638 case string(ChannelNameBasicChannelChannelNameWebChatChannel): 639 var wcc WebChatChannel 640 err := json.Unmarshal(body, &wcc) 641 return wcc, err 642 case string(ChannelNameBasicChannelChannelNameDirectLineChannel): 643 var dlc DirectLineChannel 644 err := json.Unmarshal(body, &dlc) 645 return dlc, err 646 case string(ChannelNameBasicChannelChannelNameTelegramChannel): 647 var tc TelegramChannel 648 err := json.Unmarshal(body, &tc) 649 return tc, err 650 case string(ChannelNameBasicChannelChannelNameSmsChannel): 651 var sc SmsChannel 652 err := json.Unmarshal(body, &sc) 653 return sc, err 654 case string(ChannelNameBasicChannelChannelNameSlackChannel): 655 var sc SlackChannel 656 err := json.Unmarshal(body, &sc) 657 return sc, err 658 case string(ChannelNameBasicChannelChannelNameLineChannel): 659 var lc LineChannel 660 err := json.Unmarshal(body, &lc) 661 return lc, err 662 case string(ChannelNameBasicChannelChannelNameDirectLineSpeechChannel): 663 var dlsc DirectLineSpeechChannel 664 err := json.Unmarshal(body, &dlsc) 665 return dlsc, err 666 default: 667 var c Channel 668 err := json.Unmarshal(body, &c) 669 return c, err 670 } 671} 672func unmarshalBasicChannelArray(body []byte) ([]BasicChannel, error) { 673 var rawMessages []*json.RawMessage 674 err := json.Unmarshal(body, &rawMessages) 675 if err != nil { 676 return nil, err 677 } 678 679 cArray := make([]BasicChannel, len(rawMessages)) 680 681 for index, rawMessage := range rawMessages { 682 c, err := unmarshalBasicChannel(*rawMessage) 683 if err != nil { 684 return nil, err 685 } 686 cArray[index] = c 687 } 688 return cArray, nil 689} 690 691// MarshalJSON is the custom marshaler for Channel. 692func (c Channel) MarshalJSON() ([]byte, error) { 693 c.ChannelName = ChannelNameBasicChannelChannelNameChannel 694 objectMap := make(map[string]interface{}) 695 if c.ChannelName != "" { 696 objectMap["channelName"] = c.ChannelName 697 } 698 return json.Marshal(objectMap) 699} 700 701// AsAlexaChannel is the BasicChannel implementation for Channel. 702func (c Channel) AsAlexaChannel() (*AlexaChannel, bool) { 703 return nil, false 704} 705 706// AsFacebookChannel is the BasicChannel implementation for Channel. 707func (c Channel) AsFacebookChannel() (*FacebookChannel, bool) { 708 return nil, false 709} 710 711// AsEmailChannel is the BasicChannel implementation for Channel. 712func (c Channel) AsEmailChannel() (*EmailChannel, bool) { 713 return nil, false 714} 715 716// AsMsTeamsChannel is the BasicChannel implementation for Channel. 717func (c Channel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 718 return nil, false 719} 720 721// AsSkypeChannel is the BasicChannel implementation for Channel. 722func (c Channel) AsSkypeChannel() (*SkypeChannel, bool) { 723 return nil, false 724} 725 726// AsKikChannel is the BasicChannel implementation for Channel. 727func (c Channel) AsKikChannel() (*KikChannel, bool) { 728 return nil, false 729} 730 731// AsWebChatChannel is the BasicChannel implementation for Channel. 732func (c Channel) AsWebChatChannel() (*WebChatChannel, bool) { 733 return nil, false 734} 735 736// AsDirectLineChannel is the BasicChannel implementation for Channel. 737func (c Channel) AsDirectLineChannel() (*DirectLineChannel, bool) { 738 return nil, false 739} 740 741// AsTelegramChannel is the BasicChannel implementation for Channel. 742func (c Channel) AsTelegramChannel() (*TelegramChannel, bool) { 743 return nil, false 744} 745 746// AsSmsChannel is the BasicChannel implementation for Channel. 747func (c Channel) AsSmsChannel() (*SmsChannel, bool) { 748 return nil, false 749} 750 751// AsSlackChannel is the BasicChannel implementation for Channel. 752func (c Channel) AsSlackChannel() (*SlackChannel, bool) { 753 return nil, false 754} 755 756// AsLineChannel is the BasicChannel implementation for Channel. 757func (c Channel) AsLineChannel() (*LineChannel, bool) { 758 return nil, false 759} 760 761// AsDirectLineSpeechChannel is the BasicChannel implementation for Channel. 762func (c Channel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 763 return nil, false 764} 765 766// AsChannel is the BasicChannel implementation for Channel. 767func (c Channel) AsChannel() (*Channel, bool) { 768 return &c, true 769} 770 771// AsBasicChannel is the BasicChannel implementation for Channel. 772func (c Channel) AsBasicChannel() (BasicChannel, bool) { 773 return &c, true 774} 775 776// ChannelResponseList the list of bot service channel operation response. 777type ChannelResponseList struct { 778 autorest.Response `json:"-"` 779 // NextLink - The link used to get the next page of bot service channel resources. 780 NextLink *string `json:"nextLink,omitempty"` 781 // Value - READ-ONLY; Gets the list of bot service channel results and their properties. 782 Value *[]BotChannel `json:"value,omitempty"` 783} 784 785// MarshalJSON is the custom marshaler for ChannelResponseList. 786func (crl ChannelResponseList) MarshalJSON() ([]byte, error) { 787 objectMap := make(map[string]interface{}) 788 if crl.NextLink != nil { 789 objectMap["nextLink"] = crl.NextLink 790 } 791 return json.Marshal(objectMap) 792} 793 794// ChannelResponseListIterator provides access to a complete listing of BotChannel values. 795type ChannelResponseListIterator struct { 796 i int 797 page ChannelResponseListPage 798} 799 800// NextWithContext advances to the next value. If there was an error making 801// the request the iterator does not advance and the error is returned. 802func (iter *ChannelResponseListIterator) NextWithContext(ctx context.Context) (err error) { 803 if tracing.IsEnabled() { 804 ctx = tracing.StartSpan(ctx, fqdn+"/ChannelResponseListIterator.NextWithContext") 805 defer func() { 806 sc := -1 807 if iter.Response().Response.Response != nil { 808 sc = iter.Response().Response.Response.StatusCode 809 } 810 tracing.EndSpan(ctx, sc, err) 811 }() 812 } 813 iter.i++ 814 if iter.i < len(iter.page.Values()) { 815 return nil 816 } 817 err = iter.page.NextWithContext(ctx) 818 if err != nil { 819 iter.i-- 820 return err 821 } 822 iter.i = 0 823 return nil 824} 825 826// Next advances to the next value. If there was an error making 827// the request the iterator does not advance and the error is returned. 828// Deprecated: Use NextWithContext() instead. 829func (iter *ChannelResponseListIterator) Next() error { 830 return iter.NextWithContext(context.Background()) 831} 832 833// NotDone returns true if the enumeration should be started or is not yet complete. 834func (iter ChannelResponseListIterator) NotDone() bool { 835 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 836} 837 838// Response returns the raw server response from the last page request. 839func (iter ChannelResponseListIterator) Response() ChannelResponseList { 840 return iter.page.Response() 841} 842 843// Value returns the current value or a zero-initialized value if the 844// iterator has advanced beyond the end of the collection. 845func (iter ChannelResponseListIterator) Value() BotChannel { 846 if !iter.page.NotDone() { 847 return BotChannel{} 848 } 849 return iter.page.Values()[iter.i] 850} 851 852// Creates a new instance of the ChannelResponseListIterator type. 853func NewChannelResponseListIterator(page ChannelResponseListPage) ChannelResponseListIterator { 854 return ChannelResponseListIterator{page: page} 855} 856 857// IsEmpty returns true if the ListResult contains no values. 858func (crl ChannelResponseList) IsEmpty() bool { 859 return crl.Value == nil || len(*crl.Value) == 0 860} 861 862// hasNextLink returns true if the NextLink is not empty. 863func (crl ChannelResponseList) hasNextLink() bool { 864 return crl.NextLink != nil && len(*crl.NextLink) != 0 865} 866 867// channelResponseListPreparer prepares a request to retrieve the next set of results. 868// It returns nil if no more results exist. 869func (crl ChannelResponseList) channelResponseListPreparer(ctx context.Context) (*http.Request, error) { 870 if !crl.hasNextLink() { 871 return nil, nil 872 } 873 return autorest.Prepare((&http.Request{}).WithContext(ctx), 874 autorest.AsJSON(), 875 autorest.AsGet(), 876 autorest.WithBaseURL(to.String(crl.NextLink))) 877} 878 879// ChannelResponseListPage contains a page of BotChannel values. 880type ChannelResponseListPage struct { 881 fn func(context.Context, ChannelResponseList) (ChannelResponseList, error) 882 crl ChannelResponseList 883} 884 885// NextWithContext advances to the next page of values. If there was an error making 886// the request the page does not advance and the error is returned. 887func (page *ChannelResponseListPage) NextWithContext(ctx context.Context) (err error) { 888 if tracing.IsEnabled() { 889 ctx = tracing.StartSpan(ctx, fqdn+"/ChannelResponseListPage.NextWithContext") 890 defer func() { 891 sc := -1 892 if page.Response().Response.Response != nil { 893 sc = page.Response().Response.Response.StatusCode 894 } 895 tracing.EndSpan(ctx, sc, err) 896 }() 897 } 898 for { 899 next, err := page.fn(ctx, page.crl) 900 if err != nil { 901 return err 902 } 903 page.crl = next 904 if !next.hasNextLink() || !next.IsEmpty() { 905 break 906 } 907 } 908 return nil 909} 910 911// Next advances to the next page of values. If there was an error making 912// the request the page does not advance and the error is returned. 913// Deprecated: Use NextWithContext() instead. 914func (page *ChannelResponseListPage) Next() error { 915 return page.NextWithContext(context.Background()) 916} 917 918// NotDone returns true if the page enumeration should be started or is not yet complete. 919func (page ChannelResponseListPage) NotDone() bool { 920 return !page.crl.IsEmpty() 921} 922 923// Response returns the raw server response from the last page request. 924func (page ChannelResponseListPage) Response() ChannelResponseList { 925 return page.crl 926} 927 928// Values returns the slice of values for the current page or nil if there are no values. 929func (page ChannelResponseListPage) Values() []BotChannel { 930 if page.crl.IsEmpty() { 931 return nil 932 } 933 return *page.crl.Value 934} 935 936// Creates a new instance of the ChannelResponseListPage type. 937func NewChannelResponseListPage(cur ChannelResponseList, getNextPage func(context.Context, ChannelResponseList) (ChannelResponseList, error)) ChannelResponseListPage { 938 return ChannelResponseListPage{ 939 fn: getNextPage, 940 crl: cur, 941 } 942} 943 944// CheckNameAvailabilityRequestBody the request body for a request to Bot Service Management to check 945// availability of a bot name. 946type CheckNameAvailabilityRequestBody struct { 947 // Name - the name of the bot for which availability needs to be checked. 948 Name *string `json:"name,omitempty"` 949 // Type - the type of the bot for which availability needs to be checked 950 Type *string `json:"type,omitempty"` 951} 952 953// CheckNameAvailabilityResponseBody the response body returned for a request to Bot Service Management to 954// check availability of a bot name. 955type CheckNameAvailabilityResponseBody struct { 956 autorest.Response `json:"-"` 957 // Valid - indicates if the bot name is valid. 958 Valid *bool `json:"valid,omitempty"` 959 // Message - additional message from the bot management api showing why a bot name is not available 960 Message *string `json:"message,omitempty"` 961} 962 963// ConnectionItemName the display name of a connection Item Setting registered with the Bot 964type ConnectionItemName struct { 965 // Name - READ-ONLY; Connection Item name that has been added in the API 966 Name *string `json:"name,omitempty"` 967} 968 969// MarshalJSON is the custom marshaler for ConnectionItemName. 970func (cin ConnectionItemName) MarshalJSON() ([]byte, error) { 971 objectMap := make(map[string]interface{}) 972 return json.Marshal(objectMap) 973} 974 975// ConnectionSetting bot channel resource definition 976type ConnectionSetting struct { 977 autorest.Response `json:"-"` 978 // Properties - The set of properties specific to bot channel resource 979 Properties *ConnectionSettingProperties `json:"properties,omitempty"` 980 // ID - READ-ONLY; Specifies the resource ID. 981 ID *string `json:"id,omitempty"` 982 // Name - READ-ONLY; Specifies the name of the resource. 983 Name *string `json:"name,omitempty"` 984 // Location - Specifies the location of the resource. 985 Location *string `json:"location,omitempty"` 986 // Type - READ-ONLY; Specifies the type of the resource. 987 Type *string `json:"type,omitempty"` 988 // Tags - Contains resource tags defined as key/value pairs. 989 Tags map[string]*string `json:"tags"` 990 // Sku - Gets or sets the SKU of the resource. 991 Sku *Sku `json:"sku,omitempty"` 992 // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction', 'KindAzurebot' 993 Kind Kind `json:"kind,omitempty"` 994 // Etag - Entity Tag 995 Etag *string `json:"etag,omitempty"` 996} 997 998// MarshalJSON is the custom marshaler for ConnectionSetting. 999func (cs ConnectionSetting) MarshalJSON() ([]byte, error) { 1000 objectMap := make(map[string]interface{}) 1001 if cs.Properties != nil { 1002 objectMap["properties"] = cs.Properties 1003 } 1004 if cs.Location != nil { 1005 objectMap["location"] = cs.Location 1006 } 1007 if cs.Tags != nil { 1008 objectMap["tags"] = cs.Tags 1009 } 1010 if cs.Sku != nil { 1011 objectMap["sku"] = cs.Sku 1012 } 1013 if cs.Kind != "" { 1014 objectMap["kind"] = cs.Kind 1015 } 1016 if cs.Etag != nil { 1017 objectMap["etag"] = cs.Etag 1018 } 1019 return json.Marshal(objectMap) 1020} 1021 1022// ConnectionSettingParameter extra Parameter in a Connection Setting Properties to indicate service 1023// provider specific properties 1024type ConnectionSettingParameter struct { 1025 // Key - Key for the Connection Setting Parameter. 1026 Key *string `json:"key,omitempty"` 1027 // Value - Value associated with the Connection Setting Parameter. 1028 Value *string `json:"value,omitempty"` 1029} 1030 1031// ConnectionSettingProperties properties for a Connection Setting Item 1032type ConnectionSettingProperties struct { 1033 // ClientID - Client Id associated with the Connection Setting. 1034 ClientID *string `json:"clientId,omitempty"` 1035 // SettingID - READ-ONLY; Setting Id set by the service for the Connection Setting. 1036 SettingID *string `json:"settingId,omitempty"` 1037 // ClientSecret - Client Secret associated with the Connection Setting 1038 ClientSecret *string `json:"clientSecret,omitempty"` 1039 // Scopes - Scopes associated with the Connection Setting 1040 Scopes *string `json:"scopes,omitempty"` 1041 // ServiceProviderID - Service Provider Id associated with the Connection Setting 1042 ServiceProviderID *string `json:"serviceProviderId,omitempty"` 1043 // ServiceProviderDisplayName - Service Provider Display Name associated with the Connection Setting 1044 ServiceProviderDisplayName *string `json:"serviceProviderDisplayName,omitempty"` 1045 // Parameters - Service Provider Parameters associated with the Connection Setting 1046 Parameters *[]ConnectionSettingParameter `json:"parameters,omitempty"` 1047} 1048 1049// MarshalJSON is the custom marshaler for ConnectionSettingProperties. 1050func (csp ConnectionSettingProperties) MarshalJSON() ([]byte, error) { 1051 objectMap := make(map[string]interface{}) 1052 if csp.ClientID != nil { 1053 objectMap["clientId"] = csp.ClientID 1054 } 1055 if csp.ClientSecret != nil { 1056 objectMap["clientSecret"] = csp.ClientSecret 1057 } 1058 if csp.Scopes != nil { 1059 objectMap["scopes"] = csp.Scopes 1060 } 1061 if csp.ServiceProviderID != nil { 1062 objectMap["serviceProviderId"] = csp.ServiceProviderID 1063 } 1064 if csp.ServiceProviderDisplayName != nil { 1065 objectMap["serviceProviderDisplayName"] = csp.ServiceProviderDisplayName 1066 } 1067 if csp.Parameters != nil { 1068 objectMap["parameters"] = csp.Parameters 1069 } 1070 return json.Marshal(objectMap) 1071} 1072 1073// ConnectionSettingResponseList the list of bot service connection settings response. 1074type ConnectionSettingResponseList struct { 1075 autorest.Response `json:"-"` 1076 // NextLink - The link used to get the next page of bot service connection setting resources. 1077 NextLink *string `json:"nextLink,omitempty"` 1078 // Value - READ-ONLY; Gets the list of bot service connection settings and their properties. 1079 Value *[]ConnectionSetting `json:"value,omitempty"` 1080} 1081 1082// MarshalJSON is the custom marshaler for ConnectionSettingResponseList. 1083func (csrl ConnectionSettingResponseList) MarshalJSON() ([]byte, error) { 1084 objectMap := make(map[string]interface{}) 1085 if csrl.NextLink != nil { 1086 objectMap["nextLink"] = csrl.NextLink 1087 } 1088 return json.Marshal(objectMap) 1089} 1090 1091// ConnectionSettingResponseListIterator provides access to a complete listing of ConnectionSetting values. 1092type ConnectionSettingResponseListIterator struct { 1093 i int 1094 page ConnectionSettingResponseListPage 1095} 1096 1097// NextWithContext advances to the next value. If there was an error making 1098// the request the iterator does not advance and the error is returned. 1099func (iter *ConnectionSettingResponseListIterator) NextWithContext(ctx context.Context) (err error) { 1100 if tracing.IsEnabled() { 1101 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionSettingResponseListIterator.NextWithContext") 1102 defer func() { 1103 sc := -1 1104 if iter.Response().Response.Response != nil { 1105 sc = iter.Response().Response.Response.StatusCode 1106 } 1107 tracing.EndSpan(ctx, sc, err) 1108 }() 1109 } 1110 iter.i++ 1111 if iter.i < len(iter.page.Values()) { 1112 return nil 1113 } 1114 err = iter.page.NextWithContext(ctx) 1115 if err != nil { 1116 iter.i-- 1117 return err 1118 } 1119 iter.i = 0 1120 return nil 1121} 1122 1123// Next advances to the next value. If there was an error making 1124// the request the iterator does not advance and the error is returned. 1125// Deprecated: Use NextWithContext() instead. 1126func (iter *ConnectionSettingResponseListIterator) Next() error { 1127 return iter.NextWithContext(context.Background()) 1128} 1129 1130// NotDone returns true if the enumeration should be started or is not yet complete. 1131func (iter ConnectionSettingResponseListIterator) NotDone() bool { 1132 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1133} 1134 1135// Response returns the raw server response from the last page request. 1136func (iter ConnectionSettingResponseListIterator) Response() ConnectionSettingResponseList { 1137 return iter.page.Response() 1138} 1139 1140// Value returns the current value or a zero-initialized value if the 1141// iterator has advanced beyond the end of the collection. 1142func (iter ConnectionSettingResponseListIterator) Value() ConnectionSetting { 1143 if !iter.page.NotDone() { 1144 return ConnectionSetting{} 1145 } 1146 return iter.page.Values()[iter.i] 1147} 1148 1149// Creates a new instance of the ConnectionSettingResponseListIterator type. 1150func NewConnectionSettingResponseListIterator(page ConnectionSettingResponseListPage) ConnectionSettingResponseListIterator { 1151 return ConnectionSettingResponseListIterator{page: page} 1152} 1153 1154// IsEmpty returns true if the ListResult contains no values. 1155func (csrl ConnectionSettingResponseList) IsEmpty() bool { 1156 return csrl.Value == nil || len(*csrl.Value) == 0 1157} 1158 1159// hasNextLink returns true if the NextLink is not empty. 1160func (csrl ConnectionSettingResponseList) hasNextLink() bool { 1161 return csrl.NextLink != nil && len(*csrl.NextLink) != 0 1162} 1163 1164// connectionSettingResponseListPreparer prepares a request to retrieve the next set of results. 1165// It returns nil if no more results exist. 1166func (csrl ConnectionSettingResponseList) connectionSettingResponseListPreparer(ctx context.Context) (*http.Request, error) { 1167 if !csrl.hasNextLink() { 1168 return nil, nil 1169 } 1170 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1171 autorest.AsJSON(), 1172 autorest.AsGet(), 1173 autorest.WithBaseURL(to.String(csrl.NextLink))) 1174} 1175 1176// ConnectionSettingResponseListPage contains a page of ConnectionSetting values. 1177type ConnectionSettingResponseListPage struct { 1178 fn func(context.Context, ConnectionSettingResponseList) (ConnectionSettingResponseList, error) 1179 csrl ConnectionSettingResponseList 1180} 1181 1182// NextWithContext advances to the next page of values. If there was an error making 1183// the request the page does not advance and the error is returned. 1184func (page *ConnectionSettingResponseListPage) NextWithContext(ctx context.Context) (err error) { 1185 if tracing.IsEnabled() { 1186 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionSettingResponseListPage.NextWithContext") 1187 defer func() { 1188 sc := -1 1189 if page.Response().Response.Response != nil { 1190 sc = page.Response().Response.Response.StatusCode 1191 } 1192 tracing.EndSpan(ctx, sc, err) 1193 }() 1194 } 1195 for { 1196 next, err := page.fn(ctx, page.csrl) 1197 if err != nil { 1198 return err 1199 } 1200 page.csrl = next 1201 if !next.hasNextLink() || !next.IsEmpty() { 1202 break 1203 } 1204 } 1205 return nil 1206} 1207 1208// Next advances to the next page of values. If there was an error making 1209// the request the page does not advance and the error is returned. 1210// Deprecated: Use NextWithContext() instead. 1211func (page *ConnectionSettingResponseListPage) Next() error { 1212 return page.NextWithContext(context.Background()) 1213} 1214 1215// NotDone returns true if the page enumeration should be started or is not yet complete. 1216func (page ConnectionSettingResponseListPage) NotDone() bool { 1217 return !page.csrl.IsEmpty() 1218} 1219 1220// Response returns the raw server response from the last page request. 1221func (page ConnectionSettingResponseListPage) Response() ConnectionSettingResponseList { 1222 return page.csrl 1223} 1224 1225// Values returns the slice of values for the current page or nil if there are no values. 1226func (page ConnectionSettingResponseListPage) Values() []ConnectionSetting { 1227 if page.csrl.IsEmpty() { 1228 return nil 1229 } 1230 return *page.csrl.Value 1231} 1232 1233// Creates a new instance of the ConnectionSettingResponseListPage type. 1234func NewConnectionSettingResponseListPage(cur ConnectionSettingResponseList, getNextPage func(context.Context, ConnectionSettingResponseList) (ConnectionSettingResponseList, error)) ConnectionSettingResponseListPage { 1235 return ConnectionSettingResponseListPage{ 1236 fn: getNextPage, 1237 csrl: cur, 1238 } 1239} 1240 1241// DirectLineChannel direct Line channel definition 1242type DirectLineChannel struct { 1243 // Properties - The set of properties specific to Direct Line channel resource 1244 Properties *DirectLineChannelProperties `json:"properties,omitempty"` 1245 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1246 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1247} 1248 1249// MarshalJSON is the custom marshaler for DirectLineChannel. 1250func (dlc DirectLineChannel) MarshalJSON() ([]byte, error) { 1251 dlc.ChannelName = ChannelNameBasicChannelChannelNameDirectLineChannel 1252 objectMap := make(map[string]interface{}) 1253 if dlc.Properties != nil { 1254 objectMap["properties"] = dlc.Properties 1255 } 1256 if dlc.ChannelName != "" { 1257 objectMap["channelName"] = dlc.ChannelName 1258 } 1259 return json.Marshal(objectMap) 1260} 1261 1262// AsAlexaChannel is the BasicChannel implementation for DirectLineChannel. 1263func (dlc DirectLineChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1264 return nil, false 1265} 1266 1267// AsFacebookChannel is the BasicChannel implementation for DirectLineChannel. 1268func (dlc DirectLineChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1269 return nil, false 1270} 1271 1272// AsEmailChannel is the BasicChannel implementation for DirectLineChannel. 1273func (dlc DirectLineChannel) AsEmailChannel() (*EmailChannel, bool) { 1274 return nil, false 1275} 1276 1277// AsMsTeamsChannel is the BasicChannel implementation for DirectLineChannel. 1278func (dlc DirectLineChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1279 return nil, false 1280} 1281 1282// AsSkypeChannel is the BasicChannel implementation for DirectLineChannel. 1283func (dlc DirectLineChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1284 return nil, false 1285} 1286 1287// AsKikChannel is the BasicChannel implementation for DirectLineChannel. 1288func (dlc DirectLineChannel) AsKikChannel() (*KikChannel, bool) { 1289 return nil, false 1290} 1291 1292// AsWebChatChannel is the BasicChannel implementation for DirectLineChannel. 1293func (dlc DirectLineChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1294 return nil, false 1295} 1296 1297// AsDirectLineChannel is the BasicChannel implementation for DirectLineChannel. 1298func (dlc DirectLineChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1299 return &dlc, true 1300} 1301 1302// AsTelegramChannel is the BasicChannel implementation for DirectLineChannel. 1303func (dlc DirectLineChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1304 return nil, false 1305} 1306 1307// AsSmsChannel is the BasicChannel implementation for DirectLineChannel. 1308func (dlc DirectLineChannel) AsSmsChannel() (*SmsChannel, bool) { 1309 return nil, false 1310} 1311 1312// AsSlackChannel is the BasicChannel implementation for DirectLineChannel. 1313func (dlc DirectLineChannel) AsSlackChannel() (*SlackChannel, bool) { 1314 return nil, false 1315} 1316 1317// AsLineChannel is the BasicChannel implementation for DirectLineChannel. 1318func (dlc DirectLineChannel) AsLineChannel() (*LineChannel, bool) { 1319 return nil, false 1320} 1321 1322// AsDirectLineSpeechChannel is the BasicChannel implementation for DirectLineChannel. 1323func (dlc DirectLineChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1324 return nil, false 1325} 1326 1327// AsChannel is the BasicChannel implementation for DirectLineChannel. 1328func (dlc DirectLineChannel) AsChannel() (*Channel, bool) { 1329 return nil, false 1330} 1331 1332// AsBasicChannel is the BasicChannel implementation for DirectLineChannel. 1333func (dlc DirectLineChannel) AsBasicChannel() (BasicChannel, bool) { 1334 return &dlc, true 1335} 1336 1337// DirectLineChannelProperties the parameters to provide for the Direct Line channel. 1338type DirectLineChannelProperties struct { 1339 // Sites - The list of Direct Line sites 1340 Sites *[]DirectLineSite `json:"sites,omitempty"` 1341} 1342 1343// DirectLineSite a site for the Direct Line channel 1344type DirectLineSite struct { 1345 // SiteID - READ-ONLY; Site Id 1346 SiteID *string `json:"siteId,omitempty"` 1347 // SiteName - Site name 1348 SiteName *string `json:"siteName,omitempty"` 1349 // Key - READ-ONLY; Primary key. Value only returned through POST to the action Channel List API, otherwise empty. 1350 Key *string `json:"key,omitempty"` 1351 // Key2 - READ-ONLY; Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. 1352 Key2 *string `json:"key2,omitempty"` 1353 // IsEnabled - Whether this site is enabled for DirectLine channel. 1354 IsEnabled *bool `json:"isEnabled,omitempty"` 1355 // IsV1Enabled - Whether this site is enabled for Bot Framework V1 protocol. 1356 IsV1Enabled *bool `json:"isV1Enabled,omitempty"` 1357 // IsV3Enabled - Whether this site is enabled for Bot Framework V1 protocol. 1358 IsV3Enabled *bool `json:"isV3Enabled,omitempty"` 1359 // IsSecureSiteEnabled - Whether this site is enabled for authentication with Bot Framework. 1360 IsSecureSiteEnabled *bool `json:"isSecureSiteEnabled,omitempty"` 1361 // TrustedOrigins - List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. 1362 TrustedOrigins *[]string `json:"trustedOrigins,omitempty"` 1363} 1364 1365// MarshalJSON is the custom marshaler for DirectLineSite. 1366func (dls DirectLineSite) MarshalJSON() ([]byte, error) { 1367 objectMap := make(map[string]interface{}) 1368 if dls.SiteName != nil { 1369 objectMap["siteName"] = dls.SiteName 1370 } 1371 if dls.IsEnabled != nil { 1372 objectMap["isEnabled"] = dls.IsEnabled 1373 } 1374 if dls.IsV1Enabled != nil { 1375 objectMap["isV1Enabled"] = dls.IsV1Enabled 1376 } 1377 if dls.IsV3Enabled != nil { 1378 objectMap["isV3Enabled"] = dls.IsV3Enabled 1379 } 1380 if dls.IsSecureSiteEnabled != nil { 1381 objectMap["isSecureSiteEnabled"] = dls.IsSecureSiteEnabled 1382 } 1383 if dls.TrustedOrigins != nil { 1384 objectMap["trustedOrigins"] = dls.TrustedOrigins 1385 } 1386 return json.Marshal(objectMap) 1387} 1388 1389// DirectLineSpeechChannel directLine Speech channel definition 1390type DirectLineSpeechChannel struct { 1391 // Properties - The set of properties specific to DirectLine Speech channel resource 1392 Properties *DirectLineSpeechChannelProperties `json:"properties,omitempty"` 1393 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1394 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1395} 1396 1397// MarshalJSON is the custom marshaler for DirectLineSpeechChannel. 1398func (dlsc DirectLineSpeechChannel) MarshalJSON() ([]byte, error) { 1399 dlsc.ChannelName = ChannelNameBasicChannelChannelNameDirectLineSpeechChannel 1400 objectMap := make(map[string]interface{}) 1401 if dlsc.Properties != nil { 1402 objectMap["properties"] = dlsc.Properties 1403 } 1404 if dlsc.ChannelName != "" { 1405 objectMap["channelName"] = dlsc.ChannelName 1406 } 1407 return json.Marshal(objectMap) 1408} 1409 1410// AsAlexaChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1411func (dlsc DirectLineSpeechChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1412 return nil, false 1413} 1414 1415// AsFacebookChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1416func (dlsc DirectLineSpeechChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1417 return nil, false 1418} 1419 1420// AsEmailChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1421func (dlsc DirectLineSpeechChannel) AsEmailChannel() (*EmailChannel, bool) { 1422 return nil, false 1423} 1424 1425// AsMsTeamsChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1426func (dlsc DirectLineSpeechChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1427 return nil, false 1428} 1429 1430// AsSkypeChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1431func (dlsc DirectLineSpeechChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1432 return nil, false 1433} 1434 1435// AsKikChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1436func (dlsc DirectLineSpeechChannel) AsKikChannel() (*KikChannel, bool) { 1437 return nil, false 1438} 1439 1440// AsWebChatChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1441func (dlsc DirectLineSpeechChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1442 return nil, false 1443} 1444 1445// AsDirectLineChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1446func (dlsc DirectLineSpeechChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1447 return nil, false 1448} 1449 1450// AsTelegramChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1451func (dlsc DirectLineSpeechChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1452 return nil, false 1453} 1454 1455// AsSmsChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1456func (dlsc DirectLineSpeechChannel) AsSmsChannel() (*SmsChannel, bool) { 1457 return nil, false 1458} 1459 1460// AsSlackChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1461func (dlsc DirectLineSpeechChannel) AsSlackChannel() (*SlackChannel, bool) { 1462 return nil, false 1463} 1464 1465// AsLineChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1466func (dlsc DirectLineSpeechChannel) AsLineChannel() (*LineChannel, bool) { 1467 return nil, false 1468} 1469 1470// AsDirectLineSpeechChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1471func (dlsc DirectLineSpeechChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1472 return &dlsc, true 1473} 1474 1475// AsChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1476func (dlsc DirectLineSpeechChannel) AsChannel() (*Channel, bool) { 1477 return nil, false 1478} 1479 1480// AsBasicChannel is the BasicChannel implementation for DirectLineSpeechChannel. 1481func (dlsc DirectLineSpeechChannel) AsBasicChannel() (BasicChannel, bool) { 1482 return &dlsc, true 1483} 1484 1485// DirectLineSpeechChannelProperties the parameters to provide for the DirectLine Speech channel. 1486type DirectLineSpeechChannelProperties struct { 1487 // CognitiveServiceRegion - The cognitive service region with this channel registration. 1488 CognitiveServiceRegion *string `json:"cognitiveServiceRegion,omitempty"` 1489 // CognitiveServiceSubscriptionKey - The cognitive service subscription key to use with this channel registration. 1490 CognitiveServiceSubscriptionKey *string `json:"cognitiveServiceSubscriptionKey,omitempty"` 1491 // IsEnabled - Whether this channel is enabled or not. 1492 IsEnabled *bool `json:"isEnabled,omitempty"` 1493 // CustomVoiceDeploymentID - Custom speech model id (optional). 1494 CustomVoiceDeploymentID *string `json:"customVoiceDeploymentId,omitempty"` 1495 // CustomSpeechModelID - Custom voice deployment id (optional). 1496 CustomSpeechModelID *string `json:"customSpeechModelId,omitempty"` 1497 // IsDefaultBotForCogSvcAccount - Make this a default bot for chosen cognitive service account. 1498 IsDefaultBotForCogSvcAccount *bool `json:"isDefaultBotForCogSvcAccount,omitempty"` 1499} 1500 1501// EmailChannel email channel definition 1502type EmailChannel struct { 1503 // Properties - The set of properties specific to email channel resource 1504 Properties *EmailChannelProperties `json:"properties,omitempty"` 1505 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1506 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1507} 1508 1509// MarshalJSON is the custom marshaler for EmailChannel. 1510func (ec EmailChannel) MarshalJSON() ([]byte, error) { 1511 ec.ChannelName = ChannelNameBasicChannelChannelNameEmailChannel 1512 objectMap := make(map[string]interface{}) 1513 if ec.Properties != nil { 1514 objectMap["properties"] = ec.Properties 1515 } 1516 if ec.ChannelName != "" { 1517 objectMap["channelName"] = ec.ChannelName 1518 } 1519 return json.Marshal(objectMap) 1520} 1521 1522// AsAlexaChannel is the BasicChannel implementation for EmailChannel. 1523func (ec EmailChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1524 return nil, false 1525} 1526 1527// AsFacebookChannel is the BasicChannel implementation for EmailChannel. 1528func (ec EmailChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1529 return nil, false 1530} 1531 1532// AsEmailChannel is the BasicChannel implementation for EmailChannel. 1533func (ec EmailChannel) AsEmailChannel() (*EmailChannel, bool) { 1534 return &ec, true 1535} 1536 1537// AsMsTeamsChannel is the BasicChannel implementation for EmailChannel. 1538func (ec EmailChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1539 return nil, false 1540} 1541 1542// AsSkypeChannel is the BasicChannel implementation for EmailChannel. 1543func (ec EmailChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1544 return nil, false 1545} 1546 1547// AsKikChannel is the BasicChannel implementation for EmailChannel. 1548func (ec EmailChannel) AsKikChannel() (*KikChannel, bool) { 1549 return nil, false 1550} 1551 1552// AsWebChatChannel is the BasicChannel implementation for EmailChannel. 1553func (ec EmailChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1554 return nil, false 1555} 1556 1557// AsDirectLineChannel is the BasicChannel implementation for EmailChannel. 1558func (ec EmailChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1559 return nil, false 1560} 1561 1562// AsTelegramChannel is the BasicChannel implementation for EmailChannel. 1563func (ec EmailChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1564 return nil, false 1565} 1566 1567// AsSmsChannel is the BasicChannel implementation for EmailChannel. 1568func (ec EmailChannel) AsSmsChannel() (*SmsChannel, bool) { 1569 return nil, false 1570} 1571 1572// AsSlackChannel is the BasicChannel implementation for EmailChannel. 1573func (ec EmailChannel) AsSlackChannel() (*SlackChannel, bool) { 1574 return nil, false 1575} 1576 1577// AsLineChannel is the BasicChannel implementation for EmailChannel. 1578func (ec EmailChannel) AsLineChannel() (*LineChannel, bool) { 1579 return nil, false 1580} 1581 1582// AsDirectLineSpeechChannel is the BasicChannel implementation for EmailChannel. 1583func (ec EmailChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1584 return nil, false 1585} 1586 1587// AsChannel is the BasicChannel implementation for EmailChannel. 1588func (ec EmailChannel) AsChannel() (*Channel, bool) { 1589 return nil, false 1590} 1591 1592// AsBasicChannel is the BasicChannel implementation for EmailChannel. 1593func (ec EmailChannel) AsBasicChannel() (BasicChannel, bool) { 1594 return &ec, true 1595} 1596 1597// EmailChannelProperties the parameters to provide for the Email channel. 1598type EmailChannelProperties struct { 1599 // EmailAddress - The email address 1600 EmailAddress *string `json:"emailAddress,omitempty"` 1601 // Password - The password for the email address. Value only returned through POST to the action Channel List API, otherwise empty. 1602 Password *string `json:"password,omitempty"` 1603 // IsEnabled - Whether this channel is enabled for the bot 1604 IsEnabled *bool `json:"isEnabled,omitempty"` 1605} 1606 1607// Error bot Service error object. 1608type Error struct { 1609 // Error - The error body. 1610 Error *ErrorBody `json:"error,omitempty"` 1611} 1612 1613// ErrorBody bot Service error body. 1614type ErrorBody struct { 1615 // Code - error code 1616 Code *string `json:"code,omitempty"` 1617 // Message - error message 1618 Message *string `json:"message,omitempty"` 1619} 1620 1621// FacebookChannel facebook channel definition 1622type FacebookChannel struct { 1623 // Properties - The set of properties specific to bot facebook channel 1624 Properties *FacebookChannelProperties `json:"properties,omitempty"` 1625 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1626 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1627} 1628 1629// MarshalJSON is the custom marshaler for FacebookChannel. 1630func (fc FacebookChannel) MarshalJSON() ([]byte, error) { 1631 fc.ChannelName = ChannelNameBasicChannelChannelNameFacebookChannel 1632 objectMap := make(map[string]interface{}) 1633 if fc.Properties != nil { 1634 objectMap["properties"] = fc.Properties 1635 } 1636 if fc.ChannelName != "" { 1637 objectMap["channelName"] = fc.ChannelName 1638 } 1639 return json.Marshal(objectMap) 1640} 1641 1642// AsAlexaChannel is the BasicChannel implementation for FacebookChannel. 1643func (fc FacebookChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1644 return nil, false 1645} 1646 1647// AsFacebookChannel is the BasicChannel implementation for FacebookChannel. 1648func (fc FacebookChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1649 return &fc, true 1650} 1651 1652// AsEmailChannel is the BasicChannel implementation for FacebookChannel. 1653func (fc FacebookChannel) AsEmailChannel() (*EmailChannel, bool) { 1654 return nil, false 1655} 1656 1657// AsMsTeamsChannel is the BasicChannel implementation for FacebookChannel. 1658func (fc FacebookChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1659 return nil, false 1660} 1661 1662// AsSkypeChannel is the BasicChannel implementation for FacebookChannel. 1663func (fc FacebookChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1664 return nil, false 1665} 1666 1667// AsKikChannel is the BasicChannel implementation for FacebookChannel. 1668func (fc FacebookChannel) AsKikChannel() (*KikChannel, bool) { 1669 return nil, false 1670} 1671 1672// AsWebChatChannel is the BasicChannel implementation for FacebookChannel. 1673func (fc FacebookChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1674 return nil, false 1675} 1676 1677// AsDirectLineChannel is the BasicChannel implementation for FacebookChannel. 1678func (fc FacebookChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1679 return nil, false 1680} 1681 1682// AsTelegramChannel is the BasicChannel implementation for FacebookChannel. 1683func (fc FacebookChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1684 return nil, false 1685} 1686 1687// AsSmsChannel is the BasicChannel implementation for FacebookChannel. 1688func (fc FacebookChannel) AsSmsChannel() (*SmsChannel, bool) { 1689 return nil, false 1690} 1691 1692// AsSlackChannel is the BasicChannel implementation for FacebookChannel. 1693func (fc FacebookChannel) AsSlackChannel() (*SlackChannel, bool) { 1694 return nil, false 1695} 1696 1697// AsLineChannel is the BasicChannel implementation for FacebookChannel. 1698func (fc FacebookChannel) AsLineChannel() (*LineChannel, bool) { 1699 return nil, false 1700} 1701 1702// AsDirectLineSpeechChannel is the BasicChannel implementation for FacebookChannel. 1703func (fc FacebookChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1704 return nil, false 1705} 1706 1707// AsChannel is the BasicChannel implementation for FacebookChannel. 1708func (fc FacebookChannel) AsChannel() (*Channel, bool) { 1709 return nil, false 1710} 1711 1712// AsBasicChannel is the BasicChannel implementation for FacebookChannel. 1713func (fc FacebookChannel) AsBasicChannel() (BasicChannel, bool) { 1714 return &fc, true 1715} 1716 1717// FacebookChannelProperties the parameters to provide for the Facebook channel. 1718type FacebookChannelProperties struct { 1719 // VerifyToken - READ-ONLY; Verify token. Value only returned through POST to the action Channel List API, otherwise empty. 1720 VerifyToken *string `json:"verifyToken,omitempty"` 1721 // Pages - The list of Facebook pages 1722 Pages *[]FacebookPage `json:"pages,omitempty"` 1723 // AppID - Facebook application id 1724 AppID *string `json:"appId,omitempty"` 1725 // AppSecret - Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty. 1726 AppSecret *string `json:"appSecret,omitempty"` 1727 // CallbackURL - READ-ONLY; Callback Url 1728 CallbackURL *string `json:"callbackUrl,omitempty"` 1729 // IsEnabled - Whether this channel is enabled for the bot 1730 IsEnabled *bool `json:"isEnabled,omitempty"` 1731} 1732 1733// MarshalJSON is the custom marshaler for FacebookChannelProperties. 1734func (fcp FacebookChannelProperties) MarshalJSON() ([]byte, error) { 1735 objectMap := make(map[string]interface{}) 1736 if fcp.Pages != nil { 1737 objectMap["pages"] = fcp.Pages 1738 } 1739 if fcp.AppID != nil { 1740 objectMap["appId"] = fcp.AppID 1741 } 1742 if fcp.AppSecret != nil { 1743 objectMap["appSecret"] = fcp.AppSecret 1744 } 1745 if fcp.IsEnabled != nil { 1746 objectMap["isEnabled"] = fcp.IsEnabled 1747 } 1748 return json.Marshal(objectMap) 1749} 1750 1751// FacebookPage a Facebook page for Facebook channel registration 1752type FacebookPage struct { 1753 // ID - Page id 1754 ID *string `json:"id,omitempty"` 1755 // AccessToken - Facebook application access token. Value only returned through POST to the action Channel List API, otherwise empty. 1756 AccessToken *string `json:"accessToken,omitempty"` 1757} 1758 1759// HostSettingsResponse the response body returned for a request to Bot Service Management to check per 1760// subscription hostSettings 1761type HostSettingsResponse struct { 1762 autorest.Response `json:"-"` 1763 // OAuthURL - For in-conversation bot user authentication 1764 OAuthURL *string `json:"OAuthUrl,omitempty"` 1765 // ToBotFromChannelOpenIDMetadataURL - For verifying incoming tokens from the channels 1766 ToBotFromChannelOpenIDMetadataURL *string `json:"ToBotFromChannelOpenIdMetadataUrl,omitempty"` 1767 // ToBotFromChannelTokenIssuer - For verifying incoming tokens from the channels 1768 ToBotFromChannelTokenIssuer *string `json:"ToBotFromChannelTokenIssuer,omitempty"` 1769 // ToBotFromEmulatorOpenIDMetadataURL - For verifying incoming tokens from bot emulator 1770 ToBotFromEmulatorOpenIDMetadataURL *string `json:"ToBotFromEmulatorOpenIdMetadataUrl,omitempty"` 1771 // ToChannelFromBotLoginURL - For getting access token to channels from bot host 1772 ToChannelFromBotLoginURL *string `json:"ToChannelFromBotLoginUrl,omitempty"` 1773 // ToChannelFromBotOAuthScope - For getting access token to channels from bot host 1774 ToChannelFromBotOAuthScope *string `json:"ToChannelFromBotOAuthScope,omitempty"` 1775 // ValidateAuthority - Per cloud OAuth setting on whether authority is validated 1776 ValidateAuthority *bool `json:"ValidateAuthority,omitempty"` 1777 // BotOpenIDMetadata - Same as ToBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12 1778 BotOpenIDMetadata *string `json:"BotOpenIdMetadata,omitempty"` 1779} 1780 1781// KikChannel kik channel definition 1782type KikChannel struct { 1783 // Properties - The set of properties specific to Kik channel resource 1784 Properties *KikChannelProperties `json:"properties,omitempty"` 1785 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1786 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1787} 1788 1789// MarshalJSON is the custom marshaler for KikChannel. 1790func (kc KikChannel) MarshalJSON() ([]byte, error) { 1791 kc.ChannelName = ChannelNameBasicChannelChannelNameKikChannel 1792 objectMap := make(map[string]interface{}) 1793 if kc.Properties != nil { 1794 objectMap["properties"] = kc.Properties 1795 } 1796 if kc.ChannelName != "" { 1797 objectMap["channelName"] = kc.ChannelName 1798 } 1799 return json.Marshal(objectMap) 1800} 1801 1802// AsAlexaChannel is the BasicChannel implementation for KikChannel. 1803func (kc KikChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1804 return nil, false 1805} 1806 1807// AsFacebookChannel is the BasicChannel implementation for KikChannel. 1808func (kc KikChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1809 return nil, false 1810} 1811 1812// AsEmailChannel is the BasicChannel implementation for KikChannel. 1813func (kc KikChannel) AsEmailChannel() (*EmailChannel, bool) { 1814 return nil, false 1815} 1816 1817// AsMsTeamsChannel is the BasicChannel implementation for KikChannel. 1818func (kc KikChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1819 return nil, false 1820} 1821 1822// AsSkypeChannel is the BasicChannel implementation for KikChannel. 1823func (kc KikChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1824 return nil, false 1825} 1826 1827// AsKikChannel is the BasicChannel implementation for KikChannel. 1828func (kc KikChannel) AsKikChannel() (*KikChannel, bool) { 1829 return &kc, true 1830} 1831 1832// AsWebChatChannel is the BasicChannel implementation for KikChannel. 1833func (kc KikChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1834 return nil, false 1835} 1836 1837// AsDirectLineChannel is the BasicChannel implementation for KikChannel. 1838func (kc KikChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1839 return nil, false 1840} 1841 1842// AsTelegramChannel is the BasicChannel implementation for KikChannel. 1843func (kc KikChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1844 return nil, false 1845} 1846 1847// AsSmsChannel is the BasicChannel implementation for KikChannel. 1848func (kc KikChannel) AsSmsChannel() (*SmsChannel, bool) { 1849 return nil, false 1850} 1851 1852// AsSlackChannel is the BasicChannel implementation for KikChannel. 1853func (kc KikChannel) AsSlackChannel() (*SlackChannel, bool) { 1854 return nil, false 1855} 1856 1857// AsLineChannel is the BasicChannel implementation for KikChannel. 1858func (kc KikChannel) AsLineChannel() (*LineChannel, bool) { 1859 return nil, false 1860} 1861 1862// AsDirectLineSpeechChannel is the BasicChannel implementation for KikChannel. 1863func (kc KikChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1864 return nil, false 1865} 1866 1867// AsChannel is the BasicChannel implementation for KikChannel. 1868func (kc KikChannel) AsChannel() (*Channel, bool) { 1869 return nil, false 1870} 1871 1872// AsBasicChannel is the BasicChannel implementation for KikChannel. 1873func (kc KikChannel) AsBasicChannel() (BasicChannel, bool) { 1874 return &kc, true 1875} 1876 1877// KikChannelProperties the parameters to provide for the Kik channel. 1878type KikChannelProperties struct { 1879 // UserName - The Kik user name 1880 UserName *string `json:"userName,omitempty"` 1881 // APIKey - Kik API key. Value only returned through POST to the action Channel List API, otherwise empty. 1882 APIKey *string `json:"apiKey,omitempty"` 1883 // IsValidated - Whether this channel is validated for the bot 1884 IsValidated *bool `json:"isValidated,omitempty"` 1885 // IsEnabled - Whether this channel is enabled for the bot 1886 IsEnabled *bool `json:"isEnabled,omitempty"` 1887} 1888 1889// LineChannel line channel definition 1890type LineChannel struct { 1891 // Properties - The set of properties specific to line channel resource 1892 Properties *LineChannelProperties `json:"properties,omitempty"` 1893 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 1894 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 1895} 1896 1897// MarshalJSON is the custom marshaler for LineChannel. 1898func (lc LineChannel) MarshalJSON() ([]byte, error) { 1899 lc.ChannelName = ChannelNameBasicChannelChannelNameLineChannel 1900 objectMap := make(map[string]interface{}) 1901 if lc.Properties != nil { 1902 objectMap["properties"] = lc.Properties 1903 } 1904 if lc.ChannelName != "" { 1905 objectMap["channelName"] = lc.ChannelName 1906 } 1907 return json.Marshal(objectMap) 1908} 1909 1910// AsAlexaChannel is the BasicChannel implementation for LineChannel. 1911func (lc LineChannel) AsAlexaChannel() (*AlexaChannel, bool) { 1912 return nil, false 1913} 1914 1915// AsFacebookChannel is the BasicChannel implementation for LineChannel. 1916func (lc LineChannel) AsFacebookChannel() (*FacebookChannel, bool) { 1917 return nil, false 1918} 1919 1920// AsEmailChannel is the BasicChannel implementation for LineChannel. 1921func (lc LineChannel) AsEmailChannel() (*EmailChannel, bool) { 1922 return nil, false 1923} 1924 1925// AsMsTeamsChannel is the BasicChannel implementation for LineChannel. 1926func (lc LineChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 1927 return nil, false 1928} 1929 1930// AsSkypeChannel is the BasicChannel implementation for LineChannel. 1931func (lc LineChannel) AsSkypeChannel() (*SkypeChannel, bool) { 1932 return nil, false 1933} 1934 1935// AsKikChannel is the BasicChannel implementation for LineChannel. 1936func (lc LineChannel) AsKikChannel() (*KikChannel, bool) { 1937 return nil, false 1938} 1939 1940// AsWebChatChannel is the BasicChannel implementation for LineChannel. 1941func (lc LineChannel) AsWebChatChannel() (*WebChatChannel, bool) { 1942 return nil, false 1943} 1944 1945// AsDirectLineChannel is the BasicChannel implementation for LineChannel. 1946func (lc LineChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 1947 return nil, false 1948} 1949 1950// AsTelegramChannel is the BasicChannel implementation for LineChannel. 1951func (lc LineChannel) AsTelegramChannel() (*TelegramChannel, bool) { 1952 return nil, false 1953} 1954 1955// AsSmsChannel is the BasicChannel implementation for LineChannel. 1956func (lc LineChannel) AsSmsChannel() (*SmsChannel, bool) { 1957 return nil, false 1958} 1959 1960// AsSlackChannel is the BasicChannel implementation for LineChannel. 1961func (lc LineChannel) AsSlackChannel() (*SlackChannel, bool) { 1962 return nil, false 1963} 1964 1965// AsLineChannel is the BasicChannel implementation for LineChannel. 1966func (lc LineChannel) AsLineChannel() (*LineChannel, bool) { 1967 return &lc, true 1968} 1969 1970// AsDirectLineSpeechChannel is the BasicChannel implementation for LineChannel. 1971func (lc LineChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 1972 return nil, false 1973} 1974 1975// AsChannel is the BasicChannel implementation for LineChannel. 1976func (lc LineChannel) AsChannel() (*Channel, bool) { 1977 return nil, false 1978} 1979 1980// AsBasicChannel is the BasicChannel implementation for LineChannel. 1981func (lc LineChannel) AsBasicChannel() (BasicChannel, bool) { 1982 return &lc, true 1983} 1984 1985// LineChannelProperties the parameters to provide for the Line channel. 1986type LineChannelProperties struct { 1987 // LineRegistrations - The list of line channel registrations 1988 LineRegistrations *[]LineRegistration `json:"lineRegistrations,omitempty"` 1989 // CallbackURL - READ-ONLY; Callback Url to enter in line registration. 1990 CallbackURL *string `json:"callbackUrl,omitempty"` 1991 // IsValidated - READ-ONLY; Whether this channel is validated for the bot 1992 IsValidated *bool `json:"isValidated,omitempty"` 1993} 1994 1995// MarshalJSON is the custom marshaler for LineChannelProperties. 1996func (lcp LineChannelProperties) MarshalJSON() ([]byte, error) { 1997 objectMap := make(map[string]interface{}) 1998 if lcp.LineRegistrations != nil { 1999 objectMap["lineRegistrations"] = lcp.LineRegistrations 2000 } 2001 return json.Marshal(objectMap) 2002} 2003 2004// LineRegistration the properties corresponding to a line channel registration 2005type LineRegistration struct { 2006 // GeneratedID - READ-ONLY; Id generated for the line channel registration 2007 GeneratedID *string `json:"generatedId,omitempty"` 2008 // ChannelSecret - Secret for the line channel registration 2009 ChannelSecret *string `json:"channelSecret,omitempty"` 2010 // ChannelAccessToken - Access token for the line channel registration 2011 ChannelAccessToken *string `json:"channelAccessToken,omitempty"` 2012} 2013 2014// MarshalJSON is the custom marshaler for LineRegistration. 2015func (lr LineRegistration) MarshalJSON() ([]byte, error) { 2016 objectMap := make(map[string]interface{}) 2017 if lr.ChannelSecret != nil { 2018 objectMap["channelSecret"] = lr.ChannelSecret 2019 } 2020 if lr.ChannelAccessToken != nil { 2021 objectMap["channelAccessToken"] = lr.ChannelAccessToken 2022 } 2023 return json.Marshal(objectMap) 2024} 2025 2026// MsTeamsChannel microsoft Teams channel definition 2027type MsTeamsChannel struct { 2028 // Properties - The set of properties specific to Microsoft Teams channel resource 2029 Properties *MsTeamsChannelProperties `json:"properties,omitempty"` 2030 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2031 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2032} 2033 2034// MarshalJSON is the custom marshaler for MsTeamsChannel. 2035func (mtc MsTeamsChannel) MarshalJSON() ([]byte, error) { 2036 mtc.ChannelName = ChannelNameBasicChannelChannelNameMsTeamsChannel 2037 objectMap := make(map[string]interface{}) 2038 if mtc.Properties != nil { 2039 objectMap["properties"] = mtc.Properties 2040 } 2041 if mtc.ChannelName != "" { 2042 objectMap["channelName"] = mtc.ChannelName 2043 } 2044 return json.Marshal(objectMap) 2045} 2046 2047// AsAlexaChannel is the BasicChannel implementation for MsTeamsChannel. 2048func (mtc MsTeamsChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2049 return nil, false 2050} 2051 2052// AsFacebookChannel is the BasicChannel implementation for MsTeamsChannel. 2053func (mtc MsTeamsChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2054 return nil, false 2055} 2056 2057// AsEmailChannel is the BasicChannel implementation for MsTeamsChannel. 2058func (mtc MsTeamsChannel) AsEmailChannel() (*EmailChannel, bool) { 2059 return nil, false 2060} 2061 2062// AsMsTeamsChannel is the BasicChannel implementation for MsTeamsChannel. 2063func (mtc MsTeamsChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2064 return &mtc, true 2065} 2066 2067// AsSkypeChannel is the BasicChannel implementation for MsTeamsChannel. 2068func (mtc MsTeamsChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2069 return nil, false 2070} 2071 2072// AsKikChannel is the BasicChannel implementation for MsTeamsChannel. 2073func (mtc MsTeamsChannel) AsKikChannel() (*KikChannel, bool) { 2074 return nil, false 2075} 2076 2077// AsWebChatChannel is the BasicChannel implementation for MsTeamsChannel. 2078func (mtc MsTeamsChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2079 return nil, false 2080} 2081 2082// AsDirectLineChannel is the BasicChannel implementation for MsTeamsChannel. 2083func (mtc MsTeamsChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2084 return nil, false 2085} 2086 2087// AsTelegramChannel is the BasicChannel implementation for MsTeamsChannel. 2088func (mtc MsTeamsChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2089 return nil, false 2090} 2091 2092// AsSmsChannel is the BasicChannel implementation for MsTeamsChannel. 2093func (mtc MsTeamsChannel) AsSmsChannel() (*SmsChannel, bool) { 2094 return nil, false 2095} 2096 2097// AsSlackChannel is the BasicChannel implementation for MsTeamsChannel. 2098func (mtc MsTeamsChannel) AsSlackChannel() (*SlackChannel, bool) { 2099 return nil, false 2100} 2101 2102// AsLineChannel is the BasicChannel implementation for MsTeamsChannel. 2103func (mtc MsTeamsChannel) AsLineChannel() (*LineChannel, bool) { 2104 return nil, false 2105} 2106 2107// AsDirectLineSpeechChannel is the BasicChannel implementation for MsTeamsChannel. 2108func (mtc MsTeamsChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 2109 return nil, false 2110} 2111 2112// AsChannel is the BasicChannel implementation for MsTeamsChannel. 2113func (mtc MsTeamsChannel) AsChannel() (*Channel, bool) { 2114 return nil, false 2115} 2116 2117// AsBasicChannel is the BasicChannel implementation for MsTeamsChannel. 2118func (mtc MsTeamsChannel) AsBasicChannel() (BasicChannel, bool) { 2119 return &mtc, true 2120} 2121 2122// MsTeamsChannelProperties the parameters to provide for the Microsoft Teams channel. 2123type MsTeamsChannelProperties struct { 2124 // EnableCalling - Enable calling for Microsoft Teams channel 2125 EnableCalling *bool `json:"enableCalling,omitempty"` 2126 // CallingWebHook - Webhook for Microsoft Teams channel calls 2127 CallingWebHook *string `json:"callingWebHook,omitempty"` 2128 // IsEnabled - Whether this channel is enabled for the bot 2129 IsEnabled *bool `json:"isEnabled,omitempty"` 2130} 2131 2132// OperationDisplayInfo the operation supported by Bot Service Management. 2133type OperationDisplayInfo struct { 2134 // Description - The description of the operation. 2135 Description *string `json:"description,omitempty"` 2136 // Operation - The action that users can perform, based on their permission level. 2137 Operation *string `json:"operation,omitempty"` 2138 // Provider - Service provider: Microsoft Bot Service. 2139 Provider *string `json:"provider,omitempty"` 2140 // Resource - Resource on which the operation is performed. 2141 Resource *string `json:"resource,omitempty"` 2142} 2143 2144// OperationEntity the operations supported by Bot Service Management. 2145type OperationEntity struct { 2146 // Name - Operation name: {provider}/{resource}/{operation}. 2147 Name *string `json:"name,omitempty"` 2148 // Display - The operation supported by Bot Service Management. 2149 Display *OperationDisplayInfo `json:"display,omitempty"` 2150 // Origin - The origin of the operation. 2151 Origin *string `json:"origin,omitempty"` 2152 // Properties - Additional properties. 2153 Properties interface{} `json:"properties,omitempty"` 2154} 2155 2156// OperationEntityListResult the list of bot service operation response. 2157type OperationEntityListResult struct { 2158 autorest.Response `json:"-"` 2159 // NextLink - The link used to get the next page of operations. 2160 NextLink *string `json:"nextLink,omitempty"` 2161 // Value - The list of operations. 2162 Value *[]OperationEntity `json:"value,omitempty"` 2163} 2164 2165// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values. 2166type OperationEntityListResultIterator struct { 2167 i int 2168 page OperationEntityListResultPage 2169} 2170 2171// NextWithContext advances to the next value. If there was an error making 2172// the request the iterator does not advance and the error is returned. 2173func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) { 2174 if tracing.IsEnabled() { 2175 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext") 2176 defer func() { 2177 sc := -1 2178 if iter.Response().Response.Response != nil { 2179 sc = iter.Response().Response.Response.StatusCode 2180 } 2181 tracing.EndSpan(ctx, sc, err) 2182 }() 2183 } 2184 iter.i++ 2185 if iter.i < len(iter.page.Values()) { 2186 return nil 2187 } 2188 err = iter.page.NextWithContext(ctx) 2189 if err != nil { 2190 iter.i-- 2191 return err 2192 } 2193 iter.i = 0 2194 return nil 2195} 2196 2197// Next advances to the next value. If there was an error making 2198// the request the iterator does not advance and the error is returned. 2199// Deprecated: Use NextWithContext() instead. 2200func (iter *OperationEntityListResultIterator) Next() error { 2201 return iter.NextWithContext(context.Background()) 2202} 2203 2204// NotDone returns true if the enumeration should be started or is not yet complete. 2205func (iter OperationEntityListResultIterator) NotDone() bool { 2206 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2207} 2208 2209// Response returns the raw server response from the last page request. 2210func (iter OperationEntityListResultIterator) Response() OperationEntityListResult { 2211 return iter.page.Response() 2212} 2213 2214// Value returns the current value or a zero-initialized value if the 2215// iterator has advanced beyond the end of the collection. 2216func (iter OperationEntityListResultIterator) Value() OperationEntity { 2217 if !iter.page.NotDone() { 2218 return OperationEntity{} 2219 } 2220 return iter.page.Values()[iter.i] 2221} 2222 2223// Creates a new instance of the OperationEntityListResultIterator type. 2224func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { 2225 return OperationEntityListResultIterator{page: page} 2226} 2227 2228// IsEmpty returns true if the ListResult contains no values. 2229func (oelr OperationEntityListResult) IsEmpty() bool { 2230 return oelr.Value == nil || len(*oelr.Value) == 0 2231} 2232 2233// hasNextLink returns true if the NextLink is not empty. 2234func (oelr OperationEntityListResult) hasNextLink() bool { 2235 return oelr.NextLink != nil && len(*oelr.NextLink) != 0 2236} 2237 2238// operationEntityListResultPreparer prepares a request to retrieve the next set of results. 2239// It returns nil if no more results exist. 2240func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) { 2241 if !oelr.hasNextLink() { 2242 return nil, nil 2243 } 2244 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2245 autorest.AsJSON(), 2246 autorest.AsGet(), 2247 autorest.WithBaseURL(to.String(oelr.NextLink))) 2248} 2249 2250// OperationEntityListResultPage contains a page of OperationEntity values. 2251type OperationEntityListResultPage struct { 2252 fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error) 2253 oelr OperationEntityListResult 2254} 2255 2256// NextWithContext advances to the next page of values. If there was an error making 2257// the request the page does not advance and the error is returned. 2258func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) { 2259 if tracing.IsEnabled() { 2260 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext") 2261 defer func() { 2262 sc := -1 2263 if page.Response().Response.Response != nil { 2264 sc = page.Response().Response.Response.StatusCode 2265 } 2266 tracing.EndSpan(ctx, sc, err) 2267 }() 2268 } 2269 for { 2270 next, err := page.fn(ctx, page.oelr) 2271 if err != nil { 2272 return err 2273 } 2274 page.oelr = next 2275 if !next.hasNextLink() || !next.IsEmpty() { 2276 break 2277 } 2278 } 2279 return nil 2280} 2281 2282// Next advances to the next page of values. If there was an error making 2283// the request the page does not advance and the error is returned. 2284// Deprecated: Use NextWithContext() instead. 2285func (page *OperationEntityListResultPage) Next() error { 2286 return page.NextWithContext(context.Background()) 2287} 2288 2289// NotDone returns true if the page enumeration should be started or is not yet complete. 2290func (page OperationEntityListResultPage) NotDone() bool { 2291 return !page.oelr.IsEmpty() 2292} 2293 2294// Response returns the raw server response from the last page request. 2295func (page OperationEntityListResultPage) Response() OperationEntityListResult { 2296 return page.oelr 2297} 2298 2299// Values returns the slice of values for the current page or nil if there are no values. 2300func (page OperationEntityListResultPage) Values() []OperationEntity { 2301 if page.oelr.IsEmpty() { 2302 return nil 2303 } 2304 return *page.oelr.Value 2305} 2306 2307// Creates a new instance of the OperationEntityListResultPage type. 2308func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { 2309 return OperationEntityListResultPage{ 2310 fn: getNextPage, 2311 oelr: cur, 2312 } 2313} 2314 2315// Resource azure resource 2316type Resource struct { 2317 // ID - READ-ONLY; Specifies the resource ID. 2318 ID *string `json:"id,omitempty"` 2319 // Name - READ-ONLY; Specifies the name of the resource. 2320 Name *string `json:"name,omitempty"` 2321 // Location - Specifies the location of the resource. 2322 Location *string `json:"location,omitempty"` 2323 // Type - READ-ONLY; Specifies the type of the resource. 2324 Type *string `json:"type,omitempty"` 2325 // Tags - Contains resource tags defined as key/value pairs. 2326 Tags map[string]*string `json:"tags"` 2327 // Sku - Gets or sets the SKU of the resource. 2328 Sku *Sku `json:"sku,omitempty"` 2329 // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction', 'KindAzurebot' 2330 Kind Kind `json:"kind,omitempty"` 2331 // Etag - Entity Tag 2332 Etag *string `json:"etag,omitempty"` 2333} 2334 2335// MarshalJSON is the custom marshaler for Resource. 2336func (r Resource) MarshalJSON() ([]byte, error) { 2337 objectMap := make(map[string]interface{}) 2338 if r.Location != nil { 2339 objectMap["location"] = r.Location 2340 } 2341 if r.Tags != nil { 2342 objectMap["tags"] = r.Tags 2343 } 2344 if r.Sku != nil { 2345 objectMap["sku"] = r.Sku 2346 } 2347 if r.Kind != "" { 2348 objectMap["kind"] = r.Kind 2349 } 2350 if r.Etag != nil { 2351 objectMap["etag"] = r.Etag 2352 } 2353 return json.Marshal(objectMap) 2354} 2355 2356// ServiceProvider service Provider Definition 2357type ServiceProvider struct { 2358 // Properties - The Properties of a Service Provider Object 2359 Properties *ServiceProviderProperties `json:"properties,omitempty"` 2360} 2361 2362// ServiceProviderParameter extra Parameters specific to each Service Provider 2363type ServiceProviderParameter struct { 2364 // Name - READ-ONLY; Name of the Service Provider 2365 Name *string `json:"name,omitempty"` 2366 // Type - READ-ONLY; Type of the Service Provider 2367 Type *string `json:"type,omitempty"` 2368 // DisplayName - READ-ONLY; Display Name of the Service Provider 2369 DisplayName *string `json:"displayName,omitempty"` 2370 // Description - READ-ONLY; Description of the Service Provider 2371 Description *string `json:"description,omitempty"` 2372 // HelpURL - READ-ONLY; Help Url for the Service Provider 2373 HelpURL *string `json:"helpUrl,omitempty"` 2374 // Default - READ-ONLY; Default Name for the Service Provider 2375 Default *string `json:"default,omitempty"` 2376} 2377 2378// MarshalJSON is the custom marshaler for ServiceProviderParameter. 2379func (spp ServiceProviderParameter) MarshalJSON() ([]byte, error) { 2380 objectMap := make(map[string]interface{}) 2381 return json.Marshal(objectMap) 2382} 2383 2384// ServiceProviderProperties the Object used to describe a Service Provider supported by Bot Service 2385type ServiceProviderProperties struct { 2386 // ID - READ-ONLY; Id for Service Provider 2387 ID *string `json:"id,omitempty"` 2388 // DisplayName - READ-ONLY; Display Name of the Service Provider 2389 DisplayName *string `json:"displayName,omitempty"` 2390 // ServiceProviderName - READ-ONLY; Display Name of the Service Provider 2391 ServiceProviderName *string `json:"serviceProviderName,omitempty"` 2392 // DevPortalURL - READ-ONLY; Display Name of the Service Provider 2393 DevPortalURL *string `json:"devPortalUrl,omitempty"` 2394 // IconURL - READ-ONLY; Display Name of the Service Provider 2395 IconURL *string `json:"iconUrl,omitempty"` 2396 // Parameters - The list of parameters for the Service Provider 2397 Parameters *[]ServiceProviderParameter `json:"parameters,omitempty"` 2398} 2399 2400// MarshalJSON is the custom marshaler for ServiceProviderProperties. 2401func (spp ServiceProviderProperties) MarshalJSON() ([]byte, error) { 2402 objectMap := make(map[string]interface{}) 2403 if spp.Parameters != nil { 2404 objectMap["parameters"] = spp.Parameters 2405 } 2406 return json.Marshal(objectMap) 2407} 2408 2409// ServiceProviderResponseList the list of bot service providers response. 2410type ServiceProviderResponseList struct { 2411 autorest.Response `json:"-"` 2412 // NextLink - The link used to get the next page of bot service providers. 2413 NextLink *string `json:"nextLink,omitempty"` 2414 // Value - READ-ONLY; Gets the list of bot service providers and their properties. 2415 Value *[]ServiceProvider `json:"value,omitempty"` 2416} 2417 2418// MarshalJSON is the custom marshaler for ServiceProviderResponseList. 2419func (sprl ServiceProviderResponseList) MarshalJSON() ([]byte, error) { 2420 objectMap := make(map[string]interface{}) 2421 if sprl.NextLink != nil { 2422 objectMap["nextLink"] = sprl.NextLink 2423 } 2424 return json.Marshal(objectMap) 2425} 2426 2427// SiteInfo site information for WebChat or DirectLine Channels to identify which site to regenerate keys 2428// for. 2429type SiteInfo struct { 2430 // SiteName - The site name 2431 SiteName *string `json:"siteName,omitempty"` 2432 // Key - Determines which key is to be regenerated. Possible values include: 'Key1', 'Key2' 2433 Key Key `json:"key,omitempty"` 2434} 2435 2436// Sku the SKU of the cognitive services account. 2437type Sku struct { 2438 // Name - The sku name. Possible values include: 'SkuNameF0', 'SkuNameS1' 2439 Name SkuName `json:"name,omitempty"` 2440 // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'SkuTierFree', 'SkuTierStandard' 2441 Tier SkuTier `json:"tier,omitempty"` 2442} 2443 2444// MarshalJSON is the custom marshaler for Sku. 2445func (s Sku) MarshalJSON() ([]byte, error) { 2446 objectMap := make(map[string]interface{}) 2447 if s.Name != "" { 2448 objectMap["name"] = s.Name 2449 } 2450 return json.Marshal(objectMap) 2451} 2452 2453// SkypeChannel skype channel definition 2454type SkypeChannel struct { 2455 // Properties - The set of properties specific to Skype channel resource 2456 Properties *SkypeChannelProperties `json:"properties,omitempty"` 2457 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2458 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2459} 2460 2461// MarshalJSON is the custom marshaler for SkypeChannel. 2462func (sc SkypeChannel) MarshalJSON() ([]byte, error) { 2463 sc.ChannelName = ChannelNameBasicChannelChannelNameSkypeChannel 2464 objectMap := make(map[string]interface{}) 2465 if sc.Properties != nil { 2466 objectMap["properties"] = sc.Properties 2467 } 2468 if sc.ChannelName != "" { 2469 objectMap["channelName"] = sc.ChannelName 2470 } 2471 return json.Marshal(objectMap) 2472} 2473 2474// AsAlexaChannel is the BasicChannel implementation for SkypeChannel. 2475func (sc SkypeChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2476 return nil, false 2477} 2478 2479// AsFacebookChannel is the BasicChannel implementation for SkypeChannel. 2480func (sc SkypeChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2481 return nil, false 2482} 2483 2484// AsEmailChannel is the BasicChannel implementation for SkypeChannel. 2485func (sc SkypeChannel) AsEmailChannel() (*EmailChannel, bool) { 2486 return nil, false 2487} 2488 2489// AsMsTeamsChannel is the BasicChannel implementation for SkypeChannel. 2490func (sc SkypeChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2491 return nil, false 2492} 2493 2494// AsSkypeChannel is the BasicChannel implementation for SkypeChannel. 2495func (sc SkypeChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2496 return &sc, true 2497} 2498 2499// AsKikChannel is the BasicChannel implementation for SkypeChannel. 2500func (sc SkypeChannel) AsKikChannel() (*KikChannel, bool) { 2501 return nil, false 2502} 2503 2504// AsWebChatChannel is the BasicChannel implementation for SkypeChannel. 2505func (sc SkypeChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2506 return nil, false 2507} 2508 2509// AsDirectLineChannel is the BasicChannel implementation for SkypeChannel. 2510func (sc SkypeChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2511 return nil, false 2512} 2513 2514// AsTelegramChannel is the BasicChannel implementation for SkypeChannel. 2515func (sc SkypeChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2516 return nil, false 2517} 2518 2519// AsSmsChannel is the BasicChannel implementation for SkypeChannel. 2520func (sc SkypeChannel) AsSmsChannel() (*SmsChannel, bool) { 2521 return nil, false 2522} 2523 2524// AsSlackChannel is the BasicChannel implementation for SkypeChannel. 2525func (sc SkypeChannel) AsSlackChannel() (*SlackChannel, bool) { 2526 return nil, false 2527} 2528 2529// AsLineChannel is the BasicChannel implementation for SkypeChannel. 2530func (sc SkypeChannel) AsLineChannel() (*LineChannel, bool) { 2531 return nil, false 2532} 2533 2534// AsDirectLineSpeechChannel is the BasicChannel implementation for SkypeChannel. 2535func (sc SkypeChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 2536 return nil, false 2537} 2538 2539// AsChannel is the BasicChannel implementation for SkypeChannel. 2540func (sc SkypeChannel) AsChannel() (*Channel, bool) { 2541 return nil, false 2542} 2543 2544// AsBasicChannel is the BasicChannel implementation for SkypeChannel. 2545func (sc SkypeChannel) AsBasicChannel() (BasicChannel, bool) { 2546 return &sc, true 2547} 2548 2549// SkypeChannelProperties the parameters to provide for the Microsoft Teams channel. 2550type SkypeChannelProperties struct { 2551 // EnableMessaging - Enable messaging for Skype channel 2552 EnableMessaging *bool `json:"enableMessaging,omitempty"` 2553 // EnableMediaCards - Enable media cards for Skype channel 2554 EnableMediaCards *bool `json:"enableMediaCards,omitempty"` 2555 // EnableVideo - Enable video for Skype channel 2556 EnableVideo *bool `json:"enableVideo,omitempty"` 2557 // EnableCalling - Enable calling for Skype channel 2558 EnableCalling *bool `json:"enableCalling,omitempty"` 2559 // EnableScreenSharing - Enable screen sharing for Skype channel 2560 EnableScreenSharing *bool `json:"enableScreenSharing,omitempty"` 2561 // EnableGroups - Enable groups for Skype channel 2562 EnableGroups *bool `json:"enableGroups,omitempty"` 2563 // GroupsMode - Group mode for Skype channel 2564 GroupsMode *string `json:"groupsMode,omitempty"` 2565 // CallingWebHook - Calling web hook for Skype channel 2566 CallingWebHook *string `json:"callingWebHook,omitempty"` 2567 // IsEnabled - Whether this channel is enabled for the bot 2568 IsEnabled *bool `json:"isEnabled,omitempty"` 2569} 2570 2571// SlackChannel slack channel definition 2572type SlackChannel struct { 2573 // Properties - The set of properties specific to Slack channel resource 2574 Properties *SlackChannelProperties `json:"properties,omitempty"` 2575 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2576 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2577} 2578 2579// MarshalJSON is the custom marshaler for SlackChannel. 2580func (sc SlackChannel) MarshalJSON() ([]byte, error) { 2581 sc.ChannelName = ChannelNameBasicChannelChannelNameSlackChannel 2582 objectMap := make(map[string]interface{}) 2583 if sc.Properties != nil { 2584 objectMap["properties"] = sc.Properties 2585 } 2586 if sc.ChannelName != "" { 2587 objectMap["channelName"] = sc.ChannelName 2588 } 2589 return json.Marshal(objectMap) 2590} 2591 2592// AsAlexaChannel is the BasicChannel implementation for SlackChannel. 2593func (sc SlackChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2594 return nil, false 2595} 2596 2597// AsFacebookChannel is the BasicChannel implementation for SlackChannel. 2598func (sc SlackChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2599 return nil, false 2600} 2601 2602// AsEmailChannel is the BasicChannel implementation for SlackChannel. 2603func (sc SlackChannel) AsEmailChannel() (*EmailChannel, bool) { 2604 return nil, false 2605} 2606 2607// AsMsTeamsChannel is the BasicChannel implementation for SlackChannel. 2608func (sc SlackChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2609 return nil, false 2610} 2611 2612// AsSkypeChannel is the BasicChannel implementation for SlackChannel. 2613func (sc SlackChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2614 return nil, false 2615} 2616 2617// AsKikChannel is the BasicChannel implementation for SlackChannel. 2618func (sc SlackChannel) AsKikChannel() (*KikChannel, bool) { 2619 return nil, false 2620} 2621 2622// AsWebChatChannel is the BasicChannel implementation for SlackChannel. 2623func (sc SlackChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2624 return nil, false 2625} 2626 2627// AsDirectLineChannel is the BasicChannel implementation for SlackChannel. 2628func (sc SlackChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2629 return nil, false 2630} 2631 2632// AsTelegramChannel is the BasicChannel implementation for SlackChannel. 2633func (sc SlackChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2634 return nil, false 2635} 2636 2637// AsSmsChannel is the BasicChannel implementation for SlackChannel. 2638func (sc SlackChannel) AsSmsChannel() (*SmsChannel, bool) { 2639 return nil, false 2640} 2641 2642// AsSlackChannel is the BasicChannel implementation for SlackChannel. 2643func (sc SlackChannel) AsSlackChannel() (*SlackChannel, bool) { 2644 return &sc, true 2645} 2646 2647// AsLineChannel is the BasicChannel implementation for SlackChannel. 2648func (sc SlackChannel) AsLineChannel() (*LineChannel, bool) { 2649 return nil, false 2650} 2651 2652// AsDirectLineSpeechChannel is the BasicChannel implementation for SlackChannel. 2653func (sc SlackChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 2654 return nil, false 2655} 2656 2657// AsChannel is the BasicChannel implementation for SlackChannel. 2658func (sc SlackChannel) AsChannel() (*Channel, bool) { 2659 return nil, false 2660} 2661 2662// AsBasicChannel is the BasicChannel implementation for SlackChannel. 2663func (sc SlackChannel) AsBasicChannel() (BasicChannel, bool) { 2664 return &sc, true 2665} 2666 2667// SlackChannelProperties the parameters to provide for the Slack channel. 2668type SlackChannelProperties struct { 2669 // ClientID - The Slack client id 2670 ClientID *string `json:"clientId,omitempty"` 2671 // ClientSecret - The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. 2672 ClientSecret *string `json:"clientSecret,omitempty"` 2673 // VerificationToken - The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. 2674 VerificationToken *string `json:"verificationToken,omitempty"` 2675 // LandingPageURL - The Slack landing page Url 2676 LandingPageURL *string `json:"landingPageUrl,omitempty"` 2677 // RedirectAction - READ-ONLY; The Slack redirect action 2678 RedirectAction *string `json:"redirectAction,omitempty"` 2679 // LastSubmissionID - READ-ONLY; The Sms auth token 2680 LastSubmissionID *string `json:"lastSubmissionId,omitempty"` 2681 // RegisterBeforeOAuthFlow - READ-ONLY; Whether to register the settings before OAuth validation is performed. Recommended to True. 2682 RegisterBeforeOAuthFlow *bool `json:"registerBeforeOAuthFlow,omitempty"` 2683 // IsValidated - READ-ONLY; Whether this channel is validated for the bot 2684 IsValidated *bool `json:"isValidated,omitempty"` 2685 // SigningSecret - The Slack signing secret. 2686 SigningSecret *string `json:"signingSecret,omitempty"` 2687 // IsEnabled - Whether this channel is enabled for the bot 2688 IsEnabled *bool `json:"isEnabled,omitempty"` 2689} 2690 2691// MarshalJSON is the custom marshaler for SlackChannelProperties. 2692func (scp SlackChannelProperties) MarshalJSON() ([]byte, error) { 2693 objectMap := make(map[string]interface{}) 2694 if scp.ClientID != nil { 2695 objectMap["clientId"] = scp.ClientID 2696 } 2697 if scp.ClientSecret != nil { 2698 objectMap["clientSecret"] = scp.ClientSecret 2699 } 2700 if scp.VerificationToken != nil { 2701 objectMap["verificationToken"] = scp.VerificationToken 2702 } 2703 if scp.LandingPageURL != nil { 2704 objectMap["landingPageUrl"] = scp.LandingPageURL 2705 } 2706 if scp.SigningSecret != nil { 2707 objectMap["signingSecret"] = scp.SigningSecret 2708 } 2709 if scp.IsEnabled != nil { 2710 objectMap["isEnabled"] = scp.IsEnabled 2711 } 2712 return json.Marshal(objectMap) 2713} 2714 2715// SmsChannel sms channel definition 2716type SmsChannel struct { 2717 // Properties - The set of properties specific to Sms channel resource 2718 Properties *SmsChannelProperties `json:"properties,omitempty"` 2719 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2720 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2721} 2722 2723// MarshalJSON is the custom marshaler for SmsChannel. 2724func (sc SmsChannel) MarshalJSON() ([]byte, error) { 2725 sc.ChannelName = ChannelNameBasicChannelChannelNameSmsChannel 2726 objectMap := make(map[string]interface{}) 2727 if sc.Properties != nil { 2728 objectMap["properties"] = sc.Properties 2729 } 2730 if sc.ChannelName != "" { 2731 objectMap["channelName"] = sc.ChannelName 2732 } 2733 return json.Marshal(objectMap) 2734} 2735 2736// AsAlexaChannel is the BasicChannel implementation for SmsChannel. 2737func (sc SmsChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2738 return nil, false 2739} 2740 2741// AsFacebookChannel is the BasicChannel implementation for SmsChannel. 2742func (sc SmsChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2743 return nil, false 2744} 2745 2746// AsEmailChannel is the BasicChannel implementation for SmsChannel. 2747func (sc SmsChannel) AsEmailChannel() (*EmailChannel, bool) { 2748 return nil, false 2749} 2750 2751// AsMsTeamsChannel is the BasicChannel implementation for SmsChannel. 2752func (sc SmsChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2753 return nil, false 2754} 2755 2756// AsSkypeChannel is the BasicChannel implementation for SmsChannel. 2757func (sc SmsChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2758 return nil, false 2759} 2760 2761// AsKikChannel is the BasicChannel implementation for SmsChannel. 2762func (sc SmsChannel) AsKikChannel() (*KikChannel, bool) { 2763 return nil, false 2764} 2765 2766// AsWebChatChannel is the BasicChannel implementation for SmsChannel. 2767func (sc SmsChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2768 return nil, false 2769} 2770 2771// AsDirectLineChannel is the BasicChannel implementation for SmsChannel. 2772func (sc SmsChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2773 return nil, false 2774} 2775 2776// AsTelegramChannel is the BasicChannel implementation for SmsChannel. 2777func (sc SmsChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2778 return nil, false 2779} 2780 2781// AsSmsChannel is the BasicChannel implementation for SmsChannel. 2782func (sc SmsChannel) AsSmsChannel() (*SmsChannel, bool) { 2783 return &sc, true 2784} 2785 2786// AsSlackChannel is the BasicChannel implementation for SmsChannel. 2787func (sc SmsChannel) AsSlackChannel() (*SlackChannel, bool) { 2788 return nil, false 2789} 2790 2791// AsLineChannel is the BasicChannel implementation for SmsChannel. 2792func (sc SmsChannel) AsLineChannel() (*LineChannel, bool) { 2793 return nil, false 2794} 2795 2796// AsDirectLineSpeechChannel is the BasicChannel implementation for SmsChannel. 2797func (sc SmsChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 2798 return nil, false 2799} 2800 2801// AsChannel is the BasicChannel implementation for SmsChannel. 2802func (sc SmsChannel) AsChannel() (*Channel, bool) { 2803 return nil, false 2804} 2805 2806// AsBasicChannel is the BasicChannel implementation for SmsChannel. 2807func (sc SmsChannel) AsBasicChannel() (BasicChannel, bool) { 2808 return &sc, true 2809} 2810 2811// SmsChannelProperties the parameters to provide for the Sms channel. 2812type SmsChannelProperties struct { 2813 // Phone - The Sms phone 2814 Phone *string `json:"phone,omitempty"` 2815 // AccountSID - The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. 2816 AccountSID *string `json:"accountSID,omitempty"` 2817 // AuthToken - The Sms auth token. Value only returned through POST to the action Channel List API, otherwise empty. 2818 AuthToken *string `json:"authToken,omitempty"` 2819 // IsValidated - Whether this channel is validated for the bot 2820 IsValidated *bool `json:"isValidated,omitempty"` 2821 // IsEnabled - Whether this channel is enabled for the bot 2822 IsEnabled *bool `json:"isEnabled,omitempty"` 2823} 2824 2825// TelegramChannel telegram channel definition 2826type TelegramChannel struct { 2827 // Properties - The set of properties specific to Telegram channel resource 2828 Properties *TelegramChannelProperties `json:"properties,omitempty"` 2829 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2830 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2831} 2832 2833// MarshalJSON is the custom marshaler for TelegramChannel. 2834func (tc TelegramChannel) MarshalJSON() ([]byte, error) { 2835 tc.ChannelName = ChannelNameBasicChannelChannelNameTelegramChannel 2836 objectMap := make(map[string]interface{}) 2837 if tc.Properties != nil { 2838 objectMap["properties"] = tc.Properties 2839 } 2840 if tc.ChannelName != "" { 2841 objectMap["channelName"] = tc.ChannelName 2842 } 2843 return json.Marshal(objectMap) 2844} 2845 2846// AsAlexaChannel is the BasicChannel implementation for TelegramChannel. 2847func (tc TelegramChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2848 return nil, false 2849} 2850 2851// AsFacebookChannel is the BasicChannel implementation for TelegramChannel. 2852func (tc TelegramChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2853 return nil, false 2854} 2855 2856// AsEmailChannel is the BasicChannel implementation for TelegramChannel. 2857func (tc TelegramChannel) AsEmailChannel() (*EmailChannel, bool) { 2858 return nil, false 2859} 2860 2861// AsMsTeamsChannel is the BasicChannel implementation for TelegramChannel. 2862func (tc TelegramChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2863 return nil, false 2864} 2865 2866// AsSkypeChannel is the BasicChannel implementation for TelegramChannel. 2867func (tc TelegramChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2868 return nil, false 2869} 2870 2871// AsKikChannel is the BasicChannel implementation for TelegramChannel. 2872func (tc TelegramChannel) AsKikChannel() (*KikChannel, bool) { 2873 return nil, false 2874} 2875 2876// AsWebChatChannel is the BasicChannel implementation for TelegramChannel. 2877func (tc TelegramChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2878 return nil, false 2879} 2880 2881// AsDirectLineChannel is the BasicChannel implementation for TelegramChannel. 2882func (tc TelegramChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2883 return nil, false 2884} 2885 2886// AsTelegramChannel is the BasicChannel implementation for TelegramChannel. 2887func (tc TelegramChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2888 return &tc, true 2889} 2890 2891// AsSmsChannel is the BasicChannel implementation for TelegramChannel. 2892func (tc TelegramChannel) AsSmsChannel() (*SmsChannel, bool) { 2893 return nil, false 2894} 2895 2896// AsSlackChannel is the BasicChannel implementation for TelegramChannel. 2897func (tc TelegramChannel) AsSlackChannel() (*SlackChannel, bool) { 2898 return nil, false 2899} 2900 2901// AsLineChannel is the BasicChannel implementation for TelegramChannel. 2902func (tc TelegramChannel) AsLineChannel() (*LineChannel, bool) { 2903 return nil, false 2904} 2905 2906// AsDirectLineSpeechChannel is the BasicChannel implementation for TelegramChannel. 2907func (tc TelegramChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 2908 return nil, false 2909} 2910 2911// AsChannel is the BasicChannel implementation for TelegramChannel. 2912func (tc TelegramChannel) AsChannel() (*Channel, bool) { 2913 return nil, false 2914} 2915 2916// AsBasicChannel is the BasicChannel implementation for TelegramChannel. 2917func (tc TelegramChannel) AsBasicChannel() (BasicChannel, bool) { 2918 return &tc, true 2919} 2920 2921// TelegramChannelProperties the parameters to provide for the Telegram channel. 2922type TelegramChannelProperties struct { 2923 // AccessToken - The Telegram access token. Value only returned through POST to the action Channel List API, otherwise empty. 2924 AccessToken *string `json:"accessToken,omitempty"` 2925 // IsValidated - Whether this channel is validated for the bot 2926 IsValidated *bool `json:"isValidated,omitempty"` 2927 // IsEnabled - Whether this channel is enabled for the bot 2928 IsEnabled *bool `json:"isEnabled,omitempty"` 2929} 2930 2931// WebChatChannel web Chat channel definition 2932type WebChatChannel struct { 2933 // Properties - The set of properties specific to Web Chat channel resource 2934 Properties *WebChatChannelProperties `json:"properties,omitempty"` 2935 // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' 2936 ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` 2937} 2938 2939// MarshalJSON is the custom marshaler for WebChatChannel. 2940func (wcc WebChatChannel) MarshalJSON() ([]byte, error) { 2941 wcc.ChannelName = ChannelNameBasicChannelChannelNameWebChatChannel 2942 objectMap := make(map[string]interface{}) 2943 if wcc.Properties != nil { 2944 objectMap["properties"] = wcc.Properties 2945 } 2946 if wcc.ChannelName != "" { 2947 objectMap["channelName"] = wcc.ChannelName 2948 } 2949 return json.Marshal(objectMap) 2950} 2951 2952// AsAlexaChannel is the BasicChannel implementation for WebChatChannel. 2953func (wcc WebChatChannel) AsAlexaChannel() (*AlexaChannel, bool) { 2954 return nil, false 2955} 2956 2957// AsFacebookChannel is the BasicChannel implementation for WebChatChannel. 2958func (wcc WebChatChannel) AsFacebookChannel() (*FacebookChannel, bool) { 2959 return nil, false 2960} 2961 2962// AsEmailChannel is the BasicChannel implementation for WebChatChannel. 2963func (wcc WebChatChannel) AsEmailChannel() (*EmailChannel, bool) { 2964 return nil, false 2965} 2966 2967// AsMsTeamsChannel is the BasicChannel implementation for WebChatChannel. 2968func (wcc WebChatChannel) AsMsTeamsChannel() (*MsTeamsChannel, bool) { 2969 return nil, false 2970} 2971 2972// AsSkypeChannel is the BasicChannel implementation for WebChatChannel. 2973func (wcc WebChatChannel) AsSkypeChannel() (*SkypeChannel, bool) { 2974 return nil, false 2975} 2976 2977// AsKikChannel is the BasicChannel implementation for WebChatChannel. 2978func (wcc WebChatChannel) AsKikChannel() (*KikChannel, bool) { 2979 return nil, false 2980} 2981 2982// AsWebChatChannel is the BasicChannel implementation for WebChatChannel. 2983func (wcc WebChatChannel) AsWebChatChannel() (*WebChatChannel, bool) { 2984 return &wcc, true 2985} 2986 2987// AsDirectLineChannel is the BasicChannel implementation for WebChatChannel. 2988func (wcc WebChatChannel) AsDirectLineChannel() (*DirectLineChannel, bool) { 2989 return nil, false 2990} 2991 2992// AsTelegramChannel is the BasicChannel implementation for WebChatChannel. 2993func (wcc WebChatChannel) AsTelegramChannel() (*TelegramChannel, bool) { 2994 return nil, false 2995} 2996 2997// AsSmsChannel is the BasicChannel implementation for WebChatChannel. 2998func (wcc WebChatChannel) AsSmsChannel() (*SmsChannel, bool) { 2999 return nil, false 3000} 3001 3002// AsSlackChannel is the BasicChannel implementation for WebChatChannel. 3003func (wcc WebChatChannel) AsSlackChannel() (*SlackChannel, bool) { 3004 return nil, false 3005} 3006 3007// AsLineChannel is the BasicChannel implementation for WebChatChannel. 3008func (wcc WebChatChannel) AsLineChannel() (*LineChannel, bool) { 3009 return nil, false 3010} 3011 3012// AsDirectLineSpeechChannel is the BasicChannel implementation for WebChatChannel. 3013func (wcc WebChatChannel) AsDirectLineSpeechChannel() (*DirectLineSpeechChannel, bool) { 3014 return nil, false 3015} 3016 3017// AsChannel is the BasicChannel implementation for WebChatChannel. 3018func (wcc WebChatChannel) AsChannel() (*Channel, bool) { 3019 return nil, false 3020} 3021 3022// AsBasicChannel is the BasicChannel implementation for WebChatChannel. 3023func (wcc WebChatChannel) AsBasicChannel() (BasicChannel, bool) { 3024 return &wcc, true 3025} 3026 3027// WebChatChannelProperties the parameters to provide for the Web Chat channel. 3028type WebChatChannelProperties struct { 3029 // WebChatEmbedCode - READ-ONLY; Web chat control embed code 3030 WebChatEmbedCode *string `json:"webChatEmbedCode,omitempty"` 3031 // Sites - The list of Web Chat sites 3032 Sites *[]WebChatSite `json:"sites,omitempty"` 3033} 3034 3035// MarshalJSON is the custom marshaler for WebChatChannelProperties. 3036func (wccp WebChatChannelProperties) MarshalJSON() ([]byte, error) { 3037 objectMap := make(map[string]interface{}) 3038 if wccp.Sites != nil { 3039 objectMap["sites"] = wccp.Sites 3040 } 3041 return json.Marshal(objectMap) 3042} 3043 3044// WebChatSite a site for the Webchat channel 3045type WebChatSite struct { 3046 // SiteID - READ-ONLY; Site Id 3047 SiteID *string `json:"siteId,omitempty"` 3048 // SiteName - Site name 3049 SiteName *string `json:"siteName,omitempty"` 3050 // Key - READ-ONLY; Primary key. Value only returned through POST to the action Channel List API, otherwise empty. 3051 Key *string `json:"key,omitempty"` 3052 // Key2 - READ-ONLY; Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. 3053 Key2 *string `json:"key2,omitempty"` 3054 // IsEnabled - Whether this site is enabled for DirectLine channel 3055 IsEnabled *bool `json:"isEnabled,omitempty"` 3056 // EnablePreview - Whether this site is enabled for preview versions of Webchat 3057 EnablePreview *bool `json:"enablePreview,omitempty"` 3058} 3059 3060// MarshalJSON is the custom marshaler for WebChatSite. 3061func (wcs WebChatSite) MarshalJSON() ([]byte, error) { 3062 objectMap := make(map[string]interface{}) 3063 if wcs.SiteName != nil { 3064 objectMap["siteName"] = wcs.SiteName 3065 } 3066 if wcs.IsEnabled != nil { 3067 objectMap["isEnabled"] = wcs.IsEnabled 3068 } 3069 if wcs.EnablePreview != nil { 3070 objectMap["enablePreview"] = wcs.EnablePreview 3071 } 3072 return json.Marshal(objectMap) 3073} 3074