azure_mgmt_netapp 0.20.0 → 0.20.1

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  3. data/lib/2019-05-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  4. data/lib/2019-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  5. data/lib/2019-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  6. data/lib/2019-08-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  7. data/lib/2019-10-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  8. data/lib/2019-11-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  9. data/lib/2020-02-01/generated/azure_mgmt_netapp.rb +71 -0
  10. data/lib/2020-02-01/generated/azure_mgmt_netapp/accounts.rb +709 -0
  11. data/lib/2020-02-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +153 -0
  12. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/active_directory.rb +160 -0
  13. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  14. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  15. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  16. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  17. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  18. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  19. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  20. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +115 -0
  21. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  22. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  23. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  24. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mount_target.rb +218 -0
  25. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +152 -0
  26. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  27. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  28. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  29. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  30. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  31. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  32. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  33. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  34. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  35. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  36. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  37. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  38. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  39. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  40. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/snapshot.rb +123 -0
  41. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  42. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume.rb +328 -0
  43. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  44. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  45. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  46. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +62 -0
  47. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  48. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  49. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_snapshot_properties.rb +46 -0
  50. data/lib/2020-02-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  51. data/lib/2020-02-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  52. data/lib/2020-02-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  53. data/lib/2020-02-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  54. data/lib/2020-02-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  55. data/lib/2020-02-01/generated/azure_mgmt_netapp/volumes.rb +1688 -0
  56. data/lib/azure_mgmt_netapp.rb +1 -0
  57. data/lib/profiles/latest/modules/netapp_profile_module.rb +101 -97
  58. data/lib/version.rb +1 -1
  59. metadata +49 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5932a1171c6fb2b3f27c2151b61c2a7a37fd9cfac1efe98108fed81bfb71ff11
4
- data.tar.gz: d3c230e35c9c7497fbb7863978cae9b75451420134c979cd7116b1eaec98309f
3
+ metadata.gz: 767ffc2604dcf172c20a17538d30ec13027ea7224de9fb3a97c15d9636aab653
4
+ data.tar.gz: 6714bb11f5f75d0e62a808f84b44f4d4ee1b78f7b56b00424d249a2af8c281b8
5
5
  SHA512:
6
- metadata.gz: 43070afb2328d5931020dc2379c45211c54f6e743bf4cf740ce5ffaf44e69dc6665d499ac03f6eee37c3fb206a5333f3dfb15c7a9fd6497fa26a6197657c9962
7
- data.tar.gz: 56682658c1cf25baef85e0898cb4bb123fd4bf09055b4c6469e16e8e194f9c00a4b45367222b90d874548318712f2cac6a72e6b9e02475ba1107fcaa9b793066
6
+ metadata.gz: 30b6b9ed0f3fa25ef95084e28f182e5732fe926b286b1265fa00c01697bbfeff67ac202b3a515839326b73dbaf75aff39674cf4d352175bbf88fc8cadc15cdda
7
+ data.tar.gz: 83d0e401caefdf65739a1c6b574dd88e8367f914e7f3379dfd07c7004afe4c8656892b864595d86c49e45e221deb2fd33dbe0eb05c6b3f31599cb71272a563dd
@@ -146,7 +146,7 @@ module Azure::NetApp::Mgmt::V2017_08_15_preview
146
146
  #
147
147
  def add_telemetry
148
148
  sdk_information = 'azure_mgmt_netapp'
149
- sdk_information = "#{sdk_information}/0.20.0"
149
+ sdk_information = "#{sdk_information}/0.20.1"
150
150
  add_user_agent_information(sdk_information)
151
151
  end
152
152
  end
@@ -412,7 +412,7 @@ module Azure::NetApp::Mgmt::V2019_05_01
412
412
  #
413
413
  def add_telemetry
414
414
  sdk_information = 'azure_mgmt_netapp'
415
- sdk_information = "#{sdk_information}/0.20.0"
415
+ sdk_information = "#{sdk_information}/0.20.1"
416
416
  add_user_agent_information(sdk_information)
417
417
  end
418
418
  end
@@ -412,7 +412,7 @@ module Azure::NetApp::Mgmt::V2019_06_01
412
412
  #
413
413
  def add_telemetry
414
414
  sdk_information = 'azure_mgmt_netapp'
415
- sdk_information = "#{sdk_information}/0.20.0"
415
+ sdk_information = "#{sdk_information}/0.20.1"
416
416
  add_user_agent_information(sdk_information)
417
417
  end
418
418
  end
