azure_mgmt_cognitive_services 0.15.2 → 0.16.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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services.rb +44 -0
  3. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb +1018 -0
  4. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +131 -0
  5. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +163 -0
  6. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +112 -0
  7. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_enumerate_skus_result.rb +58 -0
  8. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb +57 -0
  9. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb +57 -0
  10. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_update_parameters.rb +70 -0
  11. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb +59 -0
  12. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/error.rb +48 -0
  13. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/error_body.rb +58 -0
  14. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/key_name.rb +16 -0
  15. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/kind.rb +31 -0
  16. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/provisioning_state.rb +18 -0
  17. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb +48 -0
  18. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/sku.rb +62 -0
  19. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/sku_name.rb +25 -0
  20. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/models/sku_tier.rb +17 -0
  21. data/lib/2016-02-01-preview/generated/azure_mgmt_cognitive_services/module_definition.rb +9 -0
  22. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/accounts.rb +72 -67
  23. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/check_sku_availability.rb +15 -13
  24. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +4 -1
  25. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb +6 -5
  26. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb +6 -5
  27. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +2 -3
  28. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +4 -2
  29. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/kind.rb +4 -0
  30. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/models/provisioning_state.rb +2 -0
  31. data/lib/2017-04-18/generated/azure_mgmt_cognitive_services/operations.rb +15 -13
  32. data/lib/azure_mgmt_cognitive_services.rb +1 -0
  33. data/lib/profiles/latest/cognitiveservices_latest_profile_client.rb +28 -9
  34. data/lib/profiles/latest/cognitiveservices_module_definition.rb +0 -1
  35. data/lib/profiles/latest/modules/cognitiveservices_profile_module.rb +96 -77
  36. data/lib/version.rb +1 -1
  37. metadata +22 -2
@@ -0,0 +1,131 @@
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::Mgmt::V2016_02_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class CognitiveServicesManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Azure Subscription ID.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] Version of the API to be used with the client request.
24
+ # Current version is 2016-02-01-preview
25
+ attr_reader :api_version
26
+
27
+ # @return [String] Gets or sets the preferred language for the response.
28
+ attr_accessor :accept_language
29
+
30
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
31
+ # Running Operations. Default value is 30.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
35
+ # is generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [CognitiveServicesAccounts] cognitive_services_accounts
39
+ attr_reader :cognitive_services_accounts
40
+
41
+ #
42
+ # Creates initializes a new instance of the CognitiveServicesManagementClient class.
43
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
44
+ # @param base_url [String] the base URI of the service.
45
+ # @param options [Array] filters to be applied to the HTTP requests.
46
+ #
47
+ def initialize(credentials = nil, base_url = nil, options = nil)
48
+ super(credentials, options)
49
+ @base_url = base_url || 'https://management.azure.com'
50
+
51
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
52
+ @credentials = credentials
53
+
54
+ @cognitive_services_accounts = CognitiveServicesAccounts.new(self)
55
+ @api_version = '2016-02-01-preview'
56
+ @accept_language = 'en-US'
57
+ @long_running_operation_retry_timeout = 30
58
+ @generate_client_request_id = true
59
+ add_telemetry
60
+ end
61
+
62
+ #
63
+ # Makes a request and returns the body of the response.
64
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
65
+ # @param path [String] the path, relative to {base_url}.
66
+ # @param options [Hash{String=>String}] specifying any request options like :body.
67
+ # @return [Hash{String=>String}] containing the body of the response.
68
+ # Example:
69
+ #
70
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
71
+ # path = "/path"
72
+ # options = {
73
+ # body: request_content,
74
+ # query_params: {'api-version' => '2016-02-01'}
75
+ # }
76
+ # result = @client.make_request(:put, path, options)
77
+ #
78
+ def make_request(method, path, options = {})
79
+ result = make_request_with_http_info(method, path, options)
80
+ result.body unless result.nil?
81
+ end
82
+
83
+ #
84
+ # Makes a request and returns the operation response.
85
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
86
+ # @param path [String] the path, relative to {base_url}.
87
+ # @param options [Hash{String=>String}] specifying any request options like :body.
88
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
89
+ #
90
+ def make_request_with_http_info(method, path, options = {})
91
+ result = make_request_async(method, path, options).value!
92
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
93
+ result
94
+ end
95
+
96
+ #
97
+ # Makes a request asynchronously.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
102
+ #
103
+ def make_request_async(method, path, options = {})
104
+ fail ArgumentError, 'method is nil' if method.nil?
105
+ fail ArgumentError, 'path is nil' if path.nil?
106
+
107
+ request_url = options[:base_url] || @base_url
108
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
109
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
110
+ end
111
+
112
+ request_headers = @request_headers
113
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
114
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
115
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
116
+
117
+ super(request_url, method, path, options)
118
+ end
119
+
120
+
121
+ private
122
+ #
123
+ # Adds telemetry information.
124
+ #
125
+ def add_telemetry
126
+ sdk_information = 'azure_mgmt_cognitive_services'
127
+ sdk_information = "#{sdk_information}/0.16.0"
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,163 @@
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::Mgmt::V2016_02_01_preview
7
+ module Models
8
+ #
9
+ # Cognitive Services Account is an Azure resource representing the
10
+ # provisioned account, its type, location and SKU.
11
+ #
12
+ class CognitiveServicesAccount
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Entity Tag
17
+ attr_accessor :etag
18
+
19
+ # @return [String] The id of the created account
20
+ attr_accessor :id
21
+
22
+ # @return [String] Type of cognitive service account.
23
+ attr_accessor :kind
24
+
25
+ # @return [String] The location of the resource
26
+ attr_accessor :location
27
+
28
+ # @return [String] The name of the created account
29
+ attr_accessor :name
30
+
31
+ # @return [ProvisioningState] Gets the status of the cognitive services
32
+ # account at the time the operation was called. Possible values include:
33
+ # 'Creating', 'ResolvingDNS', 'Succeeded', 'Failed'
34
+ attr_accessor :provisioning_state
35
+
36
+ # @return [String] Endpoint of the created account
37
+ attr_accessor :endpoint
38
+
39
+ # @return [Sku]
40
+ attr_accessor :sku
41
+
42
+ # @return [Hash{String => String}] Gets or sets a list of key value pairs
43
+ # that describe the resource. These tags can be used in viewing and
44
+ # grouping this resource (across resource groups). A maximum of 15 tags
45
+ # can be provided for a resource. Each tag must have a key no greater
46
+ # than 128 characters and value no greater than 256 characters.
47
+ attr_accessor :tags
48
+
49
+ # @return [String] Resource type
50
+ attr_accessor :type
51
+
52
+
53
+ #
54
+ # Mapper for CognitiveServicesAccount class as Ruby Hash.
55
+ # This will be used for serialization/deserialization.
56
+ #
57
+ def self.mapper()
58
+ {
59
+ client_side_validation: true,
60
+ required: false,
61
+ serialized_name: 'CognitiveServicesAccount',
62
+ type: {
63
+ name: 'Composite',
64
+ class_name: 'CognitiveServicesAccount',
65
+ model_properties: {
66
+ etag: {
67
+ client_side_validation: true,
68
+ required: false,
69
+ serialized_name: 'etag',
70
+ type: {
71
+ name: 'String'
72
+ }
73
+ },
74
+ id: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'id',
78
+ type: {
79
+ name: 'String'
80
+ }
81
+ },
82
+ kind: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ serialized_name: 'kind',
86
+ type: {
87
+ name: 'String'
88
+ }
89
+ },
90
+ location: {
91
+ client_side_validation: true,
92
+ required: false,
93
+ serialized_name: 'location',
94
+ type: {
95
+ name: 'String'
96
+ }
97
+ },
98
+ name: {
99
+ client_side_validation: true,
100
+ required: false,
101
+ serialized_name: 'name',
102
+ type: {
103
+ name: 'String'
104
+ }
105
+ },
106
+ provisioning_state: {
107
+ client_side_validation: true,
108
+ required: false,
109
+ read_only: true,
110
+ serialized_name: 'properties.provisioningState',
111
+ type: {
112
+ name: 'Enum',
113
+ module: 'ProvisioningState'
114
+ }
115
+ },
116
+ endpoint: {
117
+ client_side_validation: true,
118
+ required: false,
119
+ serialized_name: 'properties.endpoint',
120
+ type: {
121
+ name: 'String'
122
+ }
123
+ },
124
+ sku: {
125
+ client_side_validation: true,
126
+ required: false,
127
+ serialized_name: 'sku',
128
+ type: {
129
+ name: 'Composite',
130
+ class_name: 'Sku'
131
+ }
132
+ },
133
+ tags: {
134
+ client_side_validation: true,
135
+ required: false,
136
+ serialized_name: 'tags',
137
+ type: {
138
+ name: 'Dictionary',
139
+ value: {
140
+ client_side_validation: true,
141
+ required: false,
142
+ serialized_name: 'StringElementType',
143
+ type: {
144
+ name: 'String'
145
+ }
146
+ }
147
+ }
148
+ },
149
+ type: {
150
+ client_side_validation: true,
151
+ required: false,
152
+ serialized_name: 'type',
153
+ type: {
154
+ name: 'String'
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ end
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,112 @@
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::Mgmt::V2016_02_01_preview
7
+ module Models
8
+ #
9
+ # The parameters to provide for the account.
10
+ #
11
+ class CognitiveServicesAccountCreateParameters
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Sku]
16
+ attr_accessor :sku
17
+
18
+ # @return [Kind] Required. Indicates the type of cognitive service
19
+ # account. Possible values include: 'Academic', 'Bing.Autosuggest',
20
+ # 'Bing.Search', 'Bing.Speech', 'Bing.SpellCheck', 'ComputerVision',
21
+ # 'ContentModerator', 'Emotion', 'Face', 'LUIS', 'Recommendations',
22
+ # 'SpeakerRecognition', 'Speech', 'SpeechTranslation', 'TextAnalytics',
23
+ # 'TextTranslation', 'WebLM'
24
+ attr_accessor :kind
25
+
26
+ # @return [String] Required. Gets or sets the location of the resource.
27
+ # This will be one of the supported and registered Azure Geo Regions
28
+ # (e.g. West US, East US, Southeast Asia, etc.). The geo region of a
29
+ # resource cannot be changed once it is created, but if an identical geo
30
+ # region is specified on update the request will succeed.
31
+ attr_accessor :location
32
+
33
+ # @return [Hash{String => String}] Gets or sets a list of key value pairs
34
+ # that describe the resource. These tags can be used in viewing and
35
+ # grouping this resource (across resource groups). A maximum of 15 tags
36
+ # can be provided for a resource. Each tag must have a key no greater
37
+ # than 128 characters and value no greater than 256 characters.
38
+ attr_accessor :tags
39
+
40
+ # @return Must exist in the request. Must not be null.
41
+ attr_accessor :properties
42
+
43
+
44
+ #
45
+ # Mapper for CognitiveServicesAccountCreateParameters class as Ruby Hash.
46
+ # This will be used for serialization/deserialization.
47
+ #
48
+ def self.mapper()
49
+ {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'CognitiveServicesAccountCreateParameters',
53
+ type: {
54
+ name: 'Composite',
55
+ class_name: 'CognitiveServicesAccountCreateParameters',
56
+ model_properties: {
57
+ sku: {
58
+ client_side_validation: true,
59
+ required: true,
60
+ serialized_name: 'sku',
61
+ type: {
62
+ name: 'Composite',
63
+ class_name: 'Sku'
64
+ }
65
+ },
66
+ kind: {
67
+ client_side_validation: true,
68
+ required: true,
69
+ serialized_name: 'kind',
70
+ type: {
71
+ name: 'String'
72
+ }
73
+ },
74
+ location: {
75
+ client_side_validation: true,
76
+ required: true,
77
+ serialized_name: 'location',
78
+ type: {
79
+ name: 'String'
80
+ }
81
+ },
82
+ tags: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ serialized_name: 'tags',
86
+ type: {
87
+ name: 'Dictionary',
88
+ value: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ serialized_name: 'StringElementType',
92
+ type: {
93
+ name: 'String'
94
+ }
95
+ }
96
+ }
97
+ },
98
+ properties: {
99
+ client_side_validation: true,
100
+ required: true,
101
+ serialized_name: 'properties',
102
+ type: {
103
+ name: 'Object'
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ end
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,58 @@
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::Mgmt::V2016_02_01_preview
7
+ module Models
8
+ #
9
+ # The list of cognitive services accounts operation response.
10
+ #
11
+ class CognitiveServicesAccountEnumerateSkusResult
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<CognitiveServicesResourceAndSku>] Gets the list of
16
+ # Cognitive Services accounts and their properties.
17
+ attr_accessor :value
18
+
19
+
20
+ #
21
+ # Mapper for CognitiveServicesAccountEnumerateSkusResult class as Ruby
22
+ # Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'CognitiveServicesAccountEnumerateSkusResult',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'CognitiveServicesAccountEnumerateSkusResult',
33
+ model_properties: {
34
+ value: {
35
+ client_side_validation: true,
36
+ required: false,
37
+ read_only: true,
38
+ serialized_name: 'value',
39
+ type: {
40
+ name: 'Sequence',
41
+ element: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'CognitiveServicesResourceAndSkuElementType',
45
+ type: {
46
+ name: 'Composite',
47
+ class_name: 'CognitiveServicesResourceAndSku'
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end