azure_mgmt_bot_service 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,1000 @@
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::V2018_07_12_preview
7
+ #
8
+ # Azure Bot Service is a platform for creating smart conversational agents.
9
+ #
10
+ class Bots
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Bots 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
+ # Creates a Bot Service. Bot Service is a resource group wide resource type.
26
+ #
27
+ # @param resource_group_name [String] The name of the Bot resource group in the
28
+ # user subscription.
29
+ # @param resource_name [String] The name of the Bot resource.
30
+ # @param parameters [Bot] The parameters to provide for the created bot.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Bot] operation results.
35
+ #
36
+ def create(resource_group_name, resource_name, parameters, custom_headers:nil)
37
+ response = create_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Creates a Bot Service. Bot Service is a resource group wide resource type.
43
+ #
44
+ # @param resource_group_name [String] The name of the Bot resource group in the
45
+ # user subscription.
46
+ # @param resource_name [String] The name of the Bot resource.
47
+ # @param parameters [Bot] The parameters to provide for the created bot.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def create_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
54
+ create_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Creates a Bot Service. Bot Service is a resource group wide resource type.
59
+ #
60
+ # @param resource_group_name [String] The name of the Bot resource group in the
61
+ # user subscription.
62
+ # @param resource_name [String] The name of the Bot resource.
63
+ # @param parameters [Bot] The parameters to provide for the created bot.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def create_async(resource_group_name, resource_name, parameters, custom_headers:nil)
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
73
+ 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?
74
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
75
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
76
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
77
+ 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?
78
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
79
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
80
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+
90
+ # Serialize Request
91
+ request_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
92
+ request_content = @client.serialize(request_mapper, parameters)
93
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
94
+
95
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'
96
+
97
+ request_url = @base_url || @client.base_url
98
+
99
+ options = {
100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
102
+ query_params: {'api-version' => @client.api_version},
103
+ body: request_content,
104
+ headers: request_headers.merge(custom_headers || {}),
105
+ base_url: request_url
106
+ }
107
+ promise = @client.make_request_async(:put, path_template, options)
108
+
109
+ promise = promise.then do |result|
110
+ http_response = result.response
111
+ status_code = http_response.status
112
+ response_content = http_response.body
113
+ unless status_code == 200 || status_code == 201
114
+ error_model = JSON.load(response_content)
115
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
116
+ end
117
+
118
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
119
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
120
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
121
+ # Deserialize Response
122
+ if status_code == 200
123
+ begin
124
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
125
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
126
+ result.body = @client.deserialize(result_mapper, parsed_response)
127
+ rescue Exception => e
128
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
129
+ end
130
+ end
131
+ # Deserialize Response
132
+ if status_code == 201
133
+ begin
134
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
135
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
136
+ result.body = @client.deserialize(result_mapper, parsed_response)
137
+ rescue Exception => e
138
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
139
+ end
140
+ end
141
+
142
+ result
143
+ end
144
+
145
+ promise.execute
146
+ end
147
+
148
+ #
149
+ # Updates a Bot Service
150
+ #
151
+ # @param resource_group_name [String] The name of the Bot resource group in the
152
+ # user subscription.
153
+ # @param resource_name [String] The name of the Bot resource.
154
+ # @param location [String] Specifies the location of the resource.
155
+ # @param tags [Hash{String => String}] Contains resource tags defined as
156
+ # key/value pairs.
157
+ # @param sku [Sku] Gets or sets the SKU of the resource.
158
+ # @param kind [Kind] Required. Gets or sets the Kind of the resource. Possible
159
+ # values include: 'sdk', 'designer', 'bot', 'function'
160
+ # @param etag [String] Entity Tag
161
+ # @param properties [BotProperties] The set of properties specific to bot
162
+ # resource
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [Bot] operation results.
167
+ #
168
+ def update(resource_group_name, resource_name, location:nil, tags:nil, sku:nil, kind:nil, etag:nil, properties:nil, custom_headers:nil)
169
+ response = update_async(resource_group_name, resource_name, location:location, tags:tags, sku:sku, kind:kind, etag:etag, properties:properties, custom_headers:custom_headers).value!
170
+ response.body unless response.nil?
171
+ end
172
+
173
+ #
174
+ # Updates a Bot Service
175
+ #
176
+ # @param resource_group_name [String] The name of the Bot resource group in the
177
+ # user subscription.
178
+ # @param resource_name [String] The name of the Bot resource.
179
+ # @param location [String] Specifies the location of the resource.
180
+ # @param tags [Hash{String => String}] Contains resource tags defined as
181
+ # key/value pairs.
182
+ # @param sku [Sku] Gets or sets the SKU of the resource.
183
+ # @param kind [Kind] Required. Gets or sets the Kind of the resource. Possible
184
+ # values include: 'sdk', 'designer', 'bot', 'function'
185
+ # @param etag [String] Entity Tag
186
+ # @param properties [BotProperties] The set of properties specific to bot
187
+ # resource
188
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
189
+ # will be added to the HTTP request.
190
+ #
191
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
192
+ #
193
+ def update_with_http_info(resource_group_name, resource_name, location:nil, tags:nil, sku:nil, kind:nil, etag:nil, properties:nil, custom_headers:nil)
194
+ update_async(resource_group_name, resource_name, location:location, tags:tags, sku:sku, kind:kind, etag:etag, properties:properties, custom_headers:custom_headers).value!
195
+ end
196
+
197
+ #
198
+ # Updates a Bot Service
199
+ #
200
+ # @param resource_group_name [String] The name of the Bot resource group in the
201
+ # user subscription.
202
+ # @param resource_name [String] The name of the Bot resource.
203
+ # @param location [String] Specifies the location of the resource.
204
+ # @param tags [Hash{String => String}] Contains resource tags defined as
205
+ # key/value pairs.
206
+ # @param sku [Sku] Gets or sets the SKU of the resource.
207
+ # @param kind [Kind] Required. Gets or sets the Kind of the resource. Possible
208
+ # values include: 'sdk', 'designer', 'bot', 'function'
209
+ # @param etag [String] Entity Tag
210
+ # @param properties [BotProperties] The set of properties specific to bot
211
+ # resource
212
+ # @param [Hash{String => String}] A hash of custom headers that will be added
213
+ # to the HTTP request.
214
+ #
215
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
216
+ #
217
+ def update_async(resource_group_name, resource_name, location:nil, tags:nil, sku:nil, kind:nil, etag:nil, properties:nil, custom_headers:nil)
218
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
219
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
220
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
221
+ 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?
222
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
223
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
224
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
225
+ 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?
226
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
227
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
228
+
229
+ parameters = Bot.new
230
+ unless location.nil? && tags.nil? && sku.nil? && kind.nil? && etag.nil? && properties.nil?
231
+ parameters.location = location
232
+ parameters.tags = tags
233
+ parameters.sku = sku
234
+ parameters.kind = kind
235
+ parameters.etag = etag
236
+ parameters.properties = properties
237
+ end
238
+
239
+ request_headers = {}
240
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
241
+
242
+ # Set Headers
243
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
244
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
245
+
246
+ # Serialize Request
247
+ request_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
248
+ request_content = @client.serialize(request_mapper, parameters)
249
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
250
+
251
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'
252
+
253
+ request_url = @base_url || @client.base_url
254
+
255
+ options = {
256
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
257
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
258
+ query_params: {'api-version' => @client.api_version},
259
+ body: request_content,
260
+ headers: request_headers.merge(custom_headers || {}),
261
+ base_url: request_url
262
+ }
263
+ promise = @client.make_request_async(:patch, path_template, options)
264
+
265
+ promise = promise.then do |result|
266
+ http_response = result.response
267
+ status_code = http_response.status
268
+ response_content = http_response.body
269
+ unless status_code == 200 || status_code == 201
270
+ error_model = JSON.load(response_content)
271
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
272
+ end
273
+
274
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
275
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
276
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
277
+ # Deserialize Response
278
+ if status_code == 200
279
+ begin
280
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
281
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
282
+ result.body = @client.deserialize(result_mapper, parsed_response)
283
+ rescue Exception => e
284
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
285
+ end
286
+ end
287
+ # Deserialize Response
288
+ if status_code == 201
289
+ begin
290
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
291
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
292
+ result.body = @client.deserialize(result_mapper, parsed_response)
293
+ rescue Exception => e
294
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
295
+ end
296
+ end
297
+
298
+ result
299
+ end
300
+
301
+ promise.execute
302
+ end
303
+
304
+ #
305
+ # Deletes a Bot Service from the resource group.
306
+ #
307
+ # @param resource_group_name [String] The name of the Bot resource group in the
308
+ # user subscription.
309
+ # @param resource_name [String] The name of the Bot resource.
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ #
314
+ def delete(resource_group_name, resource_name, custom_headers:nil)
315
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
316
+ nil
317
+ end
318
+
319
+ #
320
+ # Deletes a Bot Service from the resource group.
321
+ #
322
+ # @param resource_group_name [String] The name of the Bot resource group in the
323
+ # user subscription.
324
+ # @param resource_name [String] The name of the Bot resource.
325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
+ # will be added to the HTTP request.
327
+ #
328
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
329
+ #
330
+ def delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
331
+ delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
332
+ end
333
+
334
+ #
335
+ # Deletes a Bot Service from the resource group.
336
+ #
337
+ # @param resource_group_name [String] The name of the Bot resource group in the
338
+ # user subscription.
339
+ # @param resource_name [String] The name of the Bot resource.
340
+ # @param [Hash{String => String}] A hash of custom headers that will be added
341
+ # to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
344
+ #
345
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
346
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
347
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
348
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
349
+ 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?
350
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
351
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
352
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
353
+ 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?
354
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
355
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
356
+
357
+
358
+ request_headers = {}
359
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
360
+
361
+ # Set Headers
362
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
363
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
364
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'
365
+
366
+ request_url = @base_url || @client.base_url
367
+
368
+ options = {
369
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
370
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
371
+ query_params: {'api-version' => @client.api_version},
372
+ headers: request_headers.merge(custom_headers || {}),
373
+ base_url: request_url
374
+ }
375
+ promise = @client.make_request_async(:delete, path_template, options)
376
+
377
+ promise = promise.then do |result|
378
+ http_response = result.response
379
+ status_code = http_response.status
380
+ response_content = http_response.body
381
+ unless status_code == 200 || status_code == 204
382
+ error_model = JSON.load(response_content)
383
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
384
+ end
385
+
386
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
387
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
388
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
389
+
390
+ result
391
+ end
392
+
393
+ promise.execute
394
+ end
395
+
396
+ #
397
+ # Returns a BotService specified by the parameters.
398
+ #
399
+ # @param resource_group_name [String] The name of the Bot resource group in the
400
+ # user subscription.
401
+ # @param resource_name [String] The name of the Bot resource.
402
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
403
+ # will be added to the HTTP request.
404
+ #
405
+ # @return [Bot] operation results.
406
+ #
407
+ def get(resource_group_name, resource_name, custom_headers:nil)
408
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
409
+ response.body unless response.nil?
410
+ end
411
+
412
+ #
413
+ # Returns a BotService specified by the parameters.
414
+ #
415
+ # @param resource_group_name [String] The name of the Bot resource group in the
416
+ # user subscription.
417
+ # @param resource_name [String] The name of the Bot resource.
418
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
419
+ # will be added to the HTTP request.
420
+ #
421
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
422
+ #
423
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
424
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
425
+ end
426
+
427
+ #
428
+ # Returns a BotService specified by the parameters.
429
+ #
430
+ # @param resource_group_name [String] The name of the Bot resource group in the
431
+ # user subscription.
432
+ # @param resource_name [String] The name of the Bot resource.
433
+ # @param [Hash{String => String}] A hash of custom headers that will be added
434
+ # to the HTTP request.
435
+ #
436
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
437
+ #
438
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
439
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
440
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
441
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
442
+ 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?
443
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
444
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_name.nil? && resource_name.length > 64
445
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '2'" if !resource_name.nil? && resource_name.length < 2
446
+ 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?
447
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
448
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
449
+
450
+
451
+ request_headers = {}
452
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
453
+
454
+ # Set Headers
455
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
456
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
457
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'
458
+
459
+ request_url = @base_url || @client.base_url
460
+
461
+ options = {
462
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
463
+ path_params: {'resourceGroupName' => resource_group_name,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
464
+ query_params: {'api-version' => @client.api_version},
465
+ headers: request_headers.merge(custom_headers || {}),
466
+ base_url: request_url
467
+ }
468
+ promise = @client.make_request_async(:get, path_template, options)
469
+
470
+ promise = promise.then do |result|
471
+ http_response = result.response
472
+ status_code = http_response.status
473
+ response_content = http_response.body
474
+ unless status_code == 200
475
+ error_model = JSON.load(response_content)
476
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
477
+ end
478
+
479
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
480
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
481
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
482
+ # Deserialize Response
483
+ if status_code == 200
484
+ begin
485
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
486
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::Bot.mapper()
487
+ result.body = @client.deserialize(result_mapper, parsed_response)
488
+ rescue Exception => e
489
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
490
+ end
491
+ end
492
+
493
+ result
494
+ end
495
+
496
+ promise.execute
497
+ end
498
+
499
+ #
500
+ # Returns all the resources of a particular type belonging to a resource group
501
+ #
502
+ # @param resource_group_name [String] The name of the Bot resource group in the
503
+ # user subscription.
504
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
505
+ # will be added to the HTTP request.
506
+ #
507
+ # @return [Array<Bot>] operation results.
508
+ #
509
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
510
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
511
+ first_page.get_all_items
512
+ end
513
+
514
+ #
515
+ # Returns all the resources of a particular type belonging to a resource group
516
+ #
517
+ # @param resource_group_name [String] The name of the Bot resource group in the
518
+ # user subscription.
519
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
+ # will be added to the HTTP request.
521
+ #
522
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
523
+ #
524
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
525
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
526
+ end
527
+
528
+ #
529
+ # Returns all the resources of a particular type belonging to a resource group
530
+ #
531
+ # @param resource_group_name [String] The name of the Bot resource group in the
532
+ # user subscription.
533
+ # @param [Hash{String => String}] A hash of custom headers that will be added
534
+ # to the HTTP request.
535
+ #
536
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
537
+ #
538
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
539
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
540
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
541
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '2'" if !resource_group_name.nil? && resource_group_name.length < 2
542
+ 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?
543
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
544
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
545
+
546
+
547
+ request_headers = {}
548
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
549
+
550
+ # Set Headers
551
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
552
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
553
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices'
554
+
555
+ request_url = @base_url || @client.base_url
556
+
557
+ options = {
558
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
559
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
560
+ query_params: {'api-version' => @client.api_version},
561
+ headers: request_headers.merge(custom_headers || {}),
562
+ base_url: request_url
563
+ }
564
+ promise = @client.make_request_async(:get, path_template, options)
565
+
566
+ promise = promise.then do |result|
567
+ http_response = result.response
568
+ status_code = http_response.status
569
+ response_content = http_response.body
570
+ unless status_code == 200
571
+ error_model = JSON.load(response_content)
572
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
573
+ end
574
+
575
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
576
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
577
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
578
+ # Deserialize Response
579
+ if status_code == 200
580
+ begin
581
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
582
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::BotResponseList.mapper()
583
+ result.body = @client.deserialize(result_mapper, parsed_response)
584
+ rescue Exception => e
585
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
586
+ end
587
+ end
588
+
589
+ result
590
+ end
591
+
592
+ promise.execute
593
+ end
594
+
595
+ #
596
+ # Returns all the resources of a particular type belonging to a subscription.
597
+ #
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ # @return [Array<Bot>] operation results.
602
+ #
603
+ def list(custom_headers:nil)
604
+ first_page = list_as_lazy(custom_headers:custom_headers)
605
+ first_page.get_all_items
606
+ end
607
+
608
+ #
609
+ # Returns all the resources of a particular type belonging to a subscription.
610
+ #
611
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
612
+ # will be added to the HTTP request.
613
+ #
614
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
615
+ #
616
+ def list_with_http_info(custom_headers:nil)
617
+ list_async(custom_headers:custom_headers).value!
618
+ end
619
+
620
+ #
621
+ # Returns all the resources of a particular type belonging to a subscription.
622
+ #
623
+ # @param [Hash{String => String}] A hash of custom headers that will be added
624
+ # to the HTTP request.
625
+ #
626
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
627
+ #
628
+ def list_async(custom_headers:nil)
629
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
630
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
631
+
632
+
633
+ request_headers = {}
634
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
635
+
636
+ # Set Headers
637
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
638
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
639
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'
640
+
641
+ request_url = @base_url || @client.base_url
642
+
643
+ options = {
644
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
645
+ path_params: {'subscriptionId' => @client.subscription_id},
646
+ query_params: {'api-version' => @client.api_version},
647
+ headers: request_headers.merge(custom_headers || {}),
648
+ base_url: request_url
649
+ }
650
+ promise = @client.make_request_async(:get, path_template, options)
651
+
652
+ promise = promise.then do |result|
653
+ http_response = result.response
654
+ status_code = http_response.status
655
+ response_content = http_response.body
656
+ unless status_code == 200
657
+ error_model = JSON.load(response_content)
658
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
659
+ end
660
+
661
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
662
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
663
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
664
+ # Deserialize Response
665
+ if status_code == 200
666
+ begin
667
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
668
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::BotResponseList.mapper()
669
+ result.body = @client.deserialize(result_mapper, parsed_response)
670
+ rescue Exception => e
671
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
672
+ end
673
+ end
674
+
675
+ result
676
+ end
677
+
678
+ promise.execute
679
+ end
680
+
681
+ #
682
+ # Check whether a bot name is available.
683
+ #
684
+ # @param parameters [CheckNameAvailabilityRequestBody] The request body
685
+ # parameters to provide for the check name availability request
686
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
687
+ # will be added to the HTTP request.
688
+ #
689
+ # @return [CheckNameAvailabilityResponseBody] operation results.
690
+ #
691
+ def get_check_name_availability(parameters, custom_headers:nil)
692
+ response = get_check_name_availability_async(parameters, custom_headers:custom_headers).value!
693
+ response.body unless response.nil?
694
+ end
695
+
696
+ #
697
+ # Check whether a bot name is available.
698
+ #
699
+ # @param parameters [CheckNameAvailabilityRequestBody] The request body
700
+ # parameters to provide for the check name availability request
701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
+ # will be added to the HTTP request.
703
+ #
704
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
705
+ #
706
+ def get_check_name_availability_with_http_info(parameters, custom_headers:nil)
707
+ get_check_name_availability_async(parameters, custom_headers:custom_headers).value!
708
+ end
709
+
710
+ #
711
+ # Check whether a bot name is available.
712
+ #
713
+ # @param parameters [CheckNameAvailabilityRequestBody] The request body
714
+ # parameters to provide for the check name availability request
715
+ # @param [Hash{String => String}] A hash of custom headers that will be added
716
+ # to the HTTP request.
717
+ #
718
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
719
+ #
720
+ def get_check_name_availability_async(parameters, custom_headers:nil)
721
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
722
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
723
+
724
+
725
+ request_headers = {}
726
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
727
+
728
+ # Set Headers
729
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
730
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
731
+
732
+ # Serialize Request
733
+ request_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::CheckNameAvailabilityRequestBody.mapper()
734
+ request_content = @client.serialize(request_mapper, parameters)
735
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
736
+
737
+ path_template = 'providers/Microsoft.BotService/checkNameAvailability'
738
+
739
+ request_url = @base_url || @client.base_url
740
+
741
+ options = {
742
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
743
+ query_params: {'api-version' => @client.api_version},
744
+ body: request_content,
745
+ headers: request_headers.merge(custom_headers || {}),
746
+ base_url: request_url
747
+ }
748
+ promise = @client.make_request_async(:post, path_template, options)
749
+
750
+ promise = promise.then do |result|
751
+ http_response = result.response
752
+ status_code = http_response.status
753
+ response_content = http_response.body
754
+ unless status_code == 200
755
+ error_model = JSON.load(response_content)
756
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
757
+ end
758
+
759
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
760
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
761
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
762
+ # Deserialize Response
763
+ if status_code == 200
764
+ begin
765
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
766
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::CheckNameAvailabilityResponseBody.mapper()
767
+ result.body = @client.deserialize(result_mapper, parsed_response)
768
+ rescue Exception => e
769
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
770
+ end
771
+ end
772
+
773
+ result
774
+ end
775
+
776
+ promise.execute
777
+ end
778
+
779
+ #
780
+ # Returns all the resources of a particular type belonging to a resource group
781
+ #
782
+ # @param next_page_link [String] The NextLink from the previous successful call
783
+ # to List operation.
784
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
785
+ # will be added to the HTTP request.
786
+ #
787
+ # @return [BotResponseList] operation results.
788
+ #
789
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
790
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
791
+ response.body unless response.nil?
792
+ end
793
+
794
+ #
795
+ # Returns all the resources of a particular type belonging to a resource group
796
+ #
797
+ # @param next_page_link [String] The NextLink from the previous successful call
798
+ # to List operation.
799
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
800
+ # will be added to the HTTP request.
801
+ #
802
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
803
+ #
804
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
805
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
806
+ end
807
+
808
+ #
809
+ # Returns all the resources of a particular type belonging to a resource group
810
+ #
811
+ # @param next_page_link [String] The NextLink from the previous successful call
812
+ # to List operation.
813
+ # @param [Hash{String => String}] A hash of custom headers that will be added
814
+ # to the HTTP request.
815
+ #
816
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
817
+ #
818
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
819
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
820
+
821
+
822
+ request_headers = {}
823
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
824
+
825
+ # Set Headers
826
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
827
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
828
+ path_template = '{nextLink}'
829
+
830
+ request_url = @base_url || @client.base_url
831
+
832
+ options = {
833
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
834
+ skip_encoding_path_params: {'nextLink' => next_page_link},
835
+ headers: request_headers.merge(custom_headers || {}),
836
+ base_url: request_url
837
+ }
838
+ promise = @client.make_request_async(:get, path_template, options)
839
+
840
+ promise = promise.then do |result|
841
+ http_response = result.response
842
+ status_code = http_response.status
843
+ response_content = http_response.body
844
+ unless status_code == 200
845
+ error_model = JSON.load(response_content)
846
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
847
+ end
848
+
849
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
850
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
851
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
852
+ # Deserialize Response
853
+ if status_code == 200
854
+ begin
855
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
856
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::BotResponseList.mapper()
857
+ result.body = @client.deserialize(result_mapper, parsed_response)
858
+ rescue Exception => e
859
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
860
+ end
861
+ end
862
+
863
+ result
864
+ end
865
+
866
+ promise.execute
867
+ end
868
+
869
+ #
870
+ # Returns all the resources of a particular type belonging to a subscription.
871
+ #
872
+ # @param next_page_link [String] The NextLink from the previous successful call
873
+ # to List operation.
874
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
875
+ # will be added to the HTTP request.
876
+ #
877
+ # @return [BotResponseList] operation results.
878
+ #
879
+ def list_next(next_page_link, custom_headers:nil)
880
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
881
+ response.body unless response.nil?
882
+ end
883
+
884
+ #
885
+ # Returns all the resources of a particular type belonging to a subscription.
886
+ #
887
+ # @param next_page_link [String] The NextLink from the previous successful call
888
+ # to List operation.
889
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
890
+ # will be added to the HTTP request.
891
+ #
892
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
893
+ #
894
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
895
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
896
+ end
897
+
898
+ #
899
+ # Returns all the resources of a particular type belonging to a subscription.
900
+ #
901
+ # @param next_page_link [String] The NextLink from the previous successful call
902
+ # to List operation.
903
+ # @param [Hash{String => String}] A hash of custom headers that will be added
904
+ # to the HTTP request.
905
+ #
906
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
907
+ #
908
+ def list_next_async(next_page_link, custom_headers:nil)
909
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
910
+
911
+
912
+ request_headers = {}
913
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
914
+
915
+ # Set Headers
916
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
917
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
918
+ path_template = '{nextLink}'
919
+
920
+ request_url = @base_url || @client.base_url
921
+
922
+ options = {
923
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
924
+ skip_encoding_path_params: {'nextLink' => next_page_link},
925
+ headers: request_headers.merge(custom_headers || {}),
926
+ base_url: request_url
927
+ }
928
+ promise = @client.make_request_async(:get, path_template, options)
929
+
930
+ promise = promise.then do |result|
931
+ http_response = result.response
932
+ status_code = http_response.status
933
+ response_content = http_response.body
934
+ unless status_code == 200
935
+ error_model = JSON.load(response_content)
936
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
937
+ end
938
+
939
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
940
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
941
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
942
+ # Deserialize Response
943
+ if status_code == 200
944
+ begin
945
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
946
+ result_mapper = Azure::BotService::Mgmt::V2018_07_12_preview::Models::BotResponseList.mapper()
947
+ result.body = @client.deserialize(result_mapper, parsed_response)
948
+ rescue Exception => e
949
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
950
+ end
951
+ end
952
+
953
+ result
954
+ end
955
+
956
+ promise.execute
957
+ end
958
+
959
+ #
960
+ # Returns all the resources of a particular type belonging to a resource group
961
+ #
962
+ # @param resource_group_name [String] The name of the Bot resource group in the
963
+ # user subscription.
964
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
965
+ # will be added to the HTTP request.
966
+ #
967
+ # @return [BotResponseList] which provide lazy access to pages of the response.
968
+ #
969
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
970
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
971
+ unless response.nil?
972
+ page = response.body
973
+ page.next_method = Proc.new do |next_page_link|
974
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
975
+ end
976
+ page
977
+ end
978
+ end
979
+
980
+ #
981
+ # Returns all the resources of a particular type belonging to a subscription.
982
+ #
983
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
984
+ # will be added to the HTTP request.
985
+ #
986
+ # @return [BotResponseList] which provide lazy access to pages of the response.
987
+ #
988
+ def list_as_lazy(custom_headers:nil)
989
+ response = list_async(custom_headers:custom_headers).value!
990
+ unless response.nil?
991
+ page = response.body
992
+ page.next_method = Proc.new do |next_page_link|
993
+ list_next_async(next_page_link, custom_headers:custom_headers)
994
+ end
995
+ page
996
+ end
997
+ end
998
+
999
+ end
1000
+ end