azure_mgmt_bot_service 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service.rb +82 -0
  4. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/azure_bot_service.rb +144 -0
  5. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/bot_connection.rb +936 -0
  6. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/bots.rb +1000 -0
  7. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/channels.rb +872 -0
  8. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot.rb +123 -0
  9. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_channel.rb +126 -0
  10. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_properties.rb +207 -0
  11. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_response_list.rb +101 -0
  12. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel.rb +55 -0
  13. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel_name.rb +24 -0
  14. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel_response_list.rb +101 -0
  15. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/check_name_availability_request_body.rb +60 -0
  16. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/check_name_availability_response_body.rb +59 -0
  17. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_item_name.rb +47 -0
  18. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting.rb +124 -0
  19. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_parameter.rb +59 -0
  20. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_properties.rb +126 -0
  21. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_response_list.rb +101 -0
  22. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_channel.rb +63 -0
  23. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_channel_properties.rb +55 -0
  24. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_site.rb +119 -0
  25. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/email_channel.rb +63 -0
  26. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/email_channel_properties.rb +69 -0
  27. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/error.rb +47 -0
  28. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/error_body.rb +57 -0
  29. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_channel.rb +63 -0
  30. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_channel_properties.rb +114 -0
  31. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_page.rb +58 -0
  32. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/kik_channel.rb +63 -0
  33. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/kik_channel_properties.rb +80 -0
  34. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/kind.rb +18 -0
  35. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel.rb +63 -0
  36. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel_properties.rb +101 -0
  37. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_display_info.rb +80 -0
  38. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_entity.rb +81 -0
  39. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_entity_list_result.rb +98 -0
  40. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/resource.rb +146 -0
  41. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider.rb +48 -0
  42. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_parameter.rb +107 -0
  43. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_properties.rb +116 -0
  44. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_response_list.rb +69 -0
  45. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku.rb +59 -0
  46. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku_name.rb +16 -0
  47. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku_tier.rb +16 -0
  48. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/skype_channel.rb +63 -0
  49. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/skype_channel_properties.rb +134 -0
  50. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/slack_channel.rb +63 -0
  51. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/slack_channel_properties.rb +141 -0
  52. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/sms_channel.rb +63 -0
  53. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/sms_channel_properties.rb +92 -0
  54. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/telegram_channel.rb +63 -0
  55. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/telegram_channel_properties.rb +69 -0
  56. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_channel.rb +63 -0
  57. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_channel_properties.rb +67 -0
  58. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_site.rb +107 -0
  59. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/module_definition.rb +9 -0
  60. data/lib/2017-12-01-preview/generated/azure_mgmt_bot_service/operations.rb +219 -0
  61. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service.rb +91 -0
  62. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/azure_bot_service.rb +147 -0
  63. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/bot_connection.rb +936 -0
  64. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/bots.rb +1000 -0
  65. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/channels.rb +872 -0
  66. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/enterprise_channels.rb +962 -0
  67. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/bot.rb +123 -0
  68. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/bot_channel.rb +126 -0
  69. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/bot_properties.rb +207 -0
  70. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/bot_response_list.rb +101 -0
  71. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/channel.rb +55 -0
  72. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/channel_name.rb +24 -0
  73. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/channel_response_list.rb +101 -0
  74. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/check_name_availability_request_body.rb +60 -0
  75. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/check_name_availability_response_body.rb +59 -0
  76. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/connection_item_name.rb +47 -0
  77. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/connection_setting.rb +124 -0
  78. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/connection_setting_parameter.rb +59 -0
  79. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/connection_setting_properties.rb +126 -0
  80. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/connection_setting_response_list.rb +101 -0
  81. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/direct_line_channel.rb +63 -0
  82. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/direct_line_channel_properties.rb +55 -0
  83. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/direct_line_site.rb +151 -0
  84. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/email_channel.rb +63 -0
  85. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/email_channel_properties.rb +69 -0
  86. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel.rb +124 -0
  87. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_check_name_availability_request.rb +49 -0
  88. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_check_name_availability_response.rb +60 -0
  89. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_node.rb +95 -0
  90. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_node_state.rb +24 -0
  91. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_properties.rb +70 -0
  92. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_response_list.rb +101 -0
  93. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/enterprise_channel_state.rb +24 -0
  94. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/error.rb +47 -0
  95. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/error_body.rb +57 -0
  96. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/facebook_channel.rb +63 -0
  97. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/facebook_channel_properties.rb +114 -0
  98. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/facebook_page.rb +58 -0
  99. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/kik_channel.rb +63 -0
  100. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/kik_channel_properties.rb +80 -0
  101. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/kind.rb +18 -0
  102. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel.rb +63 -0
  103. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel_properties.rb +68 -0
  104. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/operation_display_info.rb +80 -0
  105. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/operation_entity.rb +81 -0
  106. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/operation_entity_list_result.rb +98 -0
  107. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/resource.rb +146 -0
  108. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/service_provider.rb +48 -0
  109. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/service_provider_parameter.rb +107 -0
  110. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/service_provider_properties.rb +116 -0
  111. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/service_provider_response_list.rb +69 -0
  112. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/sku.rb +59 -0
  113. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/sku_name.rb +16 -0
  114. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/sku_tier.rb +16 -0
  115. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/skype_channel.rb +63 -0
  116. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/skype_channel_properties.rb +134 -0
  117. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/slack_channel.rb +63 -0
  118. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/slack_channel_properties.rb +141 -0
  119. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/sms_channel.rb +63 -0
  120. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/sms_channel_properties.rb +92 -0
  121. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/telegram_channel.rb +63 -0
  122. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/telegram_channel_properties.rb +69 -0
  123. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/web_chat_channel.rb +63 -0
  124. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/web_chat_channel_properties.rb +67 -0
  125. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/models/web_chat_site.rb +107 -0
  126. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/module_definition.rb +9 -0
  127. data/lib/2018-07-12-preview/generated/azure_mgmt_bot_service/operations.rb +219 -0
  128. data/lib/azure_mgmt_bot_service.rb +7 -0
  129. data/lib/module_definition.rb +7 -0
  130. data/lib/profiles/latest/botservice_latest_profile_client.rb +40 -0
  131. data/lib/profiles/latest/botservice_module_definition.rb +8 -0
  132. data/lib/profiles/latest/modules/botservice_profile_module.rb +305 -0
  133. data/lib/version.rb +7 -0
  134. metadata +249 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e691b416b2ee21205ebd7eb3926874ce673594574611cd47a08c5343b59e63a4
