azure_mgmt_digitaltwins 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b37effb0390f519de40f3daef526071a215eaa086430f6883d89d0165ab65664
4
- data.tar.gz: 0d7123c45085d382e9fc237595a6dbf3597c824d168681b52bc237cb4864137a
3
+ metadata.gz: 29fe64acc9b3a4086c22d8a7a1f019d45e86ebaa97fce4cfa122a1b8766f8e6b
4
+ data.tar.gz: 79dbe21454148c3c3211ed2326fbdd4e77feee7e88ca179ef060ae358daec655
5
5
  SHA512:
6
- metadata.gz: e61e88df9100e8963d4c8bf1ac7f8941b631e08902b48c831590314386073b49cc230558626bfc2aaa6381f93a81288b803e04c0c4655e0d14d2d1bf40c966dc
7
- data.tar.gz: ab1ab5796bdabadb0b23ad1859e09f2749d7bdc0e1997cb5150a7a77aaa6cfd8ce784225d2570bae80927ea08cd5bba685530ceb405891848fa54a8edf5d47cd
6
+ metadata.gz: 24fbb70247c79c300057654d38cf02b92f5ddc056f501d1349fff1ce7d3f093cc03c9ec5a916b4d4a06a26c3f2aafa5c760e52a66d6a98270790243a5063531c
7
+ data.tar.gz: 439edd2d26801c26ff43fe348afdd0e454537bd0547017f6eef9dd2c3bcf07361e6e843c01d4212b712299de5714a7cbef5ca216c4b33860378e71e3381ca147
@@ -132,7 +132,7 @@ module Azure::DigitalTwins::Mgmt::V2020_10_31
132
132
  #
133
133
  def add_telemetry
134
134
  sdk_information = 'azure_mgmt_digitaltwins'
135
- sdk_information = "#{sdk_information}/0.17.0"
135
+ sdk_information = "#{sdk_information}/0.18.0"
136
136
  add_user_agent_information(sdk_information)
137
137
  end
138
138
  end
@@ -193,6 +193,8 @@ module Azure::DigitalTwins::Mgmt::V2020_10_31
193
193
  response.body unless response.nil?
194
194
  end
195
195
 
196
+ #
197
+ # Update metadata of DigitalTwinsInstance.
196
198
  #
197
199
  # @param resource_group_name [String] The name of the resource group that
198
200
  # contains the DigitalTwinsInstance.
@@ -202,25 +204,92 @@ module Azure::DigitalTwins::Mgmt::V2020_10_31
202
204
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
205
  # will be added to the HTTP request.
204
206
  #
205
- # @return [Concurrent::Promise] promise which provides async access to http
206
- # response.
207
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
208
+ #
209
+ def update_with_http_info(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:nil)
210
+ update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:custom_headers).value!
211
+ end
212
+
213
+ #
214
+ # Update metadata of DigitalTwinsInstance.
215
+ #
216
+ # @param resource_group_name [String] The name of the resource group that
217
+ # contains the DigitalTwinsInstance.
218
+ # @param resource_name [String] The name of the DigitalTwinsInstance.
219
+ # @param digital_twins_patch_description [DigitalTwinsPatchDescription] The
220
+ # DigitalTwinsInstance and security metadata.
221
+ # @param [Hash{String => String}] A hash of custom headers that will be added
222
+ # to the HTTP request.
223
+ #
224
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
207
225
  #
208
226
  def update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:nil)
209
- # Send request
210
- promise = begin_update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:custom_headers)
227
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '10'" if !@client.api_version.nil? && @client.api_version.length < 10
228
+ @client.api_version = '2020-10-31'
229
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
230
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
231
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
232
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
233
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
234
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
235
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
236
+ fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$$')).nil?
237
+ fail ArgumentError, 'digital_twins_patch_description is nil' if digital_twins_patch_description.nil?
211
238
 
212
- promise = promise.then do |response|
213
- # Defining deserialization method.
214
- deserialize_method = lambda do |parsed_response|
215
- result_mapper = Azure::DigitalTwins::Mgmt::V2020_10_31::Models::DigitalTwinsDescription.mapper()
216
- parsed_response = @client.deserialize(result_mapper, parsed_response)
239
+
240
+ request_headers = {}
241
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
242
+
243
+ # Set Headers
244
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
245
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
246
+
247
+ # Serialize Request
248
+ request_mapper = Azure::DigitalTwins::Mgmt::V2020_10_31::Models::DigitalTwinsPatchDescription.mapper()
249
+ request_content = @client.serialize(request_mapper, digital_twins_patch_description)
250
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
251
+
252
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}'
253
+
254
+ request_url = @base_url || @client.base_url
255
+
256
+ options = {
257
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
258
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
259
+ query_params: {'api-version' => @client.api_version},
260
+ body: request_content,
261
+ headers: request_headers.merge(custom_headers || {}),
262
+ base_url: request_url
263
+ }
264
+ promise = @client.make_request_async(:patch, path_template, options)
265
+
266
+ promise = promise.then do |result|
267
+ http_response = result.response
268
+ status_code = http_response.status
269
+ response_content = http_response.body
270
+ unless status_code == 200
271
+ error_model = JSON.load(response_content)
272
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
217
273
  end
218
274
 
219
- # Waiting for response.
220
- @client.get_long_running_operation_result(response, deserialize_method)
275
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
276
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
277
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
278
+ # Deserialize Response
279
+ if status_code == 200
280
+ begin
281
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
282
+ result_mapper = Azure::DigitalTwins::Mgmt::V2020_10_31::Models::DigitalTwinsDescription.mapper()
283
+ result.body = @client.deserialize(result_mapper, parsed_response)
284
+ rescue Exception => e
285
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
286
+ end
287
+ end
288
+
289
+ result
221
290
  end
222
291
 
223
- promise
292
+ promise.execute
224
293
  end
225
294
 
226
295
  #
@@ -695,123 +764,6 @@ module Azure::DigitalTwins::Mgmt::V2020_10_31
695
764
  promise.execute
696
765
  end
697
766
 
698
- #
699
- # Update metadata of DigitalTwinsInstance.
700
- #
701
- # @param resource_group_name [String] The name of the resource group that
702
- # contains the DigitalTwinsInstance.
703
- # @param resource_name [String] The name of the DigitalTwinsInstance.
704
- # @param digital_twins_patch_description [DigitalTwinsPatchDescription] The
705
- # DigitalTwinsInstance and security metadata.
706
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
707
- # will be added to the HTTP request.
708
- #
709
- # @return [DigitalTwinsDescription] operation results.
710
- #
711
- def begin_update(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:nil)
712
- response = begin_update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:custom_headers).value!
713
- response.body unless response.nil?
714
- end
715
-
716
- #
717
- # Update metadata of DigitalTwinsInstance.
718
- #
719
- # @param resource_group_name [String] The name of the resource group that
720
- # contains the DigitalTwinsInstance.
721
- # @param resource_name [String] The name of the DigitalTwinsInstance.
722
- # @param digital_twins_patch_description [DigitalTwinsPatchDescription] The
723
- # DigitalTwinsInstance and security metadata.
724
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
725
- # will be added to the HTTP request.
726
- #
727
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
728
- #
729
- def begin_update_with_http_info(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:nil)
730
- begin_update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:custom_headers).value!
731
- end
732
-
733
- #
734
- # Update metadata of DigitalTwinsInstance.
735
- #
736
- # @param resource_group_name [String] The name of the resource group that
737
- # contains the DigitalTwinsInstance.
738
- # @param resource_name [String] The name of the DigitalTwinsInstance.
739
- # @param digital_twins_patch_description [DigitalTwinsPatchDescription] The
740
- # DigitalTwinsInstance and security metadata.
741
- # @param [Hash{String => String}] A hash of custom headers that will be added
742
- # to the HTTP request.
743
- #
744
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
745
- #
746
- def begin_update_async(resource_group_name, resource_name, digital_twins_patch_description, custom_headers:nil)
747
- fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '10'" if !@client.api_version.nil? && @client.api_version.length < 10
748
- @client.api_version = '2020-10-31'
749
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
750
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
751
- fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '64'" if !resource_group_name.nil? && resource_group_name.length > 64
752
- fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
753
- fail ArgumentError, 'resource_name is nil' if resource_name.nil?
754
- fail ArgumentError, "'resource_name' should satisfy the constraint - 'MaxLength': '63'" if !resource_name.nil? && resource_name.length > 63
755
- fail ArgumentError, "'resource_name' should satisfy the constraint - 'MinLength': '3'" if !resource_name.nil? && resource_name.length < 3
756
- fail ArgumentError, "'resource_name' should satisfy the constraint - 'Pattern': '^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$'" if !resource_name.nil? && resource_name.match(Regexp.new('^^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$$')).nil?
757
- fail ArgumentError, 'digital_twins_patch_description is nil' if digital_twins_patch_description.nil?
758
-
759
-
760
- request_headers = {}
761
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
762
-
763
- # Set Headers
764
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
765
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
766
-
767
- # Serialize Request
768
- request_mapper = Azure::DigitalTwins::Mgmt::V2020_10_31::Models::DigitalTwinsPatchDescription.mapper()
769
- request_content = @client.serialize(request_mapper, digital_twins_patch_description)
770
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
771
-
772
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}'
773
-
774
- request_url = @base_url || @client.base_url
775
-
776
- options = {
777
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
778
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
779
- query_params: {'api-version' => @client.api_version},
780
- body: request_content,
781
- headers: request_headers.merge(custom_headers || {}),
782
- base_url: request_url
783
- }
784
- promise = @client.make_request_async(:patch, path_template, options)
785
-
786
- promise = promise.then do |result|
787
- http_response = result.response
788
- status_code = http_response.status
789
- response_content = http_response.body
790
- unless status_code == 200
791
- error_model = JSON.load(response_content)
792
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
793
- end
794
-
795
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
796
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
797
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
798
- # Deserialize Response
799
- if status_code == 200
800
- begin
801
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
802
- result_mapper = Azure::DigitalTwins::Mgmt::V2020_10_31::Models::DigitalTwinsDescription.mapper()
803
- result.body = @client.deserialize(result_mapper, parsed_response)
804
- rescue Exception => e
805
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
806
- end
807
- end
808
-
809
- result
810
- end
811
-
812
- promise.execute
813
- end
814
-
815
767
  #
816
768
  # Delete a DigitalTwinsInstance.
817
769
  #
@@ -62,7 +62,7 @@ module Azure::DigitalTwins::Mgmt::V2020_10_31
62
62
  },
63
63
  properties: {
64
64
  client_side_validation: true,
65
- required: false,
65
+ required: true,
66
66
  serialized_name: 'properties',
67
67
  type: {
68
68
  name: 'Composite',
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::Digitaltwins::Mgmt
6
- VERSION = '0.17.0'
6
+ VERSION = '0.18.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_digitaltwins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-24 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler