azure_cognitiveservices_localsearch 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/1.0/generated/azure_cognitiveservices_localsearch.rb +54 -0
  4. data/lib/1.0/generated/azure_cognitiveservices_localsearch/local.rb +601 -0
  5. data/lib/1.0/generated/azure_cognitiveservices_localsearch/local_search_client.rb +128 -0
  6. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/action.rb +424 -0
  7. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/answer.rb +131 -0
  8. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/creative_work.rb +392 -0
  9. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/entities_entity_presentation_info.rb +127 -0
  10. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/entity_scenario.rb +17 -0
  11. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/entity_type.rb +18 -0
  12. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/error.rb +126 -0
  13. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/error_code.rb +20 -0
  14. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/error_response.rb +154 -0
  15. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/error_sub_code.rb +25 -0
  16. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/geo_coordinates.rb +80 -0
  17. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/identifiable.rb +62 -0
  18. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/intangible.rb +162 -0
  19. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/place.rb +217 -0
  20. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/places.rb +182 -0
  21. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/postal_address.rb +338 -0
  22. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/query_context.rb +150 -0
  23. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/response.rb +150 -0
  24. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/response_base.rb +60 -0
  25. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/response_format.rb +16 -0
  26. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/safe_search.rb +17 -0
  27. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/search_action.rb +464 -0
  28. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/search_response.rb +190 -0
  29. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/search_results_answer.rb +172 -0
  30. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/structured_value.rb +162 -0
  31. data/lib/1.0/generated/azure_cognitiveservices_localsearch/models/thing.rb +174 -0
  32. data/lib/1.0/generated/azure_cognitiveservices_localsearch/module_definition.rb +9 -0
  33. data/lib/azure_cognitiveservices_localsearch.rb +6 -0
  34. data/lib/module_definition.rb +7 -0
  35. data/lib/profiles/latest/localsearch_latest_profile_client.rb +38 -0
  36. data/lib/profiles/latest/localsearch_module_definition.rb +8 -0
  37. data/lib/profiles/latest/modules/localsearch_profile_module.rb +163 -0
  38. data/lib/version.rb +7 -0
  39. metadata +156 -0