4
+ data.tar.gz: da2677a90a77bb410cfb76db876428ab4017d703970d50f79e0365942311994a
5
+ SHA512:
6
+ metadata.gz: c0ad62bd88cd4f19c765eb5ff9320b85af94b84acfcbdcba474580271aaa53b1214b4ef8d11bfd32d15e43cfaa43c4a9ee06014819fac96ef863fdc1c7cc2730
7
+ data.tar.gz: 427c941ab4b9d526a3e39893870c4ecea2a7e6e8d66a9951701f5c774d0d30c420af8e5e905bc58ca241784d3d945956167fcb6427ff64d4bf581967407b812e
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,82 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-12-01-preview/generated/azure_mgmt_bot_service/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::BotService::Mgmt::V2017_12_01_preview
23
+ autoload :Bots, '2017-12-01-preview/generated/azure_mgmt_bot_service/bots.rb'
24
+ autoload :Channels, '2017-12-01-preview/generated/azure_mgmt_bot_service/channels.rb'
25
+ autoload :Operations, '2017-12-01-preview/generated/azure_mgmt_bot_service/operations.rb'
26
+ autoload :BotConnection, '2017-12-01-preview/generated/azure_mgmt_bot_service/bot_connection.rb'
27
+ autoload :AzureBotService, '2017-12-01-preview/generated/azure_mgmt_bot_service/azure_bot_service.rb'
28
+
29
+ module Models
30
+ autoload :DirectLineSite, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_site.rb'
31
+ autoload :Sku, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku.rb'
32
+ autoload :DirectLineChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_channel_properties.rb'
33
+ autoload :BotProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_properties.rb'
34
+ autoload :BotResponseList, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_response_list.rb'
35
+ autoload :TelegramChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/telegram_channel_properties.rb'
36
+ autoload :Resource, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/resource.rb'
37
+ autoload :FacebookPage, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_page.rb'
38
+ autoload :FacebookChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_channel_properties.rb'
39
+ autoload :ConnectionSettingResponseList, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_response_list.rb'
40
+ autoload :EmailChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/email_channel_properties.rb'
41
+ autoload :Channel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel.rb'
42
+ autoload :MsTeamsChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel_properties.rb'
43
+ autoload :ServiceProviderParameter, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_parameter.rb'
44
+ autoload :SkypeChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/skype_channel_properties.rb'
45
+ autoload :CheckNameAvailabilityResponseBody, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/check_name_availability_response_body.rb'
46
+ autoload :KikChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/kik_channel_properties.rb'
47
+ autoload :SmsChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/sms_channel_properties.rb'
48
+ autoload :WebChatSite, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_site.rb'
49
+ autoload :CheckNameAvailabilityRequestBody, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/check_name_availability_request_body.rb'
50
+ autoload :ServiceProviderProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_properties.rb'
51
+ autoload :SlackChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/slack_channel_properties.rb'
52
+ autoload :Error, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/error.rb'
53
+ autoload :OperationEntityListResult, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_entity_list_result.rb'
54
+ autoload :ServiceProviderResponseList, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider_response_list.rb'
55
+ autoload :ChannelResponseList, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel_response_list.rb'
56
+ autoload :WebChatChannelProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_channel_properties.rb'
57
+ autoload :ConnectionItemName, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_item_name.rb'
58
+ autoload :ErrorBody, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/error_body.rb'
59
+ autoload :ConnectionSettingParameter, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_parameter.rb'
60
+ autoload :OperationDisplayInfo, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_display_info.rb'
61
+ autoload :ConnectionSettingProperties, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting_properties.rb'
62
+ autoload :ServiceProvider, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/service_provider.rb'
63
+ autoload :OperationEntity, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/operation_entity.rb'
64
+ autoload :Bot, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot.rb'
65
+ autoload :BotChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/bot_channel.rb'
66
+ autoload :FacebookChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/facebook_channel.rb'
67
+ autoload :EmailChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/email_channel.rb'
68
+ autoload :MsTeamsChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/ms_teams_channel.rb'
69
+ autoload :SkypeChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/skype_channel.rb'
70
+ autoload :KikChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/kik_channel.rb'
71
+ autoload :WebChatChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/web_chat_channel.rb'
72
+ autoload :DirectLineChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/direct_line_channel.rb'
73
+ autoload :TelegramChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/telegram_channel.rb'
74
+ autoload :SmsChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/sms_channel.rb'
75
+ autoload :SlackChannel, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/slack_channel.rb'
76
+ autoload :ConnectionSetting, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/connection_setting.rb'
77
+ autoload :SkuName, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku_name.rb'
78
+ autoload :SkuTier, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/sku_tier.rb'
79
+ autoload :Kind, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/kind.rb'
80
+ autoload :ChannelName, '2017-12-01-preview/generated/azure_mgmt_bot_service/models/channel_name.rb'
81
+ end
82
+ end
@@ -0,0 +1,144 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::BotService::Mgmt::V2017_12_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class AzureBotService < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Azure Subscription ID.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] Version of the API to be used with the client request.
24
+ # Current version is 2017-12-01
25
+ attr_reader :api_version
26
+
27
+ # @return [String] The preferred language for the response.
28
+ attr_accessor :accept_language
29
+
30
+ # @return [Integer] The retry timeout in seconds for Long Running
31
+ # Operations. Default value is 30.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
35
+ # generated. When set to true a unique x-ms-client-request-id value is
36
+ # generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [Bots] bots
40
+ attr_reader :bots
41
+
42
+ # @return [Channels] channels
43
+ attr_reader :channels
44
+
45
+ # @return [Operations] operations
46
+ attr_reader :operations
47
+
48
+ # @return [BotConnection] bot_connection
49
+ attr_reader :bot_connection
50
+
51
+ #
52
+ # Creates initializes a new instance of the AzureBotService class.
53
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
54
+ # @param base_url [String] the base URI of the service.
55
+ # @param options [Array] filters to be applied to the HTTP requests.
56
+ #
57
+ def initialize(credentials = nil, base_url = nil, options = nil)
58
+ super(credentials, options)
59
+ @base_url = base_url || 'https://management.azure.com'
60
+
61
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
62
+ @credentials = credentials
63
+
64
+ @bots = Bots.new(self)
65
+ @channels = Channels.new(self)
66
+ @operations = Operations.new(self)
67
+ @bot_connection = BotConnection.new(self)
68
+ @api_version = '2017-12-01'
69
+ @accept_language = 'en-US'
70
+ @long_running_operation_retry_timeout = 30
71
+ @generate_client_request_id = true
72
+ add_telemetry
73
+ end
74
+
75
+ #
76
+ # Makes a request and returns the body of the response.
77
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
78
+ # @param path [String] the path, relative to {base_url}.
79
+ # @param options [Hash{String=>String}] specifying any request options like :body.
80
+ # @return [Hash{String=>String}] containing the body of the response.
81
+ # Example:
82
+ #
83
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
84
+ # path = "/path"
85
+ # options = {
86
+ # body: request_content,
87
+ # query_params: {'api-version' => '2016-02-01'}
88
+ # }
89
+ # result = @client.make_request(:put, path, options)
90
+ #
91
+ def make_request(method, path, options = {})
92
+ result = make_request_with_http_info(method, path, options)
93
+ result.body unless result.nil?
94
+ end
95
+
96
+ #
97
+ # Makes a request and returns the operation response.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
102
+ #
103
+ def make_request_with_http_info(method, path, options = {})
104
+ result = make_request_async(method, path, options).value!
105
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
106
+ result
107
+ end
108
+
109
+ #
110
+ # Makes a request asynchronously.
111
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
112
+ # @param path [String] the path, relative to {base_url}.
113
+ # @param options [Hash{String=>String}] specifying any request options like :body.
114
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
115
+ #
116
+ def make_request_async(method, path, options = {})
117
+ fail ArgumentError, 'method is nil' if method.nil?
118
+ fail ArgumentError, 'path is nil' if path.nil?
119
+
120
+ request_url = options[:base_url] || @base_url
121
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
122
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
123
+ end
124
+
125
+ request_headers = @request_headers
126
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
127
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
128
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
129
+
130
+ super(request_url, method, path, options)
131
+ end
132
+
133
+
134
+ private
135
+ #
136
+ # Adds telemetry information.
137
+ #
138
+ def add_telemetry
139
+ sdk_information = 'azure_mgmt_bot_service'
140
+ sdk_information = "#{sdk_information}/0.17.0"
141
+ add_user_agent_information(sdk_information)
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,936 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::BotService::Mgmt::V2017_12_01_preview
7
+ #
8
+ # Azure Bot Service is a platform for creating smart conversational agents.
9
+ #
10
+ class BotConnection
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BotConnection class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureBotService] reference to the AzureBotService
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the available Service Providers for creating Connection Settings
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [ServiceProviderResponseList] operation results.
31
+ #
32
+ def list_service_providers(custom_headers:nil)
33
+ response = list_service_providers_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists the available Service Providers for creating Connection Settings
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_service_providers_with_http_info(custom_headers:nil)
46
+ list_service_providers_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists the available Service Providers for creating Connection Settings
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_service_providers_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ path_params: {'subscriptionId' => @client.subscription_id},
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:post, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
92
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ServiceProviderResponseList.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Get a Connection Setting registration for a Bot Service
112
+ #
113
+ # @param resource_group_name [String] The name of the Bot resource group in the
114
+ # user subscription.
115
+ # @param resource_name [String] The name of the Bot resource.
116
+ # @param connection_name [String] The name of the Bot Service Connection
117
+ # Setting resource
118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
119
+ # will be added to the HTTP request.
120
+ #
121
+ # @return [ConnectionSetting] operation results.
122
+ #
123
+ def list_with_secrets(resource_group_name, resource_name, connection_name, custom_headers:nil)
124
+ response = list_with_secrets_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
125
+ response.body unless response.nil?
126
+ end
127
+
128
+ #
129
+ # Get a Connection Setting registration for a Bot Service
130
+ #
131
+ # @param resource_group_name [String] The name of the Bot resource group in the
132
+ # user subscription.
133
+ # @param resource_name [String] The name of the Bot resource.
134
+ # @param connection_name [String] The name of the Bot Service Connection
135
+ # Setting resource
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
140
+ #
141
+ def list_with_secrets_with_http_info(resource_group_name, resource_name, connection_name, custom_headers:nil)
142
+ list_with_secrets_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
143
+ end
144
+
145
+ #
146
+ # Get a Connection Setting registration for a Bot Service
147
+ #
148
+ # @param resource_group_name [String] The name of the Bot resource group in the
149
+ # user subscription.
150
+ # @param resource_name [String] The name of the Bot resource.
151
+ # @param connection_name [String] The name of the Bot Service Connection
152
+ # Setting resource
153
+ # @param [Hash{String => String}] A hash of custom headers that will be added
154
+ # to the HTTP request.
155
+ #
156
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
157
+ #
158
+ def list_with_secrets_async(resource_group_name, resource_name, connection_name, custom_headers:nil)
159
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
160
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
161
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
162
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
163
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
164
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
165
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
166
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
167
+ fail ArgumentError, 'connection_name is nil' if connection_name.nil?
168
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MaxLength': '64'" if !connection_name.nil? && connection_name.length > 64
169
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MinLength': '2'" if !connection_name.nil? && connection_name.length < 2
170
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !connection_name.nil? && connection_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
171
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
172
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
173
+
174
+
175
+ request_headers = {}
176
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
177
+
178
+ # Set Headers
179
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
180
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
181
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'
182
+
183
+ request_url = @base_url || @client.base_url
184
+
185
+ options = {
186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
187
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'connectionName' => connection_name,'subscriptionId' => @client.subscription_id},
188
+ query_params: {'api-version' => @client.api_version},
189
+ headers: request_headers.merge(custom_headers || {}),
190
+ base_url: request_url
191
+ }
192
+ promise = @client.make_request_async(:post, path_template, options)
193
+
194
+ promise = promise.then do |result|
195
+ http_response = result.response
196
+ status_code = http_response.status
197
+ response_content = http_response.body
198
+ unless status_code == 200
199
+ error_model = JSON.load(response_content)
200
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
201
+ end
202
+
203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
204
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
205
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
206
+ # Deserialize Response
207
+ if status_code == 200
208
+ begin
209
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
210
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
211
+ result.body = @client.deserialize(result_mapper, parsed_response)
212
+ rescue Exception => e
213
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
214
+ end
215
+ end
216
+
217
+ result
218
+ end
219
+
220
+ promise.execute
221
+ end
222
+
223
+ #
224
+ # Register a new Auth Connection for a Bot Service
225
+ #
226
+ # @param resource_group_name [String] The name of the Bot resource group in the
227
+ # user subscription.
228
+ # @param resource_name [String] The name of the Bot resource.
229
+ # @param connection_name [String] The name of the Bot Service Connection
230
+ # Setting resource
231
+ # @param parameters [ConnectionSetting] The parameters to provide for creating
232
+ # the Connection Setting.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [ConnectionSetting] operation results.
237
+ #
238
+ def create(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
239
+ response = create_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # Register a new Auth Connection for a Bot Service
245
+ #
246
+ # @param resource_group_name [String] The name of the Bot resource group in the
247
+ # user subscription.
248
+ # @param resource_name [String] The name of the Bot resource.
249
+ # @param connection_name [String] The name of the Bot Service Connection
250
+ # Setting resource
251
+ # @param parameters [ConnectionSetting] The parameters to provide for creating
252
+ # the Connection Setting.
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
257
+ #
258
+ def create_with_http_info(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
259
+ create_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:custom_headers).value!
260
+ end
261
+
262
+ #
263
+ # Register a new Auth Connection for a Bot Service
264
+ #
265
+ # @param resource_group_name [String] The name of the Bot resource group in the
266
+ # user subscription.
267
+ # @param resource_name [String] The name of the Bot resource.
268
+ # @param connection_name [String] The name of the Bot Service Connection
269
+ # Setting resource
270
+ # @param parameters [ConnectionSetting] The parameters to provide for creating
271
+ # the Connection Setting.
272
+ # @param [Hash{String => String}] A hash of custom headers that will be added
273
+ # to the HTTP request.
274
+ #
275
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
276
+ #
277
+ def create_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
278
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
279
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
280
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
281
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
282
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
283
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
284
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
285
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
286
+ fail ArgumentError, 'connection_name is nil' if connection_name.nil?
287
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MaxLength': '64'" if !connection_name.nil? && connection_name.length > 64
288
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MinLength': '2'" if !connection_name.nil? && connection_name.length < 2
289
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !connection_name.nil? && connection_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
290
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
291
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
292
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
293
+
294
+
295
+ request_headers = {}
296
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
297
+
298
+ # Set Headers
299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
301
+
302
+ # Serialize Request
303
+ request_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
304
+ request_content = @client.serialize(request_mapper, parameters)
305
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
306
+
307
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'
308
+
309
+ request_url = @base_url || @client.base_url
310
+
311
+ options = {
312
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
313
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'connectionName' => connection_name,'subscriptionId' => @client.subscription_id},
314
+ query_params: {'api-version' => @client.api_version},
315
+ body: request_content,
316
+ headers: request_headers.merge(custom_headers || {}),
317
+ base_url: request_url
318
+ }
319
+ promise = @client.make_request_async(:put, path_template, options)
320
+
321
+ promise = promise.then do |result|
322
+ http_response = result.response
323
+ status_code = http_response.status
324
+ response_content = http_response.body
325
+ unless status_code == 200 || status_code == 201
326
+ error_model = JSON.load(response_content)
327
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
328
+ end
329
+
330
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
331
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
332
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
333
+ # Deserialize Response
334
+ if status_code == 200
335
+ begin
336
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
337
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
338
+ result.body = @client.deserialize(result_mapper, parsed_response)
339
+ rescue Exception => e
340
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
341
+ end
342
+ end
343
+ # Deserialize Response
344
+ if status_code == 201
345
+ begin
346
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
347
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
348
+ result.body = @client.deserialize(result_mapper, parsed_response)
349
+ rescue Exception => e
350
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
351
+ end
352
+ end
353
+
354
+ result
355
+ end
356
+
357
+ promise.execute
358
+ end
359
+
360
+ #
361
+ # Updates a Connection Setting registration for a Bot Service
362
+ #
363
+ # @param resource_group_name [String] The name of the Bot resource group in the
364
+ # user subscription.
365
+ # @param resource_name [String] The name of the Bot resource.
366
+ # @param connection_name [String] The name of the Bot Service Connection
367
+ # Setting resource
368
+ # @param parameters [ConnectionSetting] The parameters to provide for updating
369
+ # the Connection Setting.
370
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
371
+ # will be added to the HTTP request.
372
+ #
373
+ # @return [ConnectionSetting] operation results.
374
+ #
375
+ def update(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
376
+ response = update_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:custom_headers).value!
377
+ response.body unless response.nil?
378
+ end
379
+
380
+ #
381
+ # Updates a Connection Setting registration for a Bot Service
382
+ #
383
+ # @param resource_group_name [String] The name of the Bot resource group in the
384
+ # user subscription.
385
+ # @param resource_name [String] The name of the Bot resource.
386
+ # @param connection_name [String] The name of the Bot Service Connection
387
+ # Setting resource
388
+ # @param parameters [ConnectionSetting] The parameters to provide for updating
389
+ # the Connection Setting.
390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
391
+ # will be added to the HTTP request.
392
+ #
393
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
+ #
395
+ def update_with_http_info(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
396
+ update_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:custom_headers).value!
397
+ end
398
+
399
+ #
400
+ # Updates a Connection Setting registration for a Bot Service
401
+ #
402
+ # @param resource_group_name [String] The name of the Bot resource group in the
403
+ # user subscription.
404
+ # @param resource_name [String] The name of the Bot resource.
405
+ # @param connection_name [String] The name of the Bot Service Connection
406
+ # Setting resource
407
+ # @param parameters [ConnectionSetting] The parameters to provide for updating
408
+ # the Connection Setting.
409
+ # @param [Hash{String => String}] A hash of custom headers that will be added
410
+ # to the HTTP request.
411
+ #
412
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
413
+ #
414
+ def update_async(resource_group_name, resource_name, connection_name, parameters, custom_headers:nil)
415
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
416
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
417
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
418
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
419
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
420
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
421
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
422
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
423
+ fail ArgumentError, 'connection_name is nil' if connection_name.nil?
424
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MaxLength': '64'" if !connection_name.nil? && connection_name.length > 64
425
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MinLength': '2'" if !connection_name.nil? && connection_name.length < 2
426
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !connection_name.nil? && connection_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
427
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
428
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
429
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
430
+
431
+
432
+ request_headers = {}
433
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
434
+
435
+ # Set Headers
436
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
437
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
438
+
439
+ # Serialize Request
440
+ request_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
441
+ request_content = @client.serialize(request_mapper, parameters)
442
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
443
+
444
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'
445
+
446
+ request_url = @base_url || @client.base_url
447
+
448
+ options = {
449
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
450
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'connectionName' => connection_name,'subscriptionId' => @client.subscription_id},
451
+ query_params: {'api-version' => @client.api_version},
452
+ body: request_content,
453
+ headers: request_headers.merge(custom_headers || {}),
454
+ base_url: request_url
455
+ }
456
+ promise = @client.make_request_async(:patch, path_template, options)
457
+
458
+ promise = promise.then do |result|
459
+ http_response = result.response
460
+ status_code = http_response.status
461
+ response_content = http_response.body
462
+ unless status_code == 200 || status_code == 201
463
+ error_model = JSON.load(response_content)
464
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
465
+ end
466
+
467
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
468
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
469
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
470
+ # Deserialize Response
471
+ if status_code == 200
472
+ begin
473
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
474
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
475
+ result.body = @client.deserialize(result_mapper, parsed_response)
476
+ rescue Exception => e
477
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
478
+ end
479
+ end
480
+ # Deserialize Response
481
+ if status_code == 201
482
+ begin
483
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
484
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
485
+ result.body = @client.deserialize(result_mapper, parsed_response)
486
+ rescue Exception => e
487
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
488
+ end
489
+ end
490
+
491
+ result
492
+ end
493
+
494
+ promise.execute
495
+ end
496
+
497
+ #
498
+ # Get a Connection Setting registration for a Bot Service
499
+ #
500
+ # @param resource_group_name [String] The name of the Bot resource group in the
501
+ # user subscription.
502
+ # @param resource_name [String] The name of the Bot resource.
503
+ # @param connection_name [String] The name of the Bot Service Connection
504
+ # Setting resource
505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
506
+ # will be added to the HTTP request.
507
+ #
508
+ # @return [ConnectionSetting] operation results.
509
+ #
510
+ def get(resource_group_name, resource_name, connection_name, custom_headers:nil)
511
+ response = get_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
512
+ response.body unless response.nil?
513
+ end
514
+
515
+ #
516
+ # Get a Connection Setting registration for a Bot Service
517
+ #
518
+ # @param resource_group_name [String] The name of the Bot resource group in the
519
+ # user subscription.
520
+ # @param resource_name [String] The name of the Bot resource.
521
+ # @param connection_name [String] The name of the Bot Service Connection
522
+ # Setting resource
523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
524
+ # will be added to the HTTP request.
525
+ #
526
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
527
+ #
528
+ def get_with_http_info(resource_group_name, resource_name, connection_name, custom_headers:nil)
529
+ get_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
530
+ end
531
+
532
+ #
533
+ # Get a Connection Setting registration for a Bot Service
534
+ #
535
+ # @param resource_group_name [String] The name of the Bot resource group in the
536
+ # user subscription.
537
+ # @param resource_name [String] The name of the Bot resource.
538
+ # @param connection_name [String] The name of the Bot Service Connection
539
+ # Setting resource
540
+ # @param [Hash{String => String}] A hash of custom headers that will be added
541
+ # to the HTTP request.
542
+ #
543
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
544
+ #
545
+ def get_async(resource_group_name, resource_name, connection_name, custom_headers:nil)
546
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
547
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
548
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
549
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
550
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
551
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
552
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
553
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
554
+ fail ArgumentError, 'connection_name is nil' if connection_name.nil?
555
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MaxLength': '64'" if !connection_name.nil? && connection_name.length > 64
556
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MinLength': '2'" if !connection_name.nil? && connection_name.length < 2
557
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !connection_name.nil? && connection_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
558
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
559
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
560
+
561
+
562
+ request_headers = {}
563
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
564
+
565
+ # Set Headers
566
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
567
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
568
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'
569
+
570
+ request_url = @base_url || @client.base_url
571
+
572
+ options = {
573
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
574
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'connectionName' => connection_name,'subscriptionId' => @client.subscription_id},
575
+ query_params: {'api-version' => @client.api_version},
576
+ headers: request_headers.merge(custom_headers || {}),
577
+ base_url: request_url
578
+ }
579
+ promise = @client.make_request_async(:get, path_template, options)
580
+
581
+ promise = promise.then do |result|
582
+ http_response = result.response
583
+ status_code = http_response.status
584
+ response_content = http_response.body
585
+ unless status_code == 200
586
+ error_model = JSON.load(response_content)
587
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
588
+ end
589
+
590
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
591
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
592
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
593
+ # Deserialize Response
594
+ if status_code == 200
595
+ begin
596
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
597
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSetting.mapper()
598
+ result.body = @client.deserialize(result_mapper, parsed_response)
599
+ rescue Exception => e
600
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
601
+ end
602
+ end
603
+
604
+ result
605
+ end
606
+
607
+ promise.execute
608
+ end
609
+
610
+ #
611
+ # Deletes a Connection Setting registration for a Bot Service
612
+ #
613
+ # @param resource_group_name [String] The name of the Bot resource group in the
614
+ # user subscription.
615
+ # @param resource_name [String] The name of the Bot resource.
616
+ # @param connection_name [String] The name of the Bot Service Connection
617
+ # Setting resource
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ #
622
+ def delete(resource_group_name, resource_name, connection_name, custom_headers:nil)
623
+ response = delete_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
624
+ nil
625
+ end
626
+
627
+ #
628
+ # Deletes a Connection Setting registration for a Bot Service
629
+ #
630
+ # @param resource_group_name [String] The name of the Bot resource group in the
631
+ # user subscription.
632
+ # @param resource_name [String] The name of the Bot resource.
633
+ # @param connection_name [String] The name of the Bot Service Connection
634
+ # Setting resource
635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
636
+ # will be added to the HTTP request.
637
+ #
638
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
639
+ #
640
+ def delete_with_http_info(resource_group_name, resource_name, connection_name, custom_headers:nil)
641
+ delete_async(resource_group_name, resource_name, connection_name, custom_headers:custom_headers).value!
642
+ end
643
+
644
+ #
645
+ # Deletes a Connection Setting registration for a Bot Service
646
+ #
647
+ # @param resource_group_name [String] The name of the Bot resource group in the
648
+ # user subscription.
649
+ # @param resource_name [String] The name of the Bot resource.
650
+ # @param connection_name [String] The name of the Bot Service Connection
651
+ # Setting resource
652
+ # @param [Hash{String => String}] A hash of custom headers that will be added
653
+ # to the HTTP request.
654
+ #
655
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
656
+ #
657
+ def delete_async(resource_group_name, resource_name, connection_name, custom_headers:nil)
658
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
659
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
660
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
661
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
662
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
663
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
664
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
665
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
666
+ fail ArgumentError, 'connection_name is nil' if connection_name.nil?
667
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MaxLength': '64'" if !connection_name.nil? && connection_name.length > 64
668
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'MinLength': '2'" if !connection_name.nil? && connection_name.length < 2
669
+ fail ArgumentError, "'connection_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !connection_name.nil? && connection_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
670
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
671
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
672
+
673
+
674
+ request_headers = {}
675
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
676
+
677
+ # Set Headers
678
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
679
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
680
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'
681
+
682
+ request_url = @base_url || @client.base_url
683
+
684
+ options = {
685
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
686
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'connectionName' => connection_name,'subscriptionId' => @client.subscription_id},
687
+ query_params: {'api-version' => @client.api_version},
688
+ headers: request_headers.merge(custom_headers || {}),
689
+ base_url: request_url
690
+ }
691
+ promise = @client.make_request_async(:delete, path_template, options)
692
+
693
+ promise = promise.then do |result|
694
+ http_response = result.response
695
+ status_code = http_response.status
696
+ response_content = http_response.body
697
+ unless status_code == 200 || status_code == 204
698
+ error_model = JSON.load(response_content)
699
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
700
+ end
701
+
702
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
703
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
704
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
705
+
706
+ result
707
+ end
708
+
709
+ promise.execute
710
+ end
711
+
712
+ #
713
+ # Returns all the Connection Settings registered to a particular BotService
714
+ # resource
715
+ #
716
+ # @param resource_group_name [String] The name of the Bot resource group in the
717
+ # user subscription.
718
+ # @param resource_name [String] The name of the Bot resource.
719
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
720
+ # will be added to the HTTP request.
721
+ #
722
+ # @return [Array<ConnectionSetting>] operation results.
723
+ #
724
+ def list_by_bot_service(resource_group_name, resource_name, custom_headers:nil)
725
+ first_page = list_by_bot_service_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
726
+ first_page.get_all_items
727
+ end
728
+
729
+ #
730
+ # Returns all the Connection Settings registered to a particular BotService
731
+ # resource
732
+ #
733
+ # @param resource_group_name [String] The name of the Bot resource group in the
734
+ # user subscription.
735
+ # @param resource_name [String] The name of the Bot resource.
736
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
737
+ # will be added to the HTTP request.
738
+ #
739
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
740
+ #
741
+ def list_by_bot_service_with_http_info(resource_group_name, resource_name, custom_headers:nil)
742
+ list_by_bot_service_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
743
+ end
744
+
745
+ #
746
+ # Returns all the Connection Settings registered to a particular BotService
747
+ # resource
748
+ #
749
+ # @param resource_group_name [String] The name of the Bot resource group in the
750
+ # user subscription.
751
+ # @param resource_name [String] The name of the Bot resource.
752
+ # @param [Hash{String => String}] A hash of custom headers that will be added
753
+ # to the HTTP request.
754
+ #
755
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
756
+ #
757
+ def list_by_bot_service_async(resource_group_name, resource_name, custom_headers:nil)
758
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
760
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
761
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
762
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
763
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
764
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
765
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil?
766
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
767
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
768
+
769
+
770
+ request_headers = {}
771
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
772
+
773
+ # Set Headers
774
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
775
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
776
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections'
777
+
778
+ request_url = @base_url || @client.base_url
779
+
780
+ options = {
781
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
782
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
783
+ query_params: {'api-version' => @client.api_version},
784
+ headers: request_headers.merge(custom_headers || {}),
785
+ base_url: request_url
786
+ }
787
+ promise = @client.make_request_async(:get, path_template, options)
788
+
789
+ promise = promise.then do |result|
790
+ http_response = result.response
791
+ status_code = http_response.status
792
+ response_content = http_response.body
793
+ unless status_code == 200
794
+ error_model = JSON.load(response_content)
795
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
796
+ end
797
+
798
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
799
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
800
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
801
+ # Deserialize Response
802
+ if status_code == 200
803
+ begin
804
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
805
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSettingResponseList.mapper()
806
+ result.body = @client.deserialize(result_mapper, parsed_response)
807
+ rescue Exception => e
808
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
809
+ end
810
+ end
811
+
812
+ result
813
+ end
814
+
815
+ promise.execute
816
+ end
817
+
818
+ #
819
+ # Returns all the Connection Settings registered to a particular BotService
820
+ # resource
821
+ #
822
+ # @param next_page_link [String] The NextLink from the previous successful call
823
+ # to List operation.
824
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
825
+ # will be added to the HTTP request.
826
+ #
827
+ # @return [ConnectionSettingResponseList] operation results.
828
+ #
829
+ def list_by_bot_service_next(next_page_link, custom_headers:nil)
830
+ response = list_by_bot_service_next_async(next_page_link, custom_headers:custom_headers).value!
831
+ response.body unless response.nil?
832
+ end
833
+
834
+ #
835
+ # Returns all the Connection Settings registered to a particular BotService
836
+ # resource
837
+ #
838
+ # @param next_page_link [String] The NextLink from the previous successful call
839
+ # to List operation.
840
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
841
+ # will be added to the HTTP request.
842
+ #
843
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
844
+ #
845
+ def list_by_bot_service_next_with_http_info(next_page_link, custom_headers:nil)
846
+ list_by_bot_service_next_async(next_page_link, custom_headers:custom_headers).value!
847
+ end
848
+
849
+ #
850
+ # Returns all the Connection Settings registered to a particular BotService
851
+ # resource
852
+ #
853
+ # @param next_page_link [String] The NextLink from the previous successful call
854
+ # to List operation.
855
+ # @param [Hash{String => String}] A hash of custom headers that will be added
856
+ # to the HTTP request.
857
+ #
858
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
859
+ #
860
+ def list_by_bot_service_next_async(next_page_link, custom_headers:nil)
861
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
862
+
863
+
864
+ request_headers = {}
865
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
866
+
867
+ # Set Headers
868
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
869
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
870
+ path_template = '{nextLink}'
871
+
872
+ request_url = @base_url || @client.base_url
873
+
874
+ options = {
875
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
876
+ skip_encoding_path_params: {'nextLink' => next_page_link},
877
+ headers: request_headers.merge(custom_headers || {}),
878
+ base_url: request_url
879
+ }
880
+ promise = @client.make_request_async(:get, path_template, options)
881
+
882
+ promise = promise.then do |result|
883
+ http_response = result.response
884
+ status_code = http_response.status
885
+ response_content = http_response.body
886
+ unless status_code == 200
887
+ error_model = JSON.load(response_content)
888
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
889
+ end
890
+
891
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
892
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
893
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
894
+ # Deserialize Response
895
+ if status_code == 200
896
+ begin
897
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
898
+ result_mapper = Azure::BotService::Mgmt::V2017_12_01_preview::Models::ConnectionSettingResponseList.mapper()
899
+ result.body = @client.deserialize(result_mapper, parsed_response)
900
+ rescue Exception => e
901
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
902
+ end
903
+ end
904
+
905
+ result
906
+ end
907
+
908
+ promise.execute
909
+ end
910
+
911
+ #
912
+ # Returns all the Connection Settings registered to a particular BotService
913
+ # resource
914
+ #
915
+ # @param resource_group_name [String] The name of the Bot resource group in the
916
+ # user subscription.
917
+ # @param resource_name [String] The name of the Bot resource.
918
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
919
+ # will be added to the HTTP request.
920
+ #
921
+ # @return [ConnectionSettingResponseList] which provide lazy access to pages of
922
+ # the response.
923
+ #
924
+ def list_by_bot_service_as_lazy(resource_group_name, resource_name, custom_headers:nil)
925
+ response = list_by_bot_service_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
926
+ unless response.nil?
927
+ page = response.body
928
+ page.next_method = Proc.new do |next_page_link|
929
+ list_by_bot_service_next_async(next_page_link, custom_headers:custom_headers)
930
+ end
931
+ page
932
+ end
933
+ end
934
+
935
+ end
936
+ end