azure_cognitiveservices_visualsearch 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.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch.rb +75 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/images.rb +639 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/action.rb +237 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/aggregate_offer.rb +211 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/aggregate_rating.rb +89 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/content_types.rb +20 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/creative_work.rb +190 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/crop_area.rb +92 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/currency.rb +175 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/error.rb +116 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/error_code.rb +20 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/error_response.rb +98 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/error_sub_code.rb +25 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/filters.rb +48 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/identifiable.rb +62 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_action.rb +234 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_entity_action.rb +231 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_info.rb +86 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_knowledge.rb +112 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_module_action.rb +244 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_object.rb +326 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_recipes_action.rb +244 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_related_searches_action.rb +244 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_shopping_sources_action.rb +245 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_tag.rb +182 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/image_tag_region.rb +61 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/images_image_metadata.rb +80 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/images_module.rb +56 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/intangible.rb +133 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/item_availability.rb +22 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/knowledge_request.rb +49 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/media_object.rb +263 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/normalized_quadrilateral.rb +183 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/offer.rb +231 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/organization.rb +132 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/person.rb +156 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/point2d.rb +154 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/properties_item.rb +59 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/query.rb +101 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/rating.rb +84 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/recipe.rb +219 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/recipes_module.rb +56 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/related_searches_module.rb +56 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/response.rb +86 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/response_base.rb +70 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/safe_search.rb +17 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/structured_value.rb +133 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/thing.rb +151 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/models/visual_search_request.rb +62 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/module_definition.rb +9 -0
- data/lib/1.0/generated/azure_cognitiveservices_visualsearch/visual_search_client.rb +128 -0
- data/lib/azure_cognitiveservices_visualsearch.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/modules/visualsearch_profile_module.rb +247 -0
- data/lib/profiles/latest/visualsearch_latest_profile_client.rb +38 -0
- data/lib/profiles/latest/visualsearch_module_definition.rb +8 -0
- data/lib/version.rb +7 -0
- metadata +177 -0
|
@@ -0,0 +1,62 @@
|
|
|
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::VisualSearch::V1_0
|
|
7
|
+
module Models
|
|
8
|
+
#
|
|
9
|
+
# A JSON object that contains information about the image to get insights
|
|
10
|
+
# of. Specify this object only in a knowledgeRequest form data.
|
|
11
|
+
#
|
|
12
|
+
class VisualSearchRequest
|
|
13
|
+
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
# @return [ImageInfo] A JSON object that identities the image to get
|
|
17
|
+
# insights of.
|
|
18
|
+
attr_accessor :image_info
|
|
19
|
+
|
|
20
|
+
# @return [KnowledgeRequest] A JSON object containing information about
|
|
21
|
+
# the request, such as filters, or a description.
|
|
22
|
+
attr_accessor :knowledge_request
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#
|
|
26
|
+
# Mapper for VisualSearchRequest class as Ruby Hash.
|
|
27
|
+
# This will be used for serialization/deserialization.
|
|
28
|
+
#
|
|
29
|
+
def self.mapper()
|
|
30
|
+
{
|
|
31
|
+
client_side_validation: true,
|
|
32
|
+
required: false,
|
|
33
|
+
serialized_name: 'VisualSearchRequest',
|
|
34
|
+
type: {
|
|
35
|
+
name: 'Composite',
|
|
36
|
+
class_name: 'VisualSearchRequest',
|
|
37
|
+
model_properties: {
|
|
38
|
+
image_info: {
|
|
39
|
+
client_side_validation: true,
|
|
40
|
+
required: false,
|
|
41
|
+
serialized_name: 'imageInfo',
|
|
42
|
+
type: {
|
|
43
|
+
name: 'Composite',
|
|
44
|
+
class_name: 'ImageInfo'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
knowledge_request: {
|
|
48
|
+
client_side_validation: true,
|
|
49
|
+
required: false,
|
|
50
|
+
serialized_name: 'knowledgeRequest',
|
|
51
|
+
type: {
|
|
52
|
+
name: 'Composite',
|
|
53
|
+
class_name: 'KnowledgeRequest'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
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 end
|
|
7
|
+
module Azure::CognitiveServices end
|
|
8
|
+
module Azure::CognitiveServices::VisualSearch end
|
|
9
|
+
module Azure::CognitiveServices::VisualSearch::V1_0 end
|
|
@@ -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::VisualSearch::V1_0
|
|
7
|
+
#
|
|
8
|
+
# A service client - single point of access to the REST API.
|
|
9
|
+
#
|
|
10
|
+
class VisualSearchClient < 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 [Images] images
|
|
37
|
+
attr_reader :images
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Creates initializes a new instance of the VisualSearchClient 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/bing/v7.0'
|
|
48
|
+
|
|
49
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
|
50
|
+
@credentials = credentials
|
|
51
|
+
|
|
52
|
+
@images = Images.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_visualsearch'
|
|
124
|
+
sdk_information = "#{sdk_information}/0.17.0"
|
|
125
|
+
add_user_agent_information(sdk_information)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
|
|
5
|
+
require '1.0/generated/azure_cognitiveservices_visualsearch'
|
|
6
|
+
require 'profiles/latest/visualsearch_latest_profile_client'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
|
|
5
|
+
module Azure end
|
|
6
|
+
module Azure::CognitiveServices end
|
|
7
|
+
module Azure::CognitiveServices::VisualSearch end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
|
|
5
|
+
require 'azure_cognitiveservices_visualsearch'
|
|
6
|
+
|
|
7
|
+
module Azure::VisualSearch::Profiles::Latest
|
|
8
|
+
Images = Azure::CognitiveServices::VisualSearch::V1_0::Images
|
|
9
|
+
|
|
10
|
+
module Models
|
|
11
|
+
Error = Azure::CognitiveServices::VisualSearch::V1_0::Models::Error
|
|
12
|
+
CropArea = Azure::CognitiveServices::VisualSearch::V1_0::Models::CropArea
|
|
13
|
+
ImageInfo = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageInfo
|
|
14
|
+
ImageTagRegion = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageTagRegion
|
|
15
|
+
ImagesImageMetadata = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImagesImageMetadata
|
|
16
|
+
RelatedSearchesModule = Azure::CognitiveServices::VisualSearch::V1_0::Models::RelatedSearchesModule
|
|
17
|
+
Filters = Azure::CognitiveServices::VisualSearch::V1_0::Models::Filters
|
|
18
|
+
ImagesModule = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImagesModule
|
|
19
|
+
KnowledgeRequest = Azure::CognitiveServices::VisualSearch::V1_0::Models::KnowledgeRequest
|
|
20
|
+
RecipesModule = Azure::CognitiveServices::VisualSearch::V1_0::Models::RecipesModule
|
|
21
|
+
ResponseBase = Azure::CognitiveServices::VisualSearch::V1_0::Models::ResponseBase
|
|
22
|
+
Query = Azure::CognitiveServices::VisualSearch::V1_0::Models::Query
|
|
23
|
+
VisualSearchRequest = Azure::CognitiveServices::VisualSearch::V1_0::Models::VisualSearchRequest
|
|
24
|
+
PropertiesItem = Azure::CognitiveServices::VisualSearch::V1_0::Models::PropertiesItem
|
|
25
|
+
Point2D = Azure::CognitiveServices::VisualSearch::V1_0::Models::Point2D
|
|
26
|
+
NormalizedQuadrilateral = Azure::CognitiveServices::VisualSearch::V1_0::Models::NormalizedQuadrilateral
|
|
27
|
+
ImageAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageAction
|
|
28
|
+
ImageTag = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageTag
|
|
29
|
+
Organization = Azure::CognitiveServices::VisualSearch::V1_0::Models::Organization
|
|
30
|
+
AggregateRating = Azure::CognitiveServices::VisualSearch::V1_0::Models::AggregateRating
|
|
31
|
+
Offer = Azure::CognitiveServices::VisualSearch::V1_0::Models::Offer
|
|
32
|
+
AggregateOffer = Azure::CognitiveServices::VisualSearch::V1_0::Models::AggregateOffer
|
|
33
|
+
ImageObject = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageObject
|
|
34
|
+
Identifiable = Azure::CognitiveServices::VisualSearch::V1_0::Models::Identifiable
|
|
35
|
+
Response = Azure::CognitiveServices::VisualSearch::V1_0::Models::Response
|
|
36
|
+
ImageKnowledge = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageKnowledge
|
|
37
|
+
ErrorResponse = Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorResponse
|
|
38
|
+
Thing = Azure::CognitiveServices::VisualSearch::V1_0::Models::Thing
|
|
39
|
+
CreativeWork = Azure::CognitiveServices::VisualSearch::V1_0::Models::CreativeWork
|
|
40
|
+
Action = Azure::CognitiveServices::VisualSearch::V1_0::Models::Action
|
|
41
|
+
MediaObject = Azure::CognitiveServices::VisualSearch::V1_0::Models::MediaObject
|
|
42
|
+
Person = Azure::CognitiveServices::VisualSearch::V1_0::Models::Person
|
|
43
|
+
Intangible = Azure::CognitiveServices::VisualSearch::V1_0::Models::Intangible
|
|
44
|
+
ImageEntityAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageEntityAction
|
|
45
|
+
ImageModuleAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageModuleAction
|
|
46
|
+
Recipe = Azure::CognitiveServices::VisualSearch::V1_0::Models::Recipe
|
|
47
|
+
ImageRecipesAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageRecipesAction
|
|
48
|
+
ImageRelatedSearchesAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageRelatedSearchesAction
|
|
49
|
+
ImageShoppingSourcesAction = Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageShoppingSourcesAction
|
|
50
|
+
StructuredValue = Azure::CognitiveServices::VisualSearch::V1_0::Models::StructuredValue
|
|
51
|
+
Rating = Azure::CognitiveServices::VisualSearch::V1_0::Models::Rating
|
|
52
|
+
Currency = Azure::CognitiveServices::VisualSearch::V1_0::Models::Currency
|
|
53
|
+
ItemAvailability = Azure::CognitiveServices::VisualSearch::V1_0::Models::ItemAvailability
|
|
54
|
+
ErrorCode = Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorCode
|
|
55
|
+
ErrorSubCode = Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorSubCode
|
|
56
|
+
SafeSearch = Azure::CognitiveServices::VisualSearch::V1_0::Models::SafeSearch
|
|
57
|
+
ContentTypes = Azure::CognitiveServices::VisualSearch::V1_0::Models::ContentTypes
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
#
|
|
61
|
+
# VisualSearchDataClass
|
|
62
|
+
#
|
|
63
|
+
class VisualSearchDataClass
|
|
64
|
+
attr_reader :images, :configurable, :base_url, :options, :model_classes
|
|
65
|
+
|
|
66
|
+
def initialize(options = {})
|
|
67
|
+
if options.is_a?(Hash) && options.length == 0
|
|
68
|
+
@options = setup_default_options
|
|
69
|
+
else
|
|
70
|
+
@options = options
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
reset!(options)
|
|
74
|
+
|
|
75
|
+
@configurable = self
|
|
76
|
+
@base_url = options[:base_url].nil? ? nil:options[:base_url]
|
|
77
|
+
@options = options[:options].nil? ? nil:options[:options]
|
|
78
|
+
|
|
79
|
+
@client_0 = Azure::CognitiveServices::VisualSearch::V1_0::VisualSearchClient.new(configurable.credentials, base_url, options)
|
|
80
|
+
if(@client_0.respond_to?(:subscription_id))
|
|
81
|
+
@client_0.subscription_id = configurable.subscription_id
|
|
82
|
+
end
|
|
83
|
+
add_telemetry(@client_0)
|
|
84
|
+
@images = @client_0.images
|
|
85
|
+
|
|
86
|
+
@model_classes = ModelClasses.new
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def add_telemetry(client)
|
|
90
|
+
profile_information = 'Profiles/Latest/VisualSearch'
|
|
91
|
+
client.add_user_agent_information(profile_information)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def method_missing(method, *args)
|
|
95
|
+
if @client_0.respond_to?method
|
|
96
|
+
@client_0.send(method, *args)
|
|
97
|
+
else
|
|
98
|
+
super
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
class ModelClasses
|
|
105
|
+
def error
|
|
106
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Error
|
|
107
|
+
end
|
|
108
|
+
def crop_area
|
|
109
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::CropArea
|
|
110
|
+
end
|
|
111
|
+
def image_info
|
|
112
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageInfo
|
|
113
|
+
end
|
|
114
|
+
def image_tag_region
|
|
115
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageTagRegion
|
|
116
|
+
end
|
|
117
|
+
def images_image_metadata
|
|
118
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImagesImageMetadata
|
|
119
|
+
end
|
|
120
|
+
def related_searches_module
|
|
121
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::RelatedSearchesModule
|
|
122
|
+
end
|
|
123
|
+
def filters
|
|
124
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Filters
|
|
125
|
+
end
|
|
126
|
+
def images_module
|
|
127
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImagesModule
|
|
128
|
+
end
|
|
129
|
+
def knowledge_request
|
|
130
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::KnowledgeRequest
|
|
131
|
+
end
|
|
132
|
+
def recipes_module
|
|
133
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::RecipesModule
|
|
134
|
+
end
|
|
135
|
+
def response_base
|
|
136
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ResponseBase
|
|
137
|
+
end
|
|
138
|
+
def query
|
|
139
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Query
|
|
140
|
+
end
|
|
141
|
+
def visual_search_request
|
|
142
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::VisualSearchRequest
|
|
143
|
+
end
|
|
144
|
+
def properties_item
|
|
145
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::PropertiesItem
|
|
146
|
+
end
|
|
147
|
+
def point2_d
|
|
148
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Point2D
|
|
149
|
+
end
|
|
150
|
+
def normalized_quadrilateral
|
|
151
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::NormalizedQuadrilateral
|
|
152
|
+
end
|
|
153
|
+
def image_action
|
|
154
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageAction
|
|
155
|
+
end
|
|
156
|
+
def image_tag
|
|
157
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageTag
|
|
158
|
+
end
|
|
159
|
+
def organization
|
|
160
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Organization
|
|
161
|
+
end
|
|
162
|
+
def aggregate_rating
|
|
163
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::AggregateRating
|
|
164
|
+
end
|
|
165
|
+
def offer
|
|
166
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Offer
|
|
167
|
+
end
|
|
168
|
+
def aggregate_offer
|
|
169
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::AggregateOffer
|
|
170
|
+
end
|
|
171
|
+
def image_object
|
|
172
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageObject
|
|
173
|
+
end
|
|
174
|
+
def identifiable
|
|
175
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Identifiable
|
|
176
|
+
end
|
|
177
|
+
def response
|
|
178
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Response
|
|
179
|
+
end
|
|
180
|
+
def image_knowledge
|
|
181
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageKnowledge
|
|
182
|
+
end
|
|
183
|
+
def error_response
|
|
184
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorResponse
|
|
185
|
+
end
|
|
186
|
+
def thing
|
|
187
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Thing
|
|
188
|
+
end
|
|
189
|
+
def creative_work
|
|
190
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::CreativeWork
|
|
191
|
+
end
|
|
192
|
+
def action
|
|
193
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Action
|
|
194
|
+
end
|
|
195
|
+
def media_object
|
|
196
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::MediaObject
|
|
197
|
+
end
|
|
198
|
+
def person
|
|
199
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Person
|
|
200
|
+
end
|
|
201
|
+
def intangible
|
|
202
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Intangible
|
|
203
|
+
end
|
|
204
|
+
def image_entity_action
|
|
205
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageEntityAction
|
|
206
|
+
end
|
|
207
|
+
def image_module_action
|
|
208
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageModuleAction
|
|
209
|
+
end
|
|
210
|
+
def recipe
|
|
211
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Recipe
|
|
212
|
+
end
|
|
213
|
+
def image_recipes_action
|
|
214
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageRecipesAction
|
|
215
|
+
end
|
|
216
|
+
def image_related_searches_action
|
|
217
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageRelatedSearchesAction
|
|
218
|
+
end
|
|
219
|
+
def image_shopping_sources_action
|
|
220
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ImageShoppingSourcesAction
|
|
221
|
+
end
|
|
222
|
+
def structured_value
|
|
223
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::StructuredValue
|
|
224
|
+
end
|
|
225
|
+
def rating
|
|
226
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Rating
|
|
227
|
+
end
|
|
228
|
+
def currency
|
|
229
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::Currency
|
|
230
|
+
end
|
|
231
|
+
def item_availability
|
|
232
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ItemAvailability
|
|
233
|
+
end
|
|
234
|
+
def error_code
|
|
235
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorCode
|
|
236
|
+
end
|
|
237
|
+
def error_sub_code
|
|
238
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ErrorSubCode
|
|
239
|
+
end
|
|
240
|
+
def safe_search
|
|
241
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::SafeSearch
|
|
242
|
+
end
|
|
243
|
+
def content_types
|
|
244
|
+
Azure::CognitiveServices::VisualSearch::V1_0::Models::ContentTypes
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|