@@ -412,7 +412,7 @@ module Azure::NetApp::Mgmt::V2019_07_01
412
412
  #
413
413
  def add_telemetry
414
414
  sdk_information = 'azure_mgmt_netapp'
415
- sdk_information = "#{sdk_information}/0.20.0"
415
+ sdk_information = "#{sdk_information}/0.20.1"
416
416
  add_user_agent_information(sdk_information)
417
417
  end
418
418
  end
@@ -150,7 +150,7 @@ module Azure::NetApp::Mgmt::V2019_08_01
150
150
  #
151
151
  def add_telemetry
152
152
  sdk_information = 'azure_mgmt_netapp'
153
- sdk_information = "#{sdk_information}/0.20.0"
153
+ sdk_information = "#{sdk_information}/0.20.1"
154
154
  add_user_agent_information(sdk_information)
155
155
  end
156
156
  end
@@ -150,7 +150,7 @@ module Azure::NetApp::Mgmt::V2019_10_01
150
150
  #
151
151
  def add_telemetry
152
152
  sdk_information = 'azure_mgmt_netapp'
153
- sdk_information = "#{sdk_information}/0.20.0"
153
+ sdk_information = "#{sdk_information}/0.20.1"
154
154
  add_user_agent_information(sdk_information)
155
155
  end
156
156
  end
@@ -146,7 +146,7 @@ module Azure::NetApp::Mgmt::V2019_11_01
146
146
  #
147
147
  def add_telemetry
148
148
  sdk_information = 'azure_mgmt_netapp'
149
- sdk_information = "#{sdk_information}/0.20.0"
149
+ sdk_information = "#{sdk_information}/0.20.1"
150
150
  add_user_agent_information(sdk_information)
151
151
  end
152
152
  end
