azure_mgmt_sqlvirtualmachine 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine.rb +71 -0
  4. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/availability_group_listeners.rb +684 -0
  5. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/additional_features_server_configurations.rb +57 -0
  6. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/auto_backup_settings.rb +173 -0
  7. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/auto_patching_settings.rb +85 -0
  8. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/availability_group_listener.rb +130 -0
  9. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/availability_group_listener_list_result.rb +100 -0
  10. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/backup_schedule_type.rb +16 -0
  11. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/cluster_configuration.rb +15 -0
  12. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/cluster_manager_type.rb +15 -0
  13. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/connectivity_type.rb +17 -0
  14. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/day_of_week.rb +21 -0
  15. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/disk_configuration_type.rb +17 -0
  16. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/full_backup_frequency_type.rb +16 -0
  17. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/identity_type.rb +15 -0
  18. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/key_vault_credential_settings.rb +91 -0
  19. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/load_balancer_configuration.rb +100 -0
  20. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/operation.rb +95 -0
  21. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/operation_display.rb +85 -0
  22. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/operation_list_result.rb +100 -0
  23. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/operation_origin.rb +16 -0
  24. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/private_ipaddress.rb +58 -0
  25. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/proxy_resource.rb +62 -0
  26. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/resource.rb +80 -0
  27. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/resource_identity.rb +72 -0
  28. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/scale_type.rb +15 -0
  29. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/server_configurations_management_settings.rb +84 -0
  30. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_connectivity_update_settings.rb +80 -0
  31. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_image_sku.rb +19 -0
  32. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_server_license_type.rb +16 -0
  33. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_storage_update_settings.rb +58 -0
  34. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine.rb +237 -0
  35. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine_group.rb +174 -0
  36. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine_group_list_result.rb +100 -0
  37. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine_group_update.rb +54 -0
  38. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine_list_result.rb +100 -0
  39. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_virtual_machine_update.rb +54 -0
  40. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_workload_type.rb +17 -0
  41. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/sql_workload_type_update_settings.rb +47 -0
  42. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/tracked_resource.rb +92 -0
  43. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/wsfc_domain_credentials.rb +69 -0
  44. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/models/wsfc_domain_profile.rb +130 -0
  45. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/module_definition.rb +9 -0
  46. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/operations.rb +219 -0
  47. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machine_groups.rb +1000 -0
  48. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machine_management_client.rb +143 -0
  49. data/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb +980 -0
  50. data/lib/azure_mgmt_sqlvirtualmachine.rb +6 -0
  51. data/lib/module_definition.rb +8 -0
  52. data/lib/profiles/latest/modules/sqlvirtualmachine_profile_module.rb +227 -0
  53. data/lib/profiles/latest/sqlvirtualmachine_latest_profile_client.rb +40 -0
  54. data/lib/profiles/latest/sqlvirtualmachine_module_definition.rb +8 -0
  55. data/lib/version.rb +7 -0
  56. metadata +173 -0
@@ -0,0 +1,17 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ module Models
8
+ #
9
+ # Defines values for SqlWorkloadType
10
+ #
11
+ module SqlWorkloadType
12
+ GENERAL = "GENERAL"
13
+ OLTP = "OLTP"
14
+ DW = "DW"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,47 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ module Models
8
+ #
9
+ # Set workload type to optimize storage for SQL Server.
10
+ #
11
+ class SqlWorkloadTypeUpdateSettings
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [SqlWorkloadType] SQL Server workload type. Possible values
16
+ # include: 'GENERAL', 'OLTP', 'DW'
17
+ attr_accessor :sql_workload_type
18
+
19
+
20
+ #
21
+ # Mapper for SqlWorkloadTypeUpdateSettings class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'SqlWorkloadTypeUpdateSettings',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'SqlWorkloadTypeUpdateSettings',
32
+ model_properties: {
33
+ sql_workload_type: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'sqlWorkloadType',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,92 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ module Models
8
+ #
9
+ # ARM tracked top level resource.
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Resource location.
16
+ attr_accessor :location
17
+
18
+ # @return [Hash{String => String}] Resource tags.
19
+ attr_accessor :tags
20
+
21
+
22
+ #
23
+ # Mapper for TrackedResource class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'TrackedResource',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'TrackedResource',
34
+ model_properties: {
35
+ id: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'id',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'name',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ type: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'type',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ location: {
63
+ client_side_validation: true,
64
+ required: true,
65
+ serialized_name: 'location',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ tags: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ serialized_name: 'tags',
74
+ type: {
75
+ name: 'Dictionary',
76
+ value: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'StringElementType',
80
+ type: {
81
+ name: 'String'
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,69 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ module Models
8
+ #
9
+ # Domain credentials for setting up Windows Server Failover Cluster for SQL
10
+ # availability group.
11
+ #
12
+ class WsfcDomainCredentials
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Cluster bootstrap account password.
17
+ attr_accessor :cluster_bootstrap_account_password
18
+
19
+ # @return [String] Cluster operator account password.
20
+ attr_accessor :cluster_operator_account_password
21
+
22
+ # @return [String] SQL service account password.
23
+ attr_accessor :sql_service_account_password
24
+
25
+
26
+ #
27
+ # Mapper for WsfcDomainCredentials class as Ruby Hash.
28
+ # This will be used for serialization/deserialization.
29
+ #
30
+ def self.mapper()
31
+ {
32
+ client_side_validation: true,
33
+ required: false,
34
+ serialized_name: 'WsfcDomainCredentials',
35
+ type: {
36
+ name: 'Composite',
37
+ class_name: 'WsfcDomainCredentials',
38
+ model_properties: {
39
+ cluster_bootstrap_account_password: {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'clusterBootstrapAccountPassword',
43
+ type: {
44
+ name: 'String'
45
+ }
46
+ },
47
+ cluster_operator_account_password: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ serialized_name: 'clusterOperatorAccountPassword',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ sql_service_account_password: {
56
+ client_side_validation: true,
57
+ required: false,
58
+ serialized_name: 'sqlServiceAccountPassword',
59
+ type: {
60
+ name: 'String'
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,130 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ module Models
8
+ #
9
+ # Active Directory account details to operate Windows Server Failover
10
+ # Cluster.
11
+ #
12
+ class WsfcDomainProfile
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Fully qualified name of the domain.
17
+ attr_accessor :domain_fqdn
18
+
19
+ # @return [String] Organizational Unit path in which the nodes and
20
+ # cluster will be present.
21
+ attr_accessor :ou_path
22
+
23
+ # @return [String] Account name used for creating cluster (at minimum
24
+ # needs permissions to 'Create Computer Objects' in domain).
25
+ attr_accessor :cluster_bootstrap_account
26
+
27
+ # @return [String] Account name used for operating cluster i.e. will be
28
+ # part of administrators group on all the participating virtual machines
29
+ # in the cluster.
30
+ attr_accessor :cluster_operator_account
31
+
32
+ # @return [String] Account name under which SQL service will run on all
33
+ # participating SQL virtual machines in the cluster.
34
+ attr_accessor :sql_service_account
35
+
36
+ # @return [String] Optional path for fileshare witness.
37
+ attr_accessor :file_share_witness_path
38
+
39
+ # @return [String] Fully qualified ARM resource id of the witness storage
40
+ # account.
41
+ attr_accessor :storage_account_url
42
+
43
+ # @return [String] Primary key of the witness storage account.
44
+ attr_accessor :storage_account_primary_key
45
+
46
+
47
+ #
48
+ # Mapper for WsfcDomainProfile class as Ruby Hash.
49
+ # This will be used for serialization/deserialization.
50
+ #
51
+ def self.mapper()
52
+ {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'WsfcDomainProfile',
56
+ type: {
57
+ name: 'Composite',
58
+ class_name: 'WsfcDomainProfile',
59
+ model_properties: {
60
+ domain_fqdn: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'domainFqdn',
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ },
68
+ ou_path: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'ouPath',
72
+ type: {
73
+ name: 'String'
74
+ }
75
+ },
76
+ cluster_bootstrap_account: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'clusterBootstrapAccount',
80
+ type: {
81
+ name: 'String'
82
+ }
83
+ },
84
+ cluster_operator_account: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ serialized_name: 'clusterOperatorAccount',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ },
92
+ sql_service_account: {
93
+ client_side_validation: true,
94
+ required: false,
95
+ serialized_name: 'sqlServiceAccount',
96
+ type: {
97
+ name: 'String'
98
+ }
99
+ },
100
+ file_share_witness_path: {
101
+ client_side_validation: true,
102
+ required: false,
103
+ serialized_name: 'fileShareWitnessPath',
104
+ type: {
105
+ name: 'String'
106
+ }
107
+ },
108
+ storage_account_url: {
109
+ client_side_validation: true,
110
+ required: false,
111
+ serialized_name: 'storageAccountUrl',
112
+ type: {
113
+ name: 'String'
114
+ }
115
+ },
116
+ storage_account_primary_key: {
117
+ client_side_validation: true,
118
+ required: false,
119
+ serialized_name: 'storageAccountPrimaryKey',
120
+ type: {
121
+ name: 'String'
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ end
128
+ end
129
+ end
130
+ end
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure end
7
+ module Azure::Sqlvirtualmachine end
8
+ module Azure::Sqlvirtualmachine::Mgmt end
9
+ module Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview end
@@ -0,0 +1,219 @@
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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
7
+ #
8
+ # The SQL virtual machine management API provides a RESTful set of web APIs
9
+ # that interact with Azure Compute, Network & Storage services to manage your
10
+ # SQL Server virtual machine. The API enables users to create, delete and
11
+ # retrieve a SQL virtual machine, SQL virtual machine group or availability
12
+ # group listener.
13
+ #
14
+ class Operations
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the Operations class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return [SqlVirtualMachineManagementClient] reference to the SqlVirtualMachineManagementClient
26
+ attr_reader :client
27
+
28
+ #
29
+ # Lists all of the available SQL Rest API operations.
30
+ #
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<Operation>] operation results.
35
+ #
36
+ def list(custom_headers:nil)
37
+ first_page = list_as_lazy(custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Lists all of the available SQL Rest API operations.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Lists all of the available SQL Rest API operations.
55
+ #
56
+ # @param [Hash{String => String}] A hash of custom headers that will be added
57
+ # to the HTTP request.
58
+ #
59
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
60
+ #
61
+ def list_async(custom_headers:nil)
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = 'providers/Microsoft.SqlVirtualMachine/operations'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:get, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview::Models::OperationListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Lists all of the available SQL Rest API operations.
112
+ #
113
+ # @param next_page_link [String] The NextLink from the previous successful call
114
+ # to List operation.
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [OperationListResult] operation results.
119
+ #
120
+ def list_next(next_page_link, custom_headers:nil)
121
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
122
+ response.body unless response.nil?
123
+ end
124
+
125
+ #
126
+ # Lists all of the available SQL Rest API operations.
127
+ #
128
+ # @param next_page_link [String] The NextLink from the previous successful call
129
+ # to List operation.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
134
+ #
135
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
136
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
137
+ end
138
+
139
+ #
140
+ # Lists all of the available SQL Rest API operations.
141
+ #
142
+ # @param next_page_link [String] The NextLink from the previous successful call
143
+ # to List operation.
144
+ # @param [Hash{String => String}] A hash of custom headers that will be added
145
+ # to the HTTP request.
146
+ #
147
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
148
+ #
149
+ def list_next_async(next_page_link, custom_headers:nil)
150
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
151
+
152
+
153
+ request_headers = {}
154
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
155
+
156
+ # Set Headers
157
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
158
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
159
+ path_template = '{nextLink}'
160
+
161
+ request_url = @base_url || @client.base_url
162
+
163
+ options = {
164
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
165
+ skip_encoding_path_params: {'nextLink' => next_page_link},
166
+ headers: request_headers.merge(custom_headers || {}),
167
+ base_url: request_url
168
+ }
169
+ promise = @client.make_request_async(:get, path_template, options)
170
+
171
+ promise = promise.then do |result|
172
+ http_response = result.response
173
+ status_code = http_response.status
174
+ response_content = http_response.body
175
+ unless status_code == 200
176
+ error_model = JSON.load(response_content)
177
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
178
+ end
179
+
180
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
181
+ # Deserialize Response
182
+ if status_code == 200
183
+ begin
184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
185
+ result_mapper = Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview::Models::OperationListResult.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response)
187
+ rescue Exception => e
188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
+ end
190
+ end
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Lists all of the available SQL Rest API operations.
200
+ #
201
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
202
+ # will be added to the HTTP request.
203
+ #
204
+ # @return [OperationListResult] which provide lazy access to pages of the
205
+ # response.
206
+ #
207
+ def list_as_lazy(custom_headers:nil)
208
+ response = list_async(custom_headers:custom_headers).value!
209
+ unless response.nil?
210
+ page = response.body
211
+ page.next_method = Proc.new do |next_page_link|
212
+ list_next_async(next_page_link, custom_headers:custom_headers)
213
+ end
214
+ page
215
+ end
216
+ end
217
+
218
+ end
219
+ end