@@ -0,0 +1,128 @@
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::CognitiveServices::LocalSearch::V1_0
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class LocalSearchClient < 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 :credentials1
19
+
20
+ # @return Subscription credentials which uniquely identify client
21
+ # subscription.
22
+ attr_accessor :credentials
23
+
24
+ # @return [String] The preferred language for the response.
25
+ attr_accessor :accept_language
26
+
27
+ # @return [Integer] The retry timeout in seconds for Long Running
28
+ # Operations. Default value is 30.
29
+ attr_accessor :long_running_operation_retry_timeout
30
+
31
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
32
+ # generated. When set to true a unique x-ms-client-request-id value is
33
+ # generated and included in each request. Default is true.
34
+ attr_accessor :generate_client_request_id
35
+
36
+ # @return [Local] local
37
+ attr_reader :local
38
+
39
+ #
40
+ # Creates initializes a new instance of the LocalSearchClient class.
41
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
42
+ # @param base_url [String] the base URI of the service.
43
+ # @param options [Array] filters to be applied to the HTTP requests.
44
+ #
45
+ def initialize(credentials = nil, base_url = nil, options = nil)
46
+ super(credentials, options)
47
+ @base_url = base_url || 'https://api.cognitive.microsoft.com/localbusinesses/v7.0/search'
48
+
49
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
50
+ @credentials = credentials
51
+
52
+ @local = Local.new(self)
53
+ @accept_language = 'en-US'
54
+ @long_running_operation_retry_timeout = 30
55
+ @generate_client_request_id = true
56
+ add_telemetry
57
+ end
58
+
59
+ #
60
+ # Makes a request and returns the body of the response.
61
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
62
+ # @param path [String] the path, relative to {base_url}.
63
+ # @param options [Hash{String=>String}] specifying any request options like :body.
64
+ # @return [Hash{String=>String}] containing the body of the response.
65
+ # Example:
66
+ #
67
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
68
+ # path = "/path"
69
+ # options = {
70
+ # body: request_content,
71
+ # query_params: {'api-version' => '2016-02-01'}
72
+ # }
73
+ # result = @client.make_request(:put, path, options)
74
+ #
75
+ def make_request(method, path, options = {})
76
+ result = make_request_with_http_info(method, path, options)
77
+ result.body unless result.nil?
78
+ end
79
+
80
+ #
81
+ # Makes a request and returns the operation response.
82
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
83
+ # @param path [String] the path, relative to {base_url}.
84
+ # @param options [Hash{String=>String}] specifying any request options like :body.
85
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
86
+ #
87
+ def make_request_with_http_info(method, path, options = {})
88
+ result = make_request_async(method, path, options).value!
89
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
90
+ result
91
+ end
92
+
93
+ #
94
+ # Makes a request asynchronously.
95
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
96
+ # @param path [String] the path, relative to {base_url}.
97
+ # @param options [Hash{String=>String}] specifying any request options like :body.
98
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
99
+ #
100
+ def make_request_async(method, path, options = {})
101
+ fail ArgumentError, 'method is nil' if method.nil?
102
+ fail ArgumentError, 'path is nil' if path.nil?
103
+
104
+ request_url = options[:base_url] || @base_url
105
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
106
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
107
+ end
108
+
109
+ request_headers = @request_headers
110
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
111
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
112
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
113
+
114
+ super(request_url, method, path, options)
115
+ end
116
+
117
+
118
+ private
119
+ #
120
+ # Adds telemetry information.
121
+ #
122
+ def add_telemetry
123
+ sdk_information = 'azure_cognitiveservices_localsearch'
124
+ sdk_information = "#{sdk_information}/0.17.0"
125
+ add_user_agent_information(sdk_information)
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,424 @@
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::CognitiveServices::LocalSearch::V1_0
7
+ module Models
8
+ #
9
+ # Defines an action.
10
+ #
11
+ class Action < CreativeWork
12
+
13
+ include MsRestAzure
14
+
15
+
16
+ def initialize
17
+ @_type = "Action"
18
+ end
19
+
20
+ attr_accessor :_type
21
+
22
+ # @return [Array<Place>]
23
+ attr_accessor :location
24
+
25
+ # @return [Array<Thing>] The result produced in the action.
26
+ attr_accessor :result
27
+
28
+ # @return [String] A display name for the action.
29
+ attr_accessor :display_name
30
+
31
+ # @return [Boolean] A Boolean representing whether this result is the top
32
+ # action.
33
+ attr_accessor :is_top_action
34
+
35
+ # @return [String] Use this URL to get additional data to determine how
36
+ # to take the appropriate action. For example, the serviceUrl might
37
+ # return JSON along with an image URL.
38
+ attr_accessor :service_url
39
+
40
+
41
+ #
42
+ # Mapper for Action class as Ruby Hash.
43
+ # This will be used for serialization/deserialization.
44
+ #
45
+ def self.mapper()
46
+ {
47
+ client_side_validation: true,
48
+ required: false,
49
+ serialized_name: 'Action',
50
+ type: {
51
+ name: 'Composite',
52
+ class_name: 'Action',
53
+ model_properties: {
54
+ _type: {
55
+ client_side_validation: true,
56
+ required: true,
57
+ serialized_name: '_type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ id: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ read_only: true,
66
+ serialized_name: 'id',
67
+ type: {
68
+ name: 'String'
69
+ }
70
+ },
71
+ read_link: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ read_only: true,
75
+ serialized_name: 'readLink',
76
+ type: {
77
+ name: 'String'
78
+ }
79
+ },
80
+ web_search_url: {
81
+ client_side_validation: true,
82
+ required: false,
83
+ read_only: true,
84
+ serialized_name: 'webSearchUrl',
85
+ type: {
86
+ name: 'String'
87
+ }
88
+ },
89
+ potential_action: {
90
+ client_side_validation: true,
91
+ required: false,
92
+ read_only: true,
93
+ serialized_name: 'potentialAction',
94
+ type: {
95
+ name: 'Sequence',
96
+ element: {
97
+ client_side_validation: true,
98
+ required: false,
99
+ serialized_name: 'ActionElementType',
100
+ type: {
101
+ name: 'Composite',
102
+ class_name: 'Action'
103
+ }
104
+ }
105
+ }
106
+ },
107
+ immediate_action: {
108
+ client_side_validation: true,
109
+ required: false,
110
+ read_only: true,
111
+ serialized_name: 'immediateAction',
112
+ type: {
113
+ name: 'Sequence',
114
+ element: {
115
+ client_side_validation: true,
116
+ required: false,
117
+ serialized_name: 'ActionElementType',
118
+ type: {
119
+ name: 'Composite',
120
+ class_name: 'Action'
121
+ }
122
+ }
123
+ }
124
+ },
125
+ preferred_clickthrough_url: {
126
+ client_side_validation: true,
127
+ required: false,
128
+ read_only: true,
129
+ serialized_name: 'preferredClickthroughUrl',
130
+ type: {
131
+ name: 'String'
132
+ }
133
+ },
134
+ adaptive_card: {
135
+ client_side_validation: true,
136
+ required: false,
137
+ read_only: true,
138
+ serialized_name: 'adaptiveCard',
139
+ type: {
140
+ name: 'String'
141
+ }
142
+ },
143
+ name: {
144
+ client_side_validation: true,
145
+ required: false,
146
+ read_only: true,
147
+ serialized_name: 'name',
148
+ type: {
149
+ name: 'String'
150
+ }
151
+ },
152
+ url: {
153
+ client_side_validation: true,
154
+ required: false,
155
+ read_only: true,
156
+ serialized_name: 'url',
157
+ type: {
158
+ name: 'String'
159
+ }
160
+ },
161
+ entity_presentation_info: {
162
+ client_side_validation: true,
163
+ required: false,
164
+ read_only: true,
165
+ serialized_name: 'entityPresentationInfo',
166
+ type: {
167
+ name: 'Composite',
168
+ polymorphic_discriminator: '_type',
169
+ uber_parent: 'EntitiesEntityPresentationInfo',
170
+ class_name: 'EntitiesEntityPresentationInfo'
171
+ }
172
+ },
173
+ thumbnail_url: {
174
+ client_side_validation: true,
175
+ required: false,
176
+ read_only: true,
177
+ serialized_name: 'thumbnailUrl',
178
+ type: {
179
+ name: 'String'
180
+ }
181
+ },
182
+ about: {
183
+ client_side_validation: true,
184
+ required: false,
185
+ read_only: true,
186
+ serialized_name: 'about',
187
+ type: {
188
+ name: 'Sequence',
189
+ element: {
190
+ client_side_validation: true,
191
+ required: false,
192
+ serialized_name: 'ThingElementType',
193
+ type: {
194
+ name: 'Composite',
195
+ class_name: 'Thing'
196
+ }
197
+ }
198
+ }
199
+ },
200
+ mentions: {
201
+ client_side_validation: true,
202
+ required: false,
203
+ read_only: true,
204
+ serialized_name: 'mentions',
205
+ type: {
206
+ name: 'Sequence',
207
+ element: {
208
+ client_side_validation: true,
209
+ required: false,
210
+ serialized_name: 'ThingElementType',
211
+ type: {
212
+ name: 'Composite',
213
+ class_name: 'Thing'
214
+ }
215
+ }
216
+ }
217
+ },
218
+ provider: {
219
+ client_side_validation: true,
220
+ required: false,
221
+ read_only: true,
222
+ serialized_name: 'provider',
223
+ type: {
224
+ name: 'Sequence',
225
+ element: {
226
+ client_side_validation: true,
227
+ required: false,
228
+ serialized_name: 'ThingElementType',
229
+ type: {
230
+ name: 'Composite',
231
+ class_name: 'Thing'
232
+ }
233
+ }
234
+ }
235
+ },
236
+ creator: {
237
+ client_side_validation: true,
238
+ required: false,
239
+ read_only: true,
240
+ serialized_name: 'creator',
241
+ type: {
242
+ name: 'Composite',
243
+ class_name: 'Thing'
244
+ }
245
+ },
246
+ text: {
247
+ client_side_validation: true,
248
+ required: false,
249
+ read_only: true,
250
+ serialized_name: 'text',
251
+ type: {
252
+ name: 'String'
253
+ }
254
+ },
255
+ discussion_url: {
256
+ client_side_validation: true,
257
+ required: false,
258
+ read_only: true,
259
+ serialized_name: 'discussionUrl',
260
+ type: {
261
+ name: 'String'
262
+ }
263
+ },
264
+ comment_count: {
265
+ client_side_validation: true,
266
+ required: false,
267
+ read_only: true,
268
+ serialized_name: 'commentCount',
269
+ type: {
270
+ name: 'Number'
271
+ }
272
+ },
273
+ main_entity: {
274
+ client_side_validation: true,
275
+ required: false,
276
+ read_only: true,
277
+ serialized_name: 'mainEntity',
278
+ type: {
279
+ name: 'Composite',
280
+ class_name: 'Thing'
281
+ }
282
+ },
283
+ head_line: {
284
+ client_side_validation: true,
285
+ required: false,
286
+ read_only: true,
287
+ serialized_name: 'headLine',
288
+ type: {
289
+ name: 'String'
290
+ }
291
+ },
292
+ copyright_holder: {
293
+ client_side_validation: true,
294
+ required: false,
295
+ read_only: true,
296
+ serialized_name: 'copyrightHolder',
297
+ type: {
298
+ name: 'Composite',
299
+ class_name: 'Thing'
300
+ }
301
+ },
302
+ copyright_year: {
303
+ client_side_validation: true,
304
+ required: false,
305
+ read_only: true,
306
+ serialized_name: 'copyrightYear',
307
+ type: {
308
+ name: 'Number'
309
+ }
310
+ },
311
+ disclaimer: {
312
+ client_side_validation: true,
313
+ required: false,
314
+ read_only: true,
315
+ serialized_name: 'disclaimer',
316
+ type: {
317
+ name: 'String'
318
+ }
319
+ },
320
+ is_accessible_for_free: {
321
+ client_side_validation: true,
322
+ required: false,
323
+ read_only: true,
324
+ serialized_name: 'isAccessibleForFree',
325
+ type: {
326
+ name: 'Boolean'
327
+ }
328
+ },
329
+ genre: {
330
+ client_side_validation: true,
331
+ required: false,
332
+ read_only: true,
333
+ serialized_name: 'genre',
334
+ type: {
335
+ name: 'Sequence',
336
+ element: {
337
+ client_side_validation: true,
338
+ required: false,
339
+ serialized_name: 'StringElementType',
340
+ type: {
341
+ name: 'String'
342
+ }
343
+ }
344
+ }
345
+ },
346
+ is_family_friendly: {
347
+ client_side_validation: true,
348
+ required: false,
349
+ read_only: true,
350
+ serialized_name: 'isFamilyFriendly',
351
+ type: {
352
+ name: 'Boolean'
353
+ }
354
+ },
355
+ location: {
356
+ client_side_validation: true,
357
+ required: false,
358
+ read_only: true,
359
+ serialized_name: 'location',
360
+ type: {
361
+ name: 'Sequence',
362
+ element: {
363
+ client_side_validation: true,
364
+ required: false,
365
+ serialized_name: 'PlaceElementType',
366
+ type: {
367
+ name: 'Composite',
368
+ class_name: 'Place'
369
+ }
370
+ }
371
+ }
372
+ },
373
+ result: {
374
+ client_side_validation: true,
375
+ required: false,
376
+ read_only: true,
377
+ serialized_name: 'result',
378
+ type: {
379
+ name: 'Sequence',
380
+ element: {
381
+ client_side_validation: true,
382
+ required: false,
383
+ serialized_name: 'ThingElementType',
384
+ type: {
385
+ name: 'Composite',
386
+ class_name: 'Thing'
387
+ }
388
+ }
389
+ }
390
+ },
391
+ display_name: {
392
+ client_side_validation: true,
393
+ required: false,
394
+ read_only: true,
395
+ serialized_name: 'displayName',
396
+ type: {
397
+ name: 'String'
398
+ }
399
+ },
400
+ is_top_action: {
401
+ client_side_validation: true,
402
+ required: false,
403
+ read_only: true,
404
+ serialized_name: 'isTopAction',
405
+ type: {
406
+ name: 'Boolean'
407
+ }
408
+ },
409
+ service_url: {
410
+ client_side_validation: true,
411
+ required: false,
412
+ read_only: true,
413
+ serialized_name: 'serviceUrl',
414
+ type: {
415
+ name: 'String'
416
+ }
417
+ }
418
+ }
419
+ }
420
+ }
421
+ end
422
+ end
423
+ end
424
+ end