@@ -0,0 +1,71 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2020-02-01/generated/azure_mgmt_netapp/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::NetApp::Mgmt::V2020_02_01
23
+ autoload :Operations, '2020-02-01/generated/azure_mgmt_netapp/operations.rb'
24
+ autoload :NetAppResource, '2020-02-01/generated/azure_mgmt_netapp/net_app_resource.rb'
25
+ autoload :Accounts, '2020-02-01/generated/azure_mgmt_netapp/accounts.rb'
26
+ autoload :Pools, '2020-02-01/generated/azure_mgmt_netapp/pools.rb'
27
+ autoload :Volumes, '2020-02-01/generated/azure_mgmt_netapp/volumes.rb'
28
+ autoload :Snapshots, '2020-02-01/generated/azure_mgmt_netapp/snapshots.rb'
29
+ autoload :AzureNetAppFilesManagementClient, '2020-02-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb'
30
+
31
+ module Models
32
+ autoload :ExportPolicyRule, '2020-02-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb'
33
+ autoload :VolumePropertiesExportPolicy, '2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb'
34
+ autoload :Dimension, '2020-02-01/generated/azure_mgmt_netapp/models/dimension.rb'
35
+ autoload :MountTargetProperties, '2020-02-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb'
36
+ autoload :ServiceSpecification, '2020-02-01/generated/azure_mgmt_netapp/models/service_specification.rb'
37
+ autoload :ReplicationObject, '2020-02-01/generated/azure_mgmt_netapp/models/replication_object.rb'
38
+ autoload :OperationListResult, '2020-02-01/generated/azure_mgmt_netapp/models/operation_list_result.rb'
39
+ autoload :VolumeSnapshotProperties, '2020-02-01/generated/azure_mgmt_netapp/models/volume_snapshot_properties.rb'
40
+ autoload :ResourceNameAvailabilityRequest, '2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb'
41
+ autoload :VolumePropertiesDataProtection, '2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb'
42
+ autoload :NetAppAccount, '2020-02-01/generated/azure_mgmt_netapp/models/net_app_account.rb'
43
+ autoload :Volume, '2020-02-01/generated/azure_mgmt_netapp/models/volume.rb'
44
+ autoload :NetAppAccountPatch, '2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb'
45
+ autoload :VolumeList, '2020-02-01/generated/azure_mgmt_netapp/models/volume_list.rb'
46
+ autoload :CapacityPoolList, '2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb'
47
+ autoload :ReplicationStatus, '2020-02-01/generated/azure_mgmt_netapp/models/replication_status.rb'
48
+ autoload :OperationDisplay, '2020-02-01/generated/azure_mgmt_netapp/models/operation_display.rb'
49
+ autoload :VolumePatchPropertiesExportPolicy, '2020-02-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb'
50
+ autoload :Operation, '2020-02-01/generated/azure_mgmt_netapp/models/operation.rb'
51
+ autoload :VolumePatch, '2020-02-01/generated/azure_mgmt_netapp/models/volume_patch.rb'
52
+ autoload :ActiveDirectory, '2020-02-01/generated/azure_mgmt_netapp/models/active_directory.rb'
53
+ autoload :MountTarget, '2020-02-01/generated/azure_mgmt_netapp/models/mount_target.rb'
54
+ autoload :CapacityPool, '2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool.rb'
55
+ autoload :Snapshot, '2020-02-01/generated/azure_mgmt_netapp/models/snapshot.rb'
56
+ autoload :MetricSpecification, '2020-02-01/generated/azure_mgmt_netapp/models/metric_specification.rb'
57
+ autoload :SnapshotsList, '2020-02-01/generated/azure_mgmt_netapp/models/snapshots_list.rb'
58
+ autoload :NetAppAccountList, '2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb'
59
+ autoload :VolumeRevert, '2020-02-01/generated/azure_mgmt_netapp/models/volume_revert.rb'
60
+ autoload :ResourceNameAvailability, '2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb'
61
+ autoload :AuthorizeRequest, '2020-02-01/generated/azure_mgmt_netapp/models/authorize_request.rb'
62
+ autoload :CapacityPoolPatch, '2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb'
63
+ autoload :InAvailabilityReasonType, '2020-02-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb'
64
+ autoload :CheckNameResourceTypes, '2020-02-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb'
65
+ autoload :ServiceLevel, '2020-02-01/generated/azure_mgmt_netapp/models/service_level.rb'
66
+ autoload :EndpointType, '2020-02-01/generated/azure_mgmt_netapp/models/endpoint_type.rb'
67
+ autoload :ReplicationSchedule, '2020-02-01/generated/azure_mgmt_netapp/models/replication_schedule.rb'
68
+ autoload :RelationshipStatus, '2020-02-01/generated/azure_mgmt_netapp/models/relationship_status.rb'
69
+ autoload :MirrorState, '2020-02-01/generated/azure_mgmt_netapp/models/mirror_state.rb'
70
+ end
71
+ end
@@ -0,0 +1,709 @@
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::NetApp::Mgmt::V2020_02_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Accounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Accounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describe all NetApp Accounts in a resource group
26
+ #
27
+ # List and describe all NetApp accounts in the resource group.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [NetAppAccountList] operation results.
34
+ #
35
+ def list(resource_group_name, custom_headers:nil)
36
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Describe all NetApp Accounts in a resource group
42
+ #
43
+ # List and describe all NetApp accounts in the resource group.
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(resource_group_name, custom_headers:nil)
52
+ list_async(resource_group_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Describe all NetApp Accounts in a resource group
57
+ #
58
+ # List and describe all NetApp accounts in the resource group.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(resource_group_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+
74
+
75
+ request_headers = {}
76
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
88
+ query_params: {'api-version' => @client.api_version},
89
+ headers: request_headers.merge(custom_headers || {}),
90
+ base_url: request_url
91
+ }
92
+ promise = @client.make_request_async(:get, path_template, options)
93
+
94
+ promise = promise.then do |result|
95
+ http_response = result.response
96
+ status_code = http_response.status
97
+ response_content = http_response.body
98
+ unless status_code == 200
99
+ error_model = JSON.load(response_content)
100
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
101
+ end
102
+
103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
104
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
105
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccountList.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Describe a NetApp Account
125
+ #
126
+ # Get the NetApp account
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group.
129
+ # @param account_name [String] The name of the NetApp account
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [NetAppAccount] operation results.
134
+ #
135
+ def get(resource_group_name, account_name, custom_headers:nil)
136
+ response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
137
+ response.body unless response.nil?
138
+ end
139
+
140
+ #
141
+ # Describe a NetApp Account
142
+ #
143
+ # Get the NetApp account
144
+ #
145
+ # @param resource_group_name [String] The name of the resource group.
146
+ # @param account_name [String] The name of the NetApp account
147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
+ # will be added to the HTTP request.
149
+ #
150
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
151
+ #
152
+ def get_with_http_info(resource_group_name, account_name, custom_headers:nil)
153
+ get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
154
+ end
155
+
156
+ #
157
+ # Describe a NetApp Account
158
+ #
159
+ # Get the NetApp account
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group.
162
+ # @param account_name [String] The name of the NetApp account
163
+ # @param [Hash{String => String}] A hash of custom headers that will be added
164
+ # to the HTTP request.
165
+ #
166
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
167
+ #
168
+ def get_async(resource_group_name, account_name, custom_headers:nil)
169
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
172
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
173
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
174
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
176
+
177
+
178
+ request_headers = {}
179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
180
+
181
+ # Set Headers
182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
184
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
185
+
186
+ request_url = @base_url || @client.base_url
187
+
188
+ options = {
189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
190
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
191
+ query_params: {'api-version' => @client.api_version},
192
+ headers: request_headers.merge(custom_headers || {}),
193
+ base_url: request_url
194
+ }
195
+ promise = @client.make_request_async(:get, path_template, options)
196
+
197
+ promise = promise.then do |result|
198
+ http_response = result.response
199
+ status_code = http_response.status
200
+ response_content = http_response.body
201
+ unless status_code == 200
202
+ error_model = JSON.load(response_content)
203
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
204
+ end
205
+
206
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
207
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
208
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
+ rescue Exception => e
216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
+ end
218
+ end
219
+
220
+ result
221
+ end
222
+
223
+ promise.execute
224
+ end
225
+
226
+ #
227
+ # Create or update a NetApp account
228
+ #
229
+ # Create or update the specified NetApp account within the resource group
230
+ #
231
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
232
+ # operation.
233
+ # @param resource_group_name [String] The name of the resource group.
234
+ # @param account_name [String] The name of the NetApp account
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [NetAppAccount] operation results.
239
+ #
240
+ def create_or_update(body, resource_group_name, account_name, custom_headers:nil)
241
+ response = create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
242
+ response.body unless response.nil?
243
+ end
244
+
245
+ #
246
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
247
+ # operation.
248
+ # @param resource_group_name [String] The name of the resource group.
249
+ # @param account_name [String] The name of the NetApp account
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] promise which provides async access to http
254
+ # response.
255
+ #
256
+ def create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
257
+ # Send request
258
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers)
259
+
260
+ promise = promise.then do |response|
261
+ # Defining deserialization method.
262
+ deserialize_method = lambda do |parsed_response|
263
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
264
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
265
+ end
266
+
267
+ # Waiting for response.
268
+ @client.get_long_running_operation_result(response, deserialize_method)
269
+ end
270
+
271
+ promise
272
+ end
273
+
274
+ #
275
+ # Delete a NetApp account
276
+ #
277
+ # Delete the specified NetApp account
278
+ #
279
+ # @param resource_group_name [String] The name of the resource group.
280
+ # @param account_name [String] The name of the NetApp account
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ def delete(resource_group_name, account_name, custom_headers:nil)
285
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
286
+ nil
287
+ end
288
+
289
+ #
290
+ # @param resource_group_name [String] The name of the resource group.
291
+ # @param account_name [String] The name of the NetApp account
292
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
+ # will be added to the HTTP request.
294
+ #
295
+ # @return [Concurrent::Promise] promise which provides async access to http
296
+ # response.
297
+ #
298
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
299
+ # Send request
300
+ promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers)
301
+
302
+ promise = promise.then do |response|
303
+ # Defining deserialization method.
304
+ deserialize_method = lambda do |parsed_response|
305
+ end
306
+
307
+ # Waiting for response.
308
+ @client.get_long_running_operation_result(response, deserialize_method)
309
+ end
310
+
311
+ promise
312
+ end
313
+
314
+ #
315
+ # Update a NetApp account
316
+ #
317
+ # Patch the specified NetApp account
318
+ #
319
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
320
+ # of the operation.
321
+ # @param resource_group_name [String] The name of the resource group.
322
+ # @param account_name [String] The name of the NetApp account
323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
324
+ # will be added to the HTTP request.
325
+ #
326
+ # @return [NetAppAccount] operation results.
327
+ #
328
+ def update(body, resource_group_name, account_name, custom_headers:nil)
329
+ response = update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
330
+ response.body unless response.nil?
331
+ end
332
+
333
+ #
334
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
335
+ # of the operation.
336
+ # @param resource_group_name [String] The name of the resource group.
337
+ # @param account_name [String] The name of the NetApp account
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ # @return [Concurrent::Promise] promise which provides async access to http
342
+ # response.
343
+ #
344
+ def update_async(body, resource_group_name, account_name, custom_headers:nil)
345
+ # Send request
346
+ promise = begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers)
347
+
348
+ promise = promise.then do |response|
349
+ # Defining deserialization method.
350
+ deserialize_method = lambda do |parsed_response|
351
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
352
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
353
+ end
354
+
355
+ # Waiting for response.
356
+ @client.get_long_running_operation_result(response, deserialize_method)
357
+ end
358
+
359
+ promise
360
+ end
361
+
362
+ #
363
+ # Create or update a NetApp account
364
+ #
365
+ # Create or update the specified NetApp account within the resource group
366
+ #
367
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
368
+ # operation.
369
+ # @param resource_group_name [String] The name of the resource group.
370
+ # @param account_name [String] The name of the NetApp account
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [NetAppAccount] operation results.
375
+ #
376
+ def begin_create_or_update(body, resource_group_name, account_name, custom_headers:nil)
377
+ response = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
378
+ response.body unless response.nil?
379
+ end
380
+
381
+ #
382
+ # Create or update a NetApp account
383
+ #
384
+ # Create or update the specified NetApp account within the resource group
385
+ #
386
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
387
+ # operation.
388
+ # @param resource_group_name [String] The name of the resource group.
389
+ # @param account_name [String] The name of the NetApp account
390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
391
+ # will be added to the HTTP request.
392
+ #
393
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
+ #
395
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
396
+ begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
397
+ end
398
+
399
+ #
400
+ # Create or update a NetApp account
401
+ #
402
+ # Create or update the specified NetApp account within the resource group
403
+ #
404
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
405
+ # operation.
406
+ # @param resource_group_name [String] The name of the resource group.
407
+ # @param account_name [String] The name of the NetApp account
408
+ # @param [Hash{String => String}] A hash of custom headers that will be added
409
+ # to the HTTP request.
410
+ #
411
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
412
+ #
413
+ def begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
414
+ fail ArgumentError, 'body is nil' if body.nil?
415
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
416
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
417
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
418
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
419
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
420
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
421
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
422
+
423
+
424
+ request_headers = {}
425
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
426
+
427
+ # Set Headers
428
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
429
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
430
+
431
+ # Serialize Request
432
+ request_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
433
+ request_content = @client.serialize(request_mapper, body)
434
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
435
+
436
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
437
+
438
+ request_url = @base_url || @client.base_url
439
+
440
+ options = {
441
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
442
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
443
+ query_params: {'api-version' => @client.api_version},
444
+ body: request_content,
445
+ headers: request_headers.merge(custom_headers || {}),
446
+ base_url: request_url
447
+ }
448
+ promise = @client.make_request_async(:put, path_template, options)
449
+
450
+ promise = promise.then do |result|
451
+ http_response = result.response
452
+ status_code = http_response.status
453
+ response_content = http_response.body
454
+ unless status_code == 200 || status_code == 201 || status_code == 202
455
+ error_model = JSON.load(response_content)
456
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
457
+ end
458
+
459
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
460
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
461
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
462
+ # Deserialize Response
463
+ if status_code == 200
464
+ begin
465
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
466
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
467
+ result.body = @client.deserialize(result_mapper, parsed_response)
468
+ rescue Exception => e
469
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
470
+ end
471
+ end
472
+ # Deserialize Response
473
+ if status_code == 201
474
+ begin
475
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
476
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
477
+ result.body = @client.deserialize(result_mapper, parsed_response)
478
+ rescue Exception => e
479
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
480
+ end
481
+ end
482
+
483
+ result
484
+ end
485
+
486
+ promise.execute
487
+ end
488
+
489
+ #
490
+ # Delete a NetApp account
491
+ #
492
+ # Delete the specified NetApp account
493
+ #
494
+ # @param resource_group_name [String] The name of the resource group.
495
+ # @param account_name [String] The name of the NetApp account
496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
497
+ # will be added to the HTTP request.
498
+ #
499
+ #
500
+ def begin_delete(resource_group_name, account_name, custom_headers:nil)
501
+ response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
502
+ nil
503
+ end
504
+
505
+ #
506
+ # Delete a NetApp account
507
+ #
508
+ # Delete the specified NetApp account
509
+ #
510
+ # @param resource_group_name [String] The name of the resource group.
511
+ # @param account_name [String] The name of the NetApp account
512
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
513
+ # will be added to the HTTP request.
514
+ #
515
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
516
+ #
517
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
518
+ begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
519
+ end
520
+
521
+ #
522
+ # Delete a NetApp account
523
+ #
524
+ # Delete the specified NetApp account
525
+ #
526
+ # @param resource_group_name [String] The name of the resource group.
527
+ # @param account_name [String] The name of the NetApp account
528
+ # @param [Hash{String => String}] A hash of custom headers that will be added
529
+ # to the HTTP request.
530
+ #
531
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
532
+ #
533
+ def begin_delete_async(resource_group_name, account_name, custom_headers:nil)
534
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
535
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
536
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
537
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
538
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
539
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
540
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
541
+
542
+
543
+ request_headers = {}
544
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
545
+
546
+ # Set Headers
547
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
548
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
549
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
550
+
551
+ request_url = @base_url || @client.base_url
552
+
553
+ options = {
554
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
555
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
556
+ query_params: {'api-version' => @client.api_version},
557
+ headers: request_headers.merge(custom_headers || {}),
558
+ base_url: request_url
559
+ }
560
+ promise = @client.make_request_async(:delete, path_template, options)
561
+
562
+ promise = promise.then do |result|
563
+ http_response = result.response
564
+ status_code = http_response.status
565
+ response_content = http_response.body
566
+ unless status_code == 202 || status_code == 204
567
+ error_model = JSON.load(response_content)
568
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
569
+ end
570
+
571
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
572
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
573
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
574
+
575
+ result
576
+ end
577
+
578
+ promise.execute
579
+ end
580
+
581
+ #
582
+ # Update a NetApp account
583
+ #
584
+ # Patch the specified NetApp account
585
+ #
586
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
587
+ # of the operation.
588
+ # @param resource_group_name [String] The name of the resource group.
589
+ # @param account_name [String] The name of the NetApp account
590
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
591
+ # will be added to the HTTP request.
592
+ #
593
+ # @return [NetAppAccount] operation results.
594
+ #
595
+ def begin_update(body, resource_group_name, account_name, custom_headers:nil)
596
+ response = begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
597
+ response.body unless response.nil?
598
+ end
599
+
600
+ #
601
+ # Update a NetApp account
602
+ #
603
+ # Patch the specified NetApp account
604
+ #
605
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
606
+ # of the operation.
607
+ # @param resource_group_name [String] The name of the resource group.
608
+ # @param account_name [String] The name of the NetApp account
609
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
610
+ # will be added to the HTTP request.
611
+ #
612
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
613
+ #
614
+ def begin_update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
615
+ begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
616
+ end
617
+
618
+ #
619
+ # Update a NetApp account
620
+ #
621
+ # Patch the specified NetApp account
622
+ #
623
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
624
+ # of the operation.
625
+ # @param resource_group_name [String] The name of the resource group.
626
+ # @param account_name [String] The name of the NetApp account
627
+ # @param [Hash{String => String}] A hash of custom headers that will be added
628
+ # to the HTTP request.
629
+ #
630
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
+ #
632
+ def begin_update_async(body, resource_group_name, account_name, custom_headers:nil)
633
+ fail ArgumentError, 'body is nil' if body.nil?
634
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
635
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
636
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
637
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
638
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
639
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
641
+
642
+
643
+ request_headers = {}
644
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
+
646
+ # Set Headers
647
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
+
650
+ # Serialize Request
651
+ request_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccountPatch.mapper()
652
+ request_content = @client.serialize(request_mapper, body)
653
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
654
+
655
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
656
+
657
+ request_url = @base_url || @client.base_url
658
+
659
+ options = {
660
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
661
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
662
+ query_params: {'api-version' => @client.api_version},
663
+ body: request_content,
664
+ headers: request_headers.merge(custom_headers || {}),
665
+ base_url: request_url
666
+ }
667
+ promise = @client.make_request_async(:patch, path_template, options)
668
+
669
+ promise = promise.then do |result|
670
+ http_response = result.response
671
+ status_code = http_response.status
672
+ response_content = http_response.body
673
+ unless status_code == 200 || status_code == 201 || status_code == 202
674
+ error_model = JSON.load(response_content)
675
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
676
+ end
677
+
678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
+ # Deserialize Response
682
+ if status_code == 200
683
+ begin
684
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
685
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
686
+ result.body = @client.deserialize(result_mapper, parsed_response)
687
+ rescue Exception => e
688
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
689
+ end
690
+ end
691
+ # Deserialize Response
692
+ if status_code == 201
693
+ begin
694
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
695
+ result_mapper = Azure::NetApp::Mgmt::V2020_02_01::Models::NetAppAccount.mapper()
696
+ result.body = @client.deserialize(result_mapper, parsed_response)
697
+ rescue Exception => e
698
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
699
+ end
700
+ end
701
+
702
+ result
703
+ end
704
+
705
+ promise.execute
706
+ end
707
+
708
+ end
709
+ end