azure_mgmt_cognitive_services 0.10.0 → 0.11.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cognitive_services.rb +17 -8
  3. data/lib/generated/azure_mgmt_cognitive_services/accounts.rb +414 -0
  4. data/lib/generated/azure_mgmt_cognitive_services/check_sku_availability.rb +148 -0
  5. data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_accounts.rb +61 -297
  6. data/lib/generated/azure_mgmt_cognitive_services/cognitive_services_management_client.rb +18 -3
  7. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_parameter.rb +77 -0
  8. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result.rb +102 -0
  9. data/lib/generated/azure_mgmt_cognitive_services/models/check_sku_availability_result_list.rb +54 -0
  10. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account.rb +14 -3
  11. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_create_parameters.rb +9 -7
  12. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_enumerate_skus_result.rb +2 -1
  13. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_keys.rb +2 -1
  14. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_list_result.rb +43 -1
  15. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_account_update_parameters.rb +3 -2
  16. data/lib/generated/azure_mgmt_cognitive_services/models/cognitive_services_resource_and_sku.rb +4 -4
  17. data/lib/generated/azure_mgmt_cognitive_services/models/error.rb +4 -4
  18. data/lib/generated/azure_mgmt_cognitive_services/models/error_body.rb +3 -3
  19. data/lib/generated/azure_mgmt_cognitive_services/models/key_name.rb +1 -1
  20. data/lib/generated/azure_mgmt_cognitive_services/models/kind.rb +2 -1
  21. data/lib/generated/azure_mgmt_cognitive_services/models/operation_display_info.rb +76 -0
  22. data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity.rb +77 -0
  23. data/lib/generated/azure_mgmt_cognitive_services/models/operation_entity_list_result.rb +94 -0
  24. data/lib/generated/azure_mgmt_cognitive_services/models/provisioning_state.rb +1 -1
  25. data/lib/generated/azure_mgmt_cognitive_services/models/regenerate_key_parameters.rb +3 -2
  26. data/lib/generated/azure_mgmt_cognitive_services/models/sku.rb +2 -1
  27. data/lib/generated/azure_mgmt_cognitive_services/models/sku_name.rb +1 -1
  28. data/lib/generated/azure_mgmt_cognitive_services/models/sku_tier.rb +1 -1
  29. data/lib/generated/azure_mgmt_cognitive_services/module_definition.rb +1 -1
  30. data/lib/generated/azure_mgmt_cognitive_services/operations.rb +213 -0
  31. data/lib/generated/azure_mgmt_cognitive_services/version.rb +2 -2
  32. metadata +13 -4
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,7 +12,8 @@ module Azure::ARM::CognitiveServices
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [Sku]
15
+ include MsRest::JSONable
16
+ # @return [Sku] Gets or sets the SKU of the resource.
16
17
  attr_accessor :sku
17
18
 
18
19
  # @return [Hash{String => String}] Gets or sets a list of key value pairs
@@ -1,22 +1,22 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CognitiveServices
7
7
  module Models
8
8
  #
9
- # Model object.
10
- #
9
+ # Cognitive Services resource type and SKU.
11
10
  #
12
11
  class CognitiveServicesResourceAndSku
13
12
 
14
13
  include MsRestAzure
15
14
 
15
+ include MsRest::JSONable
16
16
  # @return [String] Resource Namespace and Type
17
17
  attr_accessor :resource_type
18
18
 
19
- # @return [Sku]
19
+ # @return [Sku] The SKU of Cognitive Services account.
20
20
  attr_accessor :sku
21
21
 
22
22
 
@@ -1,19 +1,19 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CognitiveServices
7
7
  module Models
8
8
  #
9
- # Model object.
10
- #
9
+ # Cognitive Services error object.
11
10
  #
12
11
  class Error
13
12
 
14
13
  include MsRestAzure
15
14
 
16
- # @return [ErrorBody]
15
+ include MsRest::JSONable
16
+ # @return [ErrorBody] The error body.
17
17
  attr_accessor :error
18
18
 
19
19
 
@@ -1,18 +1,18 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CognitiveServices
7
7
  module Models
8
8
  #
9
- # Model object.
10
- #
9
+ # Cognitive Services error body.
11
10
  #
12
11
  class ErrorBody
13
12
 
14
13
  include MsRestAzure
15
14
 
15
+ include MsRest::JSONable
16
16
  # @return [String] error code
17
17
  attr_accessor :code
18
18
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -16,6 +16,7 @@ module Azure::ARM::CognitiveServices
16
16
  BingSpellCheck = "Bing.SpellCheck"
17
17
  ComputerVision = "ComputerVision"
18
18
  ContentModerator = "ContentModerator"
19
+ CustomSpeech = "CustomSpeech"
19
20
  Emotion = "Emotion"
20
21
  Face = "Face"
21
22
  LUIS = "LUIS"
@@ -0,0 +1,76 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CognitiveServices
7
+ module Models
8
+ #
9
+ # The operation supported by Cognitive Services.
10
+ #
11
+ class OperationDisplayInfo
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [String] The description of the operation.
17
+ attr_accessor :description
18
+
19
+ # @return [String] The action that users can perform, based on their
20
+ # permission level.
21
+ attr_accessor :operation
22
+
23
+ # @return [String] Service provider: Microsoft Cognitive Services.
24
+ attr_accessor :provider
25
+
26
+ # @return [String] Resource on which the operation is performed.
27
+ attr_accessor :resource
28
+
29
+
30
+ #
31
+ # Mapper for OperationDisplayInfo class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ required: false,
37
+ serialized_name: 'OperationDisplayInfo',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'OperationDisplayInfo',
41
+ model_properties: {
42
+ description: {
43
+ required: false,
44
+ serialized_name: 'description',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ operation: {
50
+ required: false,
51
+ serialized_name: 'operation',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ provider: {
57
+ required: false,
58
+ serialized_name: 'provider',
59
+ type: {
60
+ name: 'String'
61
+ }
62
+ },
63
+ resource: {
64
+ required: false,
65
+ serialized_name: 'resource',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,77 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CognitiveServices
7
+ module Models
8
+ #
9
+ # The operation supported by Cognitive Services.
10
+ #
11
+ class OperationEntity
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [String] Operation name: {provider}/{resource}/{operation}.
17
+ attr_accessor :name
18
+
19
+ # @return [OperationDisplayInfo] The operation supported by Cognitive
20
+ # Services.
21
+ attr_accessor :display
22
+
23
+ # @return [String] The origin of the operation.
24
+ attr_accessor :origin
25
+
26
+ # @return Additional properties.
27
+ attr_accessor :properties
28
+
29
+
30
+ #
31
+ # Mapper for OperationEntity class as Ruby Hash.
32
+ # This will be used for serialization/deserialization.
33
+ #
34
+ def self.mapper()
35
+ {
36
+ required: false,
37
+ serialized_name: 'OperationEntity',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'OperationEntity',
41
+ model_properties: {
42
+ name: {
43
+ required: false,
44
+ serialized_name: 'name',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ display: {
50
+ required: false,
51
+ serialized_name: 'display',
52
+ type: {
53
+ name: 'Composite',
54
+ class_name: 'OperationDisplayInfo'
55
+ }
56
+ },
57
+ origin: {
58
+ required: false,
59
+ serialized_name: 'origin',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ properties: {
65
+ required: false,
66
+ serialized_name: 'properties',
67
+ type: {
68
+ name: 'Object'
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,94 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CognitiveServices
7
+ module Models
8
+ #
9
+ # The list of cognitive services accounts operation response.
10
+ #
11
+ class OperationEntityListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [String] The link used to get the next page of operations.
17
+ attr_accessor :next_link
18
+
19
+ # @return [Array<OperationEntity>] The list of operations.
20
+ attr_accessor :value
21
+
22
+ # return [Proc] with next page method call.
23
+ attr_accessor :next_method
24
+
25
+ #
26
+ # Gets the rest of the items for the request, enabling auto-pagination.
27
+ #
28
+ # @return [Array<OperationEntity>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil do
34
+ page = page.get_next_page
35
+ items.concat(page.value)
36
+ end
37
+ items
38
+ end
39
+
40
+ #
41
+ # Gets the next page of results.
42
+ #
43
+ # @return [OperationEntityListResult] with next page content.
44
+ #
45
+ def get_next_page
46
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
47
+ unless response.nil?
48
+ @next_link = response.body.next_link
49
+ @value = response.body.value
50
+ self
51
+ end
52
+ end
53
+
54
+ #
55
+ # Mapper for OperationEntityListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ required: false,
61
+ serialized_name: 'OperationEntityListResult',
62
+ type: {
63
+ name: 'Composite',
64
+ class_name: 'OperationEntityListResult',
65
+ model_properties: {
66
+ next_link: {
67
+ required: false,
68
+ serialized_name: 'nextLink',
69
+ type: {
70
+ name: 'String'
71
+ }
72
+ },
73
+ value: {
74
+ required: false,
75
+ serialized_name: 'value',
76
+ type: {
77
+ name: 'Sequence',
78
+ element: {
79
+ required: false,
80
+ serialized_name: 'OperationEntityElementType',
81
+ type: {
82
+ name: 'Composite',
83
+ class_name: 'OperationEntity'
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ end
92
+ end
93
+ end
94
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,6 +12,7 @@ module Azure::ARM::CognitiveServices
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [KeyName] key name to generate (Key1|Key2). Possible values
16
17
  # include: 'Key1', 'Key2'
17
18
  attr_accessor :key_name
@@ -30,7 +31,7 @@ module Azure::ARM::CognitiveServices
30
31
  class_name: 'RegenerateKeyParameters',
31
32
  model_properties: {
32
33
  key_name: {
33
- required: false,
34
+ required: true,
34
35
  serialized_name: 'keyName',
35
36
  type: {
36
37
  name: 'Enum',
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,6 +12,7 @@ module Azure::ARM::CognitiveServices
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [SkuName] Gets or sets the sku name. Required for account
16
17
  # creation, optional for update. Possible values include: 'F0', 'P0',
17
18
  # 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -0,0 +1,213 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CognitiveServices
7
+ #
8
+ # Cognitive Services Management Client
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CognitiveServicesManagementClient] reference to the CognitiveServicesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all the available Cognitive Services account operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<OperationEntity>] operation results.
31
+ #
32
+ def list(custom_headers = nil)
33
+ first_page = list_as_lazy(custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all the available Cognitive Services account operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers = nil)
46
+ list_async(custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all the available Cognitive Services account operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers = nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+
63
+ # Set Headers
64
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
65
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
66
+ path_template = 'providers/Microsoft.CognitiveServices/operations'
67
+
68
+ request_url = @base_url || @client.base_url
69
+
70
+ options = {
71
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
72
+ query_params: {'api-version' => @client.api_version},
73
+ headers: request_headers.merge(custom_headers || {}),
74
+ base_url: request_url
75
+ }
76
+ promise = @client.make_request_async(:get, path_template, options)
77
+
78
+ promise = promise.then do |result|
79
+ http_response = result.response
80
+ status_code = http_response.status
81
+ response_content = http_response.body
82
+ unless status_code == 200
83
+ error_model = JSON.load(response_content)
84
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
85
+ end
86
+
87
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
88
+ # Deserialize Response
89
+ if status_code == 200
90
+ begin
91
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
92
+ result_mapper = Azure::ARM::CognitiveServices::Models::OperationEntityListResult.mapper()
93
+ result.body = @client.deserialize(result_mapper, parsed_response)
94
+ rescue Exception => e
95
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
96
+ end
97
+ end
98
+
99
+ result
100
+ end
101
+
102
+ promise.execute
103
+ end
104
+
105
+ #
106
+ # Lists all the available Cognitive Services account operations.
107
+ #
108
+ # @param next_page_link [String] The NextLink from the previous successful call
109
+ # to List operation.
110
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
111
+ # will be added to the HTTP request.
112
+ #
113
+ # @return [OperationEntityListResult] operation results.
114
+ #
115
+ def list_next(next_page_link, custom_headers = nil)
116
+ response = list_next_async(next_page_link, custom_headers).value!
117
+ response.body unless response.nil?
118
+ end
119
+
120
+ #
121
+ # Lists all the available Cognitive Services account operations.
122
+ #
123
+ # @param next_page_link [String] The NextLink from the previous successful call
124
+ # to List operation.
125
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
+ # will be added to the HTTP request.
127
+ #
128
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
129
+ #
130
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
131
+ list_next_async(next_page_link, custom_headers).value!
132
+ end
133
+
134
+ #
135
+ # Lists all the available Cognitive Services account operations.
136
+ #
137
+ # @param next_page_link [String] The NextLink from the previous successful call
138
+ # to List operation.
139
+ # @param [Hash{String => String}] A hash of custom headers that will be added
140
+ # to the HTTP request.
141
+ #
142
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
143
+ #
144
+ def list_next_async(next_page_link, custom_headers = nil)
145
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
146
+
147
+
148
+ request_headers = {}
149
+
150
+ # Set Headers
151
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
152
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
153
+ path_template = '{nextLink}'
154
+
155
+ request_url = @base_url || @client.base_url
156
+
157
+ options = {
158
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
159
+ skip_encoding_path_params: {'nextLink' => next_page_link},
160
+ headers: request_headers.merge(custom_headers || {}),
161
+ base_url: request_url
162
+ }
163
+ promise = @client.make_request_async(:get, path_template, options)
164
+
165
+ promise = promise.then do |result|
166
+ http_response = result.response
167
+ status_code = http_response.status
168
+ response_content = http_response.body
169
+ unless status_code == 200
170
+ error_model = JSON.load(response_content)
171
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
172
+ end
173
+
174
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
175
+ # Deserialize Response
176
+ if status_code == 200
177
+ begin
178
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
179
+ result_mapper = Azure::ARM::CognitiveServices::Models::OperationEntityListResult.mapper()
180
+ result.body = @client.deserialize(result_mapper, parsed_response)
181
+ rescue Exception => e
182
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
183
+ end
184
+ end
185
+
186
+ result
187
+ end
188
+
189
+ promise.execute
190
+ end
191
+
192
+ #
193
+ # Lists all the available Cognitive Services account operations.
194
+ #
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [OperationEntityListResult] which provide lazy access to pages of the
199
+ # response.
200
+ #
201
+ def list_as_lazy(custom_headers = nil)
202
+ response = list_async(custom_headers).value!
203
+ unless response.nil?
204
+ page = response.body
205
+ page.next_method = Proc.new do |next_page_link|
206
+ list_next_async(next_page_link, custom_headers)
207
+ end
208
+ page
209
+ end
210
+ end
211
+
212
+ end
213
+ end