azure_mgmt_dns 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-04-01/generated/azure_mgmt_dns/dns_management_client.rb +1 -1
  3. data/lib/2017-09-01/generated/azure_mgmt_dns/dns_management_client.rb +1 -1
  4. data/lib/2017-10-01/generated/azure_mgmt_dns.rb +47 -0
  5. data/lib/2017-10-01/generated/azure_mgmt_dns/dns_management_client.rb +135 -0
  6. data/lib/2017-10-01/generated/azure_mgmt_dns/models/aaaa_record.rb +46 -0
  7. data/lib/2017-10-01/generated/azure_mgmt_dns/models/arecord.rb +46 -0
  8. data/lib/2017-10-01/generated/azure_mgmt_dns/models/caa_record.rb +69 -0
  9. data/lib/2017-10-01/generated/azure_mgmt_dns/models/cname_record.rb +46 -0
  10. data/lib/2017-10-01/generated/azure_mgmt_dns/models/mx_record.rb +57 -0
  11. data/lib/2017-10-01/generated/azure_mgmt_dns/models/ns_record.rb +46 -0
  12. data/lib/2017-10-01/generated/azure_mgmt_dns/models/ptr_record.rb +46 -0
  13. data/lib/2017-10-01/generated/azure_mgmt_dns/models/record_set.rb +311 -0
  14. data/lib/2017-10-01/generated/azure_mgmt_dns/models/record_set_list_result.rb +100 -0
  15. data/lib/2017-10-01/generated/azure_mgmt_dns/models/record_set_update_parameters.rb +48 -0
  16. data/lib/2017-10-01/generated/azure_mgmt_dns/models/record_type.rb +24 -0
  17. data/lib/2017-10-01/generated/azure_mgmt_dns/models/resource.rb +101 -0
  18. data/lib/2017-10-01/generated/azure_mgmt_dns/models/soa_record.rb +114 -0
  19. data/lib/2017-10-01/generated/azure_mgmt_dns/models/srv_record.rb +79 -0
  20. data/lib/2017-10-01/generated/azure_mgmt_dns/models/txt_record.rb +54 -0
  21. data/lib/2017-10-01/generated/azure_mgmt_dns/models/zone.rb +146 -0
  22. data/lib/2017-10-01/generated/azure_mgmt_dns/models/zone_list_result.rb +99 -0
  23. data/lib/2017-10-01/generated/azure_mgmt_dns/models/zone_update.rb +54 -0
  24. data/lib/2017-10-01/generated/azure_mgmt_dns/module_definition.rb +9 -0
  25. data/lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb +1250 -0
  26. data/lib/2017-10-01/generated/azure_mgmt_dns/zones.rb +922 -0
  27. data/lib/2018-03-01-preview/generated/azure_mgmt_dns.rb +49 -0
  28. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/dns_management_client.rb +135 -0
  29. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/aaaa_record.rb +46 -0
  30. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/arecord.rb +46 -0
  31. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/caa_record.rb +69 -0
  32. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/cname_record.rb +46 -0
  33. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/mx_record.rb +57 -0
  34. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/ns_record.rb +46 -0
  35. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/ptr_record.rb +46 -0
  36. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/record_set.rb +311 -0
  37. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/record_set_list_result.rb +100 -0
  38. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/record_set_update_parameters.rb +48 -0
  39. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/record_type.rb +24 -0
  40. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/resource.rb +101 -0
  41. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/soa_record.rb +114 -0
  42. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/srv_record.rb +79 -0
  43. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/sub_resource.rb +46 -0
  44. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/txt_record.rb +54 -0
  45. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/zone.rb +204 -0
  46. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/zone_list_result.rb +99 -0
  47. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/zone_type.rb +16 -0
  48. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/models/zone_update.rb +54 -0
  49. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/module_definition.rb +9 -0
  50. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/record_sets.rb +1250 -0
  51. data/lib/2018-03-01-preview/generated/azure_mgmt_dns/zones.rb +922 -0
  52. data/lib/azure_mgmt_dns.rb +2 -0
  53. data/lib/profiles/latest/modules/dns_profile_module.rb +59 -47
  54. data/lib/version.rb +1 -1
  55. metadata +50 -2
@@ -0,0 +1,204 @@
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::Dns::Mgmt::V2018_03_01_preview
7
+ module Models
8
+ #
9
+ # Describes a DNS zone.
10
+ #
11
+ class Zone < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The etag of the zone.
16
+ attr_accessor :etag
17
+
18
+ # @return [Integer] The maximum number of record sets that can be created
19
+ # in this DNS zone. This is a read-only property and any attempt to set
20
+ # this value will be ignored.
21
+ attr_accessor :max_number_of_record_sets
22
+
23
+ # @return [Integer] The current number of record sets in this DNS zone.
24
+ # This is a read-only property and any attempt to set this value will be
25
+ # ignored.
26
+ attr_accessor :number_of_record_sets
27
+
28
+ # @return [Array<String>] The name servers for this DNS zone. This is a
29
+ # read-only property and any attempt to set this value will be ignored.
30
+ attr_accessor :name_servers
31
+
32
+ # @return [ZoneType] The type of this DNS zone (Public or Private).
33
+ # Possible values include: 'Public', 'Private'. Default value: 'Public' .
34
+ attr_accessor :zone_type
35
+
36
+ # @return [Array<SubResource>] A list of references to virtual networks
37
+ # that register hostnames in this DNS zone. This is a only when ZoneType
38
+ # is Private.
39
+ attr_accessor :registration_virtual_networks
40
+
41
+ # @return [Array<SubResource>] A list of references to virtual networks
42
+ # that resolve records in this DNS zone. This is a only when ZoneType is
43
+ # Private.
44
+ attr_accessor :resolution_virtual_networks
45
+
46
+
47
+ #
48
+ # Mapper for Zone 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: 'Zone',
56
+ type: {
57
+ name: 'Composite',
58
+ class_name: 'Zone',
59
+ model_properties: {
60
+ id: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ read_only: true,
64
+ serialized_name: 'id',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ },
69
+ name: {
70
+ client_side_validation: true,
71
+ required: false,
72
+ read_only: true,
73
+ serialized_name: 'name',
74
+ type: {
75
+ name: 'String'
76
+ }
77
+ },
78
+ type: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ read_only: true,
82
+ serialized_name: 'type',
83
+ type: {
84
+ name: 'String'
85
+ }
86
+ },
87
+ location: {
88
+ client_side_validation: true,
89
+ required: true,
90
+ serialized_name: 'location',
91
+ type: {
92
+ name: 'String'
93
+ }
94
+ },
95
+ tags: {
96
+ client_side_validation: true,
97
+ required: false,
98
+ serialized_name: 'tags',
99
+ type: {
100
+ name: 'Dictionary',
101
+ value: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ serialized_name: 'StringElementType',
105
+ type: {
106
+ name: 'String'
107
+ }
108
+ }
109
+ }
110
+ },
111
+ etag: {
112
+ client_side_validation: true,
113
+ required: false,
114
+ serialized_name: 'etag',
115
+ type: {
116
+ name: 'String'
117
+ }
118
+ },
119
+ max_number_of_record_sets: {
120
+ client_side_validation: true,
121
+ required: false,
122
+ read_only: true,
123
+ serialized_name: 'properties.maxNumberOfRecordSets',
124
+ type: {
125
+ name: 'Number'
126
+ }
127
+ },
128
+ number_of_record_sets: {
129
+ client_side_validation: true,
130
+ required: false,
131
+ read_only: true,
132
+ serialized_name: 'properties.numberOfRecordSets',
133
+ type: {
134
+ name: 'Number'
135
+ }
136
+ },
137
+ name_servers: {
138
+ client_side_validation: true,
139
+ required: false,
140
+ read_only: true,
141
+ serialized_name: 'properties.nameServers',
142
+ type: {
143
+ name: 'Sequence',
144
+ element: {
145
+ client_side_validation: true,
146
+ required: false,
147
+ serialized_name: 'StringElementType',
148
+ type: {
149
+ name: 'String'
150
+ }
151
+ }
152
+ }
153
+ },
154
+ zone_type: {
155
+ client_side_validation: true,
156
+ required: false,
157
+ serialized_name: 'properties.zoneType',
158
+ default_value: 'Public',
159
+ type: {
160
+ name: 'Enum',
161
+ module: 'ZoneType'
162
+ }
163
+ },
164
+ registration_virtual_networks: {
165
+ client_side_validation: true,
166
+ required: false,
167
+ serialized_name: 'properties.registrationVirtualNetworks',
168
+ type: {
169
+ name: 'Sequence',
170
+ element: {
171
+ client_side_validation: true,
172
+ required: false,
173
+ serialized_name: 'SubResourceElementType',
174
+ type: {
175
+ name: 'Composite',
176
+ class_name: 'SubResource'
177
+ }
178
+ }
179
+ }
180
+ },
181
+ resolution_virtual_networks: {
182
+ client_side_validation: true,
183
+ required: false,
184
+ serialized_name: 'properties.resolutionVirtualNetworks',
185
+ type: {
186
+ name: 'Sequence',
187
+ element: {
188
+ client_side_validation: true,
189
+ required: false,
190
+ serialized_name: 'SubResourceElementType',
191
+ type: {
192
+ name: 'Composite',
193
+ class_name: 'SubResource'
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ end
202
+ end
203
+ end
204
+ end
@@ -0,0 +1,99 @@
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::Dns::Mgmt::V2018_03_01_preview
7
+ module Models
8
+ #
9
+ # The response to a Zone List or ListAll operation.
10
+ #
11
+ class ZoneListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<Zone>] Information about the DNS zones.
17
+ attr_accessor :value
18
+
19
+ # @return [String] The continuation token for the next page of results.
20
+ attr_accessor :next_link
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<Zone>] 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 [ZoneListResult] 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 ZoneListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ client_side_validation: true,
61
+ required: false,
62
+ serialized_name: 'ZoneListResult',
63
+ type: {
64
+ name: 'Composite',
65
+ class_name: 'ZoneListResult',
66
+ model_properties: {
67
+ value: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'value',
71
+ type: {
72
+ name: 'Sequence',
73
+ element: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ serialized_name: 'ZoneElementType',
77
+ type: {
78
+ name: 'Composite',
79
+ class_name: 'Zone'
80
+ }
81
+ }
82
+ }
83
+ },
84
+ next_link: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ read_only: true,
88
+ serialized_name: 'nextLink',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,16 @@
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::Dns::Mgmt::V2018_03_01_preview
7
+ module Models
8
+ #
9
+ # Defines values for ZoneType
10
+ #
11
+ module ZoneType
12
+ Public = "Public"
13
+ Private = "Private"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,54 @@
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::Dns::Mgmt::V2018_03_01_preview
7
+ module Models
8
+ #
9
+ # Describes a request to update a DNS zone.
10
+ #
11
+ class ZoneUpdate
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Resource tags.
16
+ attr_accessor :tags
17
+
18
+
19
+ #
20
+ # Mapper for ZoneUpdate class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'ZoneUpdate',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'ZoneUpdate',
31
+ model_properties: {
32
+ tags: {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'tags',
36
+ type: {
37
+ name: 'Dictionary',
38
+ value: {
39
+ client_side_validation: true,
40
+ required: false,
41
+ serialized_name: 'StringElementType',
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ end
52
+ end
53
+ end
54
+ 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::Dns end
8
+ module Azure::Dns::Mgmt end
9
+ module Azure::Dns::Mgmt::V2018_03_01_preview end
@@ -0,0 +1,1250 @@
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::Dns::Mgmt::V2018_03_01_preview
7
+ #
8
+ # The DNS Management Client.
9
+ #
10
+ class RecordSets
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the RecordSets class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DnsManagementClient] reference to the DnsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Updates a record set within a DNS zone.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param zone_name [String] The name of the DNS zone (without a terminating
29
+ # dot).
30
+ # @param relative_record_set_name [String] The name of the record set, relative
31
+ # to the name of the zone.
32
+ # @param record_type [RecordType] The type of DNS record in this record set.
33
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
34
+ # 'SOA', 'SRV', 'TXT'
35
+ # @param parameters [RecordSet] Parameters supplied to the Update operation.
36
+ # @param if_match [String] The etag of the record set. Omit this value to
37
+ # always overwrite the current record set. Specify the last-seen etag value to
38
+ # prevent accidentally overwritting concurrent changes.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [RecordSet] operation results.
43
+ #
44
+ def update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, custom_headers:nil)
45
+ response = update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, custom_headers:custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # Updates a record set within a DNS zone.
51
+ #
52
+ # @param resource_group_name [String] The name of the resource group.
53
+ # @param zone_name [String] The name of the DNS zone (without a terminating
54
+ # dot).
55
+ # @param relative_record_set_name [String] The name of the record set, relative
56
+ # to the name of the zone.
57
+ # @param record_type [RecordType] The type of DNS record in this record set.
58
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
59
+ # 'SOA', 'SRV', 'TXT'
60
+ # @param parameters [RecordSet] Parameters supplied to the Update operation.
61
+ # @param if_match [String] The etag of the record set. Omit this value to
62
+ # always overwrite the current record set. Specify the last-seen etag value to
63
+ # prevent accidentally overwritting concurrent changes.
64
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
65
+ # will be added to the HTTP request.
66
+ #
67
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
68
+ #
69
+ def update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, custom_headers:nil)
70
+ update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, custom_headers:custom_headers).value!
71
+ end
72
+
73
+ #
74
+ # Updates a record set within a DNS zone.
75
+ #
76
+ # @param resource_group_name [String] The name of the resource group.
77
+ # @param zone_name [String] The name of the DNS zone (without a terminating
78
+ # dot).
79
+ # @param relative_record_set_name [String] The name of the record set, relative
80
+ # to the name of the zone.
81
+ # @param record_type [RecordType] The type of DNS record in this record set.
82
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
83
+ # 'SOA', 'SRV', 'TXT'
84
+ # @param parameters [RecordSet] Parameters supplied to the Update operation.
85
+ # @param if_match [String] The etag of the record set. Omit this value to
86
+ # always overwrite the current record set. Specify the last-seen etag value to
87
+ # prevent accidentally overwritting concurrent changes.
88
+ # @param [Hash{String => String}] A hash of custom headers that will be added
89
+ # to the HTTP request.
90
+ #
91
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
92
+ #
93
+ def update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, custom_headers:nil)
94
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
95
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
96
+ fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
97
+ fail ArgumentError, 'record_type is nil' if record_type.nil?
98
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
99
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
100
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
101
+
102
+
103
+ request_headers = {}
104
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
105
+
106
+ # Set Headers
107
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
108
+ request_headers['If-Match'] = if_match unless if_match.nil?
109
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
110
+
111
+ # Serialize Request
112
+ request_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
113
+ request_content = @client.serialize(request_mapper, parameters)
114
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
115
+
116
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'
117
+
118
+ request_url = @base_url || @client.base_url
119
+
120
+ options = {
121
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
122
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
123
+ skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
124
+ query_params: {'api-version' => @client.api_version},
125
+ body: request_content,
126
+ headers: request_headers.merge(custom_headers || {}),
127
+ base_url: request_url
128
+ }
129
+ promise = @client.make_request_async(:patch, path_template, options)
130
+
131
+ promise = promise.then do |result|
132
+ http_response = result.response
133
+ status_code = http_response.status
134
+ response_content = http_response.body
135
+ unless status_code == 200
136
+ error_model = JSON.load(response_content)
137
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
138
+ end
139
+
140
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
141
+ # Deserialize Response
142
+ if status_code == 200
143
+ begin
144
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
145
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
146
+ result.body = @client.deserialize(result_mapper, parsed_response)
147
+ rescue Exception => e
148
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
149
+ end
150
+ end
151
+
152
+ result
153
+ end
154
+
155
+ promise.execute
156
+ end
157
+
158
+ #
159
+ # Creates or updates a record set within a DNS zone.
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group.
162
+ # @param zone_name [String] The name of the DNS zone (without a terminating
163
+ # dot).
164
+ # @param relative_record_set_name [String] The name of the record set, relative
165
+ # to the name of the zone.
166
+ # @param record_type [RecordType] The type of DNS record in this record set.
167
+ # Record sets of type SOA can be updated but not created (they are created when
168
+ # the DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA',
169
+ # 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
170
+ # @param parameters [RecordSet] Parameters supplied to the CreateOrUpdate
171
+ # operation.
172
+ # @param if_match [String] The etag of the record set. Omit this value to
173
+ # always overwrite the current record set. Specify the last-seen etag value to
174
+ # prevent accidentally overwritting any concurrent changes.
175
+ # @param if_none_match [String] Set to '*' to allow a new record set to be
176
+ # created, but to prevent updating an existing record set. Other values will be
177
+ # ignored.
178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
179
+ # will be added to the HTTP request.
180
+ #
181
+ # @return [RecordSet] operation results.
182
+ #
183
+ def create_or_update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
184
+ response = create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
185
+ response.body unless response.nil?
186
+ end
187
+
188
+ #
189
+ # Creates or updates a record set within a DNS zone.
190
+ #
191
+ # @param resource_group_name [String] The name of the resource group.
192
+ # @param zone_name [String] The name of the DNS zone (without a terminating
193
+ # dot).
194
+ # @param relative_record_set_name [String] The name of the record set, relative
195
+ # to the name of the zone.
196
+ # @param record_type [RecordType] The type of DNS record in this record set.
197
+ # Record sets of type SOA can be updated but not created (they are created when
198
+ # the DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA',
199
+ # 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
200
+ # @param parameters [RecordSet] Parameters supplied to the CreateOrUpdate
201
+ # operation.
202
+ # @param if_match [String] The etag of the record set. Omit this value to
203
+ # always overwrite the current record set. Specify the last-seen etag value to
204
+ # prevent accidentally overwritting any concurrent changes.
205
+ # @param if_none_match [String] Set to '*' to allow a new record set to be
206
+ # created, but to prevent updating an existing record set. Other values will be
207
+ # ignored.
208
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
209
+ # will be added to the HTTP request.
210
+ #
211
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
212
+ #
213
+ def create_or_update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
214
+ create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
215
+ end
216
+
217
+ #
218
+ # Creates or updates a record set within a DNS zone.
219
+ #
220
+ # @param resource_group_name [String] The name of the resource group.
221
+ # @param zone_name [String] The name of the DNS zone (without a terminating
222
+ # dot).
223
+ # @param relative_record_set_name [String] The name of the record set, relative
224
+ # to the name of the zone.
225
+ # @param record_type [RecordType] The type of DNS record in this record set.
226
+ # Record sets of type SOA can be updated but not created (they are created when
227
+ # the DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA',
228
+ # 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
229
+ # @param parameters [RecordSet] Parameters supplied to the CreateOrUpdate
230
+ # operation.
231
+ # @param if_match [String] The etag of the record set. Omit this value to
232
+ # always overwrite the current record set. Specify the last-seen etag value to
233
+ # prevent accidentally overwritting any concurrent changes.
234
+ # @param if_none_match [String] Set to '*' to allow a new record set to be
235
+ # created, but to prevent updating an existing record set. Other values will be
236
+ # ignored.
237
+ # @param [Hash{String => String}] A hash of custom headers that will be added
238
+ # to the HTTP request.
239
+ #
240
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
241
+ #
242
+ def create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
243
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
244
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
245
+ fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
246
+ fail ArgumentError, 'record_type is nil' if record_type.nil?
247
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
248
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
249
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
250
+
251
+
252
+ request_headers = {}
253
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
254
+
255
+ # Set Headers
256
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
257
+ request_headers['If-Match'] = if_match unless if_match.nil?
258
+ request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
259
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
260
+
261
+ # Serialize Request
262
+ request_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
263
+ request_content = @client.serialize(request_mapper, parameters)
264
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
265
+
266
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'
267
+
268
+ request_url = @base_url || @client.base_url
269
+
270
+ options = {
271
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
272
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
273
+ skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
274
+ query_params: {'api-version' => @client.api_version},
275
+ body: request_content,
276
+ headers: request_headers.merge(custom_headers || {}),
277
+ base_url: request_url
278
+ }
279
+ promise = @client.make_request_async(:put, path_template, options)
280
+
281
+ promise = promise.then do |result|
282
+ http_response = result.response
283
+ status_code = http_response.status
284
+ response_content = http_response.body
285
+ unless status_code == 201 || status_code == 200
286
+ error_model = JSON.load(response_content)
287
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
288
+ end
289
+
290
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
291
+ # Deserialize Response
292
+ if status_code == 201
293
+ begin
294
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
295
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
296
+ result.body = @client.deserialize(result_mapper, parsed_response)
297
+ rescue Exception => e
298
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
299
+ end
300
+ end
301
+ # Deserialize Response
302
+ if status_code == 200
303
+ begin
304
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
305
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
306
+ result.body = @client.deserialize(result_mapper, parsed_response)
307
+ rescue Exception => e
308
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
309
+ end
310
+ end
311
+
312
+ result
313
+ end
314
+
315
+ promise.execute
316
+ end
317
+
318
+ #
319
+ # Deletes a record set from a DNS zone. This operation cannot be undone.
320
+ #
321
+ # @param resource_group_name [String] The name of the resource group.
322
+ # @param zone_name [String] The name of the DNS zone (without a terminating
323
+ # dot).
324
+ # @param relative_record_set_name [String] The name of the record set, relative
325
+ # to the name of the zone.
326
+ # @param record_type [RecordType] The type of DNS record in this record set.
327
+ # Record sets of type SOA cannot be deleted (they are deleted when the DNS zone
328
+ # is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX',
329
+ # 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
330
+ # @param if_match [String] The etag of the record set. Omit this value to
331
+ # always delete the current record set. Specify the last-seen etag value to
332
+ # prevent accidentally deleting any concurrent changes.
333
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
+ # will be added to the HTTP request.
335
+ #
336
+ #
337
+ def delete(resource_group_name, zone_name, relative_record_set_name, record_type, if_match:nil, custom_headers:nil)
338
+ response = delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match:if_match, custom_headers:custom_headers).value!
339
+ nil
340
+ end
341
+
342
+ #
343
+ # Deletes a record set from a DNS zone. This operation cannot be undone.
344
+ #
345
+ # @param resource_group_name [String] The name of the resource group.
346
+ # @param zone_name [String] The name of the DNS zone (without a terminating
347
+ # dot).
348
+ # @param relative_record_set_name [String] The name of the record set, relative
349
+ # to the name of the zone.
350
+ # @param record_type [RecordType] The type of DNS record in this record set.
351
+ # Record sets of type SOA cannot be deleted (they are deleted when the DNS zone
352
+ # is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX',
353
+ # 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
354
+ # @param if_match [String] The etag of the record set. Omit this value to
355
+ # always delete the current record set. Specify the last-seen etag value to
356
+ # prevent accidentally deleting any concurrent changes.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
361
+ #
362
+ def delete_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, if_match:nil, custom_headers:nil)
363
+ delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match:if_match, custom_headers:custom_headers).value!
364
+ end
365
+
366
+ #
367
+ # Deletes a record set from a DNS zone. This operation cannot be undone.
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group.
370
+ # @param zone_name [String] The name of the DNS zone (without a terminating
371
+ # dot).
372
+ # @param relative_record_set_name [String] The name of the record set, relative
373
+ # to the name of the zone.
374
+ # @param record_type [RecordType] The type of DNS record in this record set.
375
+ # Record sets of type SOA cannot be deleted (they are deleted when the DNS zone
376
+ # is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX',
377
+ # 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
378
+ # @param if_match [String] The etag of the record set. Omit this value to
379
+ # always delete the current record set. Specify the last-seen etag value to
380
+ # prevent accidentally deleting any concurrent changes.
381
+ # @param [Hash{String => String}] A hash of custom headers that will be added
382
+ # to the HTTP request.
383
+ #
384
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
385
+ #
386
+ def delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match:nil, custom_headers:nil)
387
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
388
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
389
+ fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
390
+ fail ArgumentError, 'record_type is nil' if record_type.nil?
391
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
392
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
393
+
394
+
395
+ request_headers = {}
396
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
397
+
398
+ # Set Headers
399
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
400
+ request_headers['If-Match'] = if_match unless if_match.nil?
401
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'
403
+
404
+ request_url = @base_url || @client.base_url
405
+
406
+ options = {
407
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
408
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
409
+ skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
410
+ query_params: {'api-version' => @client.api_version},
411
+ headers: request_headers.merge(custom_headers || {}),
412
+ base_url: request_url
413
+ }
414
+ promise = @client.make_request_async(:delete, path_template, options)
415
+
416
+ promise = promise.then do |result|
417
+ http_response = result.response
418
+ status_code = http_response.status
419
+ response_content = http_response.body
420
+ unless status_code == 204 || status_code == 200
421
+ error_model = JSON.load(response_content)
422
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
423
+ end
424
+
425
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
426
+
427
+ result
428
+ end
429
+
430
+ promise.execute
431
+ end
432
+
433
+ #
434
+ # Gets a record set.
435
+ #
436
+ # @param resource_group_name [String] The name of the resource group.
437
+ # @param zone_name [String] The name of the DNS zone (without a terminating
438
+ # dot).
439
+ # @param relative_record_set_name [String] The name of the record set, relative
440
+ # to the name of the zone.
441
+ # @param record_type [RecordType] The type of DNS record in this record set.
442
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
443
+ # 'SOA', 'SRV', 'TXT'
444
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
445
+ # will be added to the HTTP request.
446
+ #
447
+ # @return [RecordSet] operation results.
448
+ #
449
+ def get(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers:nil)
450
+ response = get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers:custom_headers).value!
451
+ response.body unless response.nil?
452
+ end
453
+
454
+ #
455
+ # Gets a record set.
456
+ #
457
+ # @param resource_group_name [String] The name of the resource group.
458
+ # @param zone_name [String] The name of the DNS zone (without a terminating
459
+ # dot).
460
+ # @param relative_record_set_name [String] The name of the record set, relative
461
+ # to the name of the zone.
462
+ # @param record_type [RecordType] The type of DNS record in this record set.
463
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
464
+ # 'SOA', 'SRV', 'TXT'
465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
+ # will be added to the HTTP request.
467
+ #
468
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
469
+ #
470
+ def get_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers:nil)
471
+ get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers:custom_headers).value!
472
+ end
473
+
474
+ #
475
+ # Gets a record set.
476
+ #
477
+ # @param resource_group_name [String] The name of the resource group.
478
+ # @param zone_name [String] The name of the DNS zone (without a terminating
479
+ # dot).
480
+ # @param relative_record_set_name [String] The name of the record set, relative
481
+ # to the name of the zone.
482
+ # @param record_type [RecordType] The type of DNS record in this record set.
483
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
484
+ # 'SOA', 'SRV', 'TXT'
485
+ # @param [Hash{String => String}] A hash of custom headers that will be added
486
+ # to the HTTP request.
487
+ #
488
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
489
+ #
490
+ def get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers:nil)
491
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
492
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
493
+ fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
494
+ fail ArgumentError, 'record_type is nil' if record_type.nil?
495
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
496
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
497
+
498
+
499
+ request_headers = {}
500
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
501
+
502
+ # Set Headers
503
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
504
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
505
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'
506
+
507
+ request_url = @base_url || @client.base_url
508
+
509
+ options = {
510
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
511
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
512
+ skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
513
+ query_params: {'api-version' => @client.api_version},
514
+ headers: request_headers.merge(custom_headers || {}),
515
+ base_url: request_url
516
+ }
517
+ promise = @client.make_request_async(:get, path_template, options)
518
+
519
+ promise = promise.then do |result|
520
+ http_response = result.response
521
+ status_code = http_response.status
522
+ response_content = http_response.body
523
+ unless status_code == 200
524
+ error_model = JSON.load(response_content)
525
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
526
+ end
527
+
528
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
529
+ # Deserialize Response
530
+ if status_code == 200
531
+ begin
532
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
533
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSet.mapper()
534
+ result.body = @client.deserialize(result_mapper, parsed_response)
535
+ rescue Exception => e
536
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
537
+ end
538
+ end
539
+
540
+ result
541
+ end
542
+
543
+ promise.execute
544
+ end
545
+
546
+ #
547
+ # Lists the record sets of a specified type in a DNS zone.
548
+ #
549
+ # @param resource_group_name [String] The name of the resource group.
550
+ # @param zone_name [String] The name of the DNS zone (without a terminating
551
+ # dot).
552
+ # @param record_type [RecordType] The type of record sets to enumerate.
553
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
554
+ # 'SOA', 'SRV', 'TXT'
555
+ # @param top [Integer] The maximum number of record sets to return. If not
556
+ # specified, returns up to 100 record sets.
557
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
558
+ # that has to be used to filter the record set enumerations. If this parameter
559
+ # is specified, Enumeration will return only records that end with
560
+ # .<recordSetNameSuffix>
561
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
562
+ # will be added to the HTTP request.
563
+ #
564
+ # @return [Array<RecordSet>] operation results.
565
+ #
566
+ def list_by_type(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
567
+ first_page = list_by_type_as_lazy(resource_group_name, zone_name, record_type, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers)
568
+ first_page.get_all_items
569
+ end
570
+
571
+ #
572
+ # Lists the record sets of a specified type in a DNS zone.
573
+ #
574
+ # @param resource_group_name [String] The name of the resource group.
575
+ # @param zone_name [String] The name of the DNS zone (without a terminating
576
+ # dot).
577
+ # @param record_type [RecordType] The type of record sets to enumerate.
578
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
579
+ # 'SOA', 'SRV', 'TXT'
580
+ # @param top [Integer] The maximum number of record sets to return. If not
581
+ # specified, returns up to 100 record sets.
582
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
583
+ # that has to be used to filter the record set enumerations. If this parameter
584
+ # is specified, Enumeration will return only records that end with
585
+ # .<recordSetNameSuffix>
586
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
587
+ # will be added to the HTTP request.
588
+ #
589
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
590
+ #
591
+ def list_by_type_with_http_info(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
592
+ list_by_type_async(resource_group_name, zone_name, record_type, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers).value!
593
+ end
594
+
595
+ #
596
+ # Lists the record sets of a specified type in a DNS zone.
597
+ #
598
+ # @param resource_group_name [String] The name of the resource group.
599
+ # @param zone_name [String] The name of the DNS zone (without a terminating
600
+ # dot).
601
+ # @param record_type [RecordType] The type of record sets to enumerate.
602
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
603
+ # 'SOA', 'SRV', 'TXT'
604
+ # @param top [Integer] The maximum number of record sets to return. If not
605
+ # specified, returns up to 100 record sets.
606
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
607
+ # that has to be used to filter the record set enumerations. If this parameter
608
+ # is specified, Enumeration will return only records that end with
609
+ # .<recordSetNameSuffix>
610
+ # @param [Hash{String => String}] A hash of custom headers that will be added
611
+ # to the HTTP request.
612
+ #
613
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
614
+ #
615
+ def list_by_type_async(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
616
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
617
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
618
+ fail ArgumentError, 'record_type is nil' if record_type.nil?
619
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
620
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
621
+
622
+
623
+ request_headers = {}
624
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
625
+
626
+ # Set Headers
627
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
628
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
629
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}'
630
+
631
+ request_url = @base_url || @client.base_url
632
+
633
+ options = {
634
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
635
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
636
+ query_params: {'$top' => top,'$recordsetnamesuffix' => recordsetnamesuffix,'api-version' => @client.api_version},
637
+ headers: request_headers.merge(custom_headers || {}),
638
+ base_url: request_url
639
+ }
640
+ promise = @client.make_request_async(:get, path_template, options)
641
+
642
+ promise = promise.then do |result|
643
+ http_response = result.response
644
+ status_code = http_response.status
645
+ response_content = http_response.body
646
+ unless status_code == 200
647
+ error_model = JSON.load(response_content)
648
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
649
+ end
650
+
651
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
652
+ # Deserialize Response
653
+ if status_code == 200
654
+ begin
655
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
656
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
657
+ result.body = @client.deserialize(result_mapper, parsed_response)
658
+ rescue Exception => e
659
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
660
+ end
661
+ end
662
+
663
+ result
664
+ end
665
+
666
+ promise.execute
667
+ end
668
+
669
+ #
670
+ # Lists all record sets in a DNS zone.
671
+ #
672
+ # @param resource_group_name [String] The name of the resource group.
673
+ # @param zone_name [String] The name of the DNS zone (without a terminating
674
+ # dot).
675
+ # @param top [Integer] The maximum number of record sets to return. If not
676
+ # specified, returns up to 100 record sets.
677
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
678
+ # that has to be used to filter the record set enumerations. If this parameter
679
+ # is specified, Enumeration will return only records that end with
680
+ # .<recordSetNameSuffix>
681
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
682
+ # will be added to the HTTP request.
683
+ #
684
+ # @return [Array<RecordSet>] operation results.
685
+ #
686
+ def list_by_dns_zone(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
687
+ first_page = list_by_dns_zone_as_lazy(resource_group_name, zone_name, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers)
688
+ first_page.get_all_items
689
+ end
690
+
691
+ #
692
+ # Lists all record sets in a DNS zone.
693
+ #
694
+ # @param resource_group_name [String] The name of the resource group.
695
+ # @param zone_name [String] The name of the DNS zone (without a terminating
696
+ # dot).
697
+ # @param top [Integer] The maximum number of record sets to return. If not
698
+ # specified, returns up to 100 record sets.
699
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
700
+ # that has to be used to filter the record set enumerations. If this parameter
701
+ # is specified, Enumeration will return only records that end with
702
+ # .<recordSetNameSuffix>
703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
704
+ # will be added to the HTTP request.
705
+ #
706
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
707
+ #
708
+ def list_by_dns_zone_with_http_info(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
709
+ list_by_dns_zone_async(resource_group_name, zone_name, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers).value!
710
+ end
711
+
712
+ #
713
+ # Lists all record sets in a DNS zone.
714
+ #
715
+ # @param resource_group_name [String] The name of the resource group.
716
+ # @param zone_name [String] The name of the DNS zone (without a terminating
717
+ # dot).
718
+ # @param top [Integer] The maximum number of record sets to return. If not
719
+ # specified, returns up to 100 record sets.
720
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
721
+ # that has to be used to filter the record set enumerations. If this parameter
722
+ # is specified, Enumeration will return only records that end with
723
+ # .<recordSetNameSuffix>
724
+ # @param [Hash{String => String}] A hash of custom headers that will be added
725
+ # to the HTTP request.
726
+ #
727
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
728
+ #
729
+ def list_by_dns_zone_async(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
730
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
731
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
732
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
733
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
734
+
735
+
736
+ request_headers = {}
737
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
738
+
739
+ # Set Headers
740
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
741
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
742
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets'
743
+
744
+ request_url = @base_url || @client.base_url
745
+
746
+ options = {
747
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
748
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'subscriptionId' => @client.subscription_id},
749
+ query_params: {'$top' => top,'$recordsetnamesuffix' => recordsetnamesuffix,'api-version' => @client.api_version},
750
+ headers: request_headers.merge(custom_headers || {}),
751
+ base_url: request_url
752
+ }
753
+ promise = @client.make_request_async(:get, path_template, options)
754
+
755
+ promise = promise.then do |result|
756
+ http_response = result.response
757
+ status_code = http_response.status
758
+ response_content = http_response.body
759
+ unless status_code == 200
760
+ error_model = JSON.load(response_content)
761
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
762
+ end
763
+
764
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
765
+ # Deserialize Response
766
+ if status_code == 200
767
+ begin
768
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
769
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
770
+ result.body = @client.deserialize(result_mapper, parsed_response)
771
+ rescue Exception => e
772
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
773
+ end
774
+ end
775
+
776
+ result
777
+ end
778
+
779
+ promise.execute
780
+ end
781
+
782
+ #
783
+ # Lists all record sets in a DNS zone.
784
+ #
785
+ # @param resource_group_name [String] The name of the resource group.
786
+ # @param zone_name [String] The name of the DNS zone (without a terminating
787
+ # dot).
788
+ # @param top [Integer] The maximum number of record sets to return. If not
789
+ # specified, returns up to 100 record sets.
790
+ # @param record_set_name_suffix [String] The suffix label of the record set
791
+ # name that has to be used to filter the record set enumerations. If this
792
+ # parameter is specified, Enumeration will return only records that end with
793
+ # .<recordSetNameSuffix>
794
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
795
+ # will be added to the HTTP request.
796
+ #
797
+ # @return [Array<RecordSet>] operation results.
798
+ #
799
+ def list_all_by_dns_zone(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
800
+ first_page = list_all_by_dns_zone_as_lazy(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers)
801
+ first_page.get_all_items
802
+ end
803
+
804
+ #
805
+ # Lists all record sets in a DNS zone.
806
+ #
807
+ # @param resource_group_name [String] The name of the resource group.
808
+ # @param zone_name [String] The name of the DNS zone (without a terminating
809
+ # dot).
810
+ # @param top [Integer] The maximum number of record sets to return. If not
811
+ # specified, returns up to 100 record sets.
812
+ # @param record_set_name_suffix [String] The suffix label of the record set
813
+ # name that has to be used to filter the record set enumerations. If this
814
+ # parameter is specified, Enumeration will return only records that end with
815
+ # .<recordSetNameSuffix>
816
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
817
+ # will be added to the HTTP request.
818
+ #
819
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
820
+ #
821
+ def list_all_by_dns_zone_with_http_info(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
822
+ list_all_by_dns_zone_async(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers).value!
823
+ end
824
+
825
+ #
826
+ # Lists all record sets in a DNS zone.
827
+ #
828
+ # @param resource_group_name [String] The name of the resource group.
829
+ # @param zone_name [String] The name of the DNS zone (without a terminating
830
+ # dot).
831
+ # @param top [Integer] The maximum number of record sets to return. If not
832
+ # specified, returns up to 100 record sets.
833
+ # @param record_set_name_suffix [String] The suffix label of the record set
834
+ # name that has to be used to filter the record set enumerations. If this
835
+ # parameter is specified, Enumeration will return only records that end with
836
+ # .<recordSetNameSuffix>
837
+ # @param [Hash{String => String}] A hash of custom headers that will be added
838
+ # to the HTTP request.
839
+ #
840
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
841
+ #
842
+ def list_all_by_dns_zone_async(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
843
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
844
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
845
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
846
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
847
+
848
+
849
+ request_headers = {}
850
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
851
+
852
+ # Set Headers
853
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
854
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
855
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all'
856
+
857
+ request_url = @base_url || @client.base_url
858
+
859
+ options = {
860
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
861
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'subscriptionId' => @client.subscription_id},
862
+ query_params: {'$top' => top,'$recordsetnamesuffix' => record_set_name_suffix,'api-version' => @client.api_version},
863
+ headers: request_headers.merge(custom_headers || {}),
864
+ base_url: request_url
865
+ }
866
+ promise = @client.make_request_async(:get, path_template, options)
867
+
868
+ promise = promise.then do |result|
869
+ http_response = result.response
870
+ status_code = http_response.status
871
+ response_content = http_response.body
872
+ unless status_code == 200
873
+ error_model = JSON.load(response_content)
874
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
875
+ end
876
+
877
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
878
+ # Deserialize Response
879
+ if status_code == 200
880
+ begin
881
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
882
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
883
+ result.body = @client.deserialize(result_mapper, parsed_response)
884
+ rescue Exception => e
885
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
886
+ end
887
+ end
888
+
889
+ result
890
+ end
891
+
892
+ promise.execute
893
+ end
894
+
895
+ #
896
+ # Lists the record sets of a specified type in a DNS zone.
897
+ #
898
+ # @param next_page_link [String] The NextLink from the previous successful call
899
+ # to List operation.
900
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
901
+ # will be added to the HTTP request.
902
+ #
903
+ # @return [RecordSetListResult] operation results.
904
+ #
905
+ def list_by_type_next(next_page_link, custom_headers:nil)
906
+ response = list_by_type_next_async(next_page_link, custom_headers:custom_headers).value!
907
+ response.body unless response.nil?
908
+ end
909
+
910
+ #
911
+ # Lists the record sets of a specified type in a DNS zone.
912
+ #
913
+ # @param next_page_link [String] The NextLink from the previous successful call
914
+ # to List operation.
915
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
916
+ # will be added to the HTTP request.
917
+ #
918
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
919
+ #
920
+ def list_by_type_next_with_http_info(next_page_link, custom_headers:nil)
921
+ list_by_type_next_async(next_page_link, custom_headers:custom_headers).value!
922
+ end
923
+
924
+ #
925
+ # Lists the record sets of a specified type in a DNS zone.
926
+ #
927
+ # @param next_page_link [String] The NextLink from the previous successful call
928
+ # to List operation.
929
+ # @param [Hash{String => String}] A hash of custom headers that will be added
930
+ # to the HTTP request.
931
+ #
932
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
933
+ #
934
+ def list_by_type_next_async(next_page_link, custom_headers:nil)
935
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
936
+
937
+
938
+ request_headers = {}
939
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
940
+
941
+ # Set Headers
942
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
943
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
944
+ path_template = '{nextLink}'
945
+
946
+ request_url = @base_url || @client.base_url
947
+
948
+ options = {
949
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
950
+ skip_encoding_path_params: {'nextLink' => next_page_link},
951
+ headers: request_headers.merge(custom_headers || {}),
952
+ base_url: request_url
953
+ }
954
+ promise = @client.make_request_async(:get, path_template, options)
955
+
956
+ promise = promise.then do |result|
957
+ http_response = result.response
958
+ status_code = http_response.status
959
+ response_content = http_response.body
960
+ unless status_code == 200
961
+ error_model = JSON.load(response_content)
962
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
963
+ end
964
+
965
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
966
+ # Deserialize Response
967
+ if status_code == 200
968
+ begin
969
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
970
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
971
+ result.body = @client.deserialize(result_mapper, parsed_response)
972
+ rescue Exception => e
973
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
974
+ end
975
+ end
976
+
977
+ result
978
+ end
979
+
980
+ promise.execute
981
+ end
982
+
983
+ #
984
+ # Lists all record sets in a DNS zone.
985
+ #
986
+ # @param next_page_link [String] The NextLink from the previous successful call
987
+ # to List operation.
988
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
989
+ # will be added to the HTTP request.
990
+ #
991
+ # @return [RecordSetListResult] operation results.
992
+ #
993
+ def list_by_dns_zone_next(next_page_link, custom_headers:nil)
994
+ response = list_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
995
+ response.body unless response.nil?
996
+ end
997
+
998
+ #
999
+ # Lists all record sets in a DNS zone.
1000
+ #
1001
+ # @param next_page_link [String] The NextLink from the previous successful call
1002
+ # to List operation.
1003
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1004
+ # will be added to the HTTP request.
1005
+ #
1006
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1007
+ #
1008
+ def list_by_dns_zone_next_with_http_info(next_page_link, custom_headers:nil)
1009
+ list_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
1010
+ end
1011
+
1012
+ #
1013
+ # Lists all record sets in a DNS zone.
1014
+ #
1015
+ # @param next_page_link [String] The NextLink from the previous successful call
1016
+ # to List operation.
1017
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1018
+ # to the HTTP request.
1019
+ #
1020
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1021
+ #
1022
+ def list_by_dns_zone_next_async(next_page_link, custom_headers:nil)
1023
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1024
+
1025
+
1026
+ request_headers = {}
1027
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1028
+
1029
+ # Set Headers
1030
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1031
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1032
+ path_template = '{nextLink}'
1033
+
1034
+ request_url = @base_url || @client.base_url
1035
+
1036
+ options = {
1037
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1038
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1039
+ headers: request_headers.merge(custom_headers || {}),
1040
+ base_url: request_url
1041
+ }
1042
+ promise = @client.make_request_async(:get, path_template, options)
1043
+
1044
+ promise = promise.then do |result|
1045
+ http_response = result.response
1046
+ status_code = http_response.status
1047
+ response_content = http_response.body
1048
+ unless status_code == 200
1049
+ error_model = JSON.load(response_content)
1050
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1051
+ end
1052
+
1053
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1054
+ # Deserialize Response
1055
+ if status_code == 200
1056
+ begin
1057
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1058
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
1059
+ result.body = @client.deserialize(result_mapper, parsed_response)
1060
+ rescue Exception => e
1061
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1062
+ end
1063
+ end
1064
+
1065
+ result
1066
+ end
1067
+
1068
+ promise.execute
1069
+ end
1070
+
1071
+ #
1072
+ # Lists all record sets in a DNS zone.
1073
+ #
1074
+ # @param next_page_link [String] The NextLink from the previous successful call
1075
+ # to List operation.
1076
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1077
+ # will be added to the HTTP request.
1078
+ #
1079
+ # @return [RecordSetListResult] operation results.
1080
+ #
1081
+ def list_all_by_dns_zone_next(next_page_link, custom_headers:nil)
1082
+ response = list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
1083
+ response.body unless response.nil?
1084
+ end
1085
+
1086
+ #
1087
+ # Lists all record sets in a DNS zone.
1088
+ #
1089
+ # @param next_page_link [String] The NextLink from the previous successful call
1090
+ # to List operation.
1091
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1092
+ # will be added to the HTTP request.
1093
+ #
1094
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1095
+ #
1096
+ def list_all_by_dns_zone_next_with_http_info(next_page_link, custom_headers:nil)
1097
+ list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
1098
+ end
1099
+
1100
+ #
1101
+ # Lists all record sets in a DNS zone.
1102
+ #
1103
+ # @param next_page_link [String] The NextLink from the previous successful call
1104
+ # to List operation.
1105
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1106
+ # to the HTTP request.
1107
+ #
1108
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1109
+ #
1110
+ def list_all_by_dns_zone_next_async(next_page_link, custom_headers:nil)
1111
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1112
+
1113
+
1114
+ request_headers = {}
1115
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1116
+
1117
+ # Set Headers
1118
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1119
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1120
+ path_template = '{nextLink}'
1121
+
1122
+ request_url = @base_url || @client.base_url
1123
+
1124
+ options = {
1125
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1126
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1127
+ headers: request_headers.merge(custom_headers || {}),
1128
+ base_url: request_url
1129
+ }
1130
+ promise = @client.make_request_async(:get, path_template, options)
1131
+
1132
+ promise = promise.then do |result|
1133
+ http_response = result.response
1134
+ status_code = http_response.status
1135
+ response_content = http_response.body
1136
+ unless status_code == 200
1137
+ error_model = JSON.load(response_content)
1138
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1139
+ end
1140
+
1141
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1142
+ # Deserialize Response
1143
+ if status_code == 200
1144
+ begin
1145
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1146
+ result_mapper = Azure::Dns::Mgmt::V2018_03_01_preview::Models::RecordSetListResult.mapper()
1147
+ result.body = @client.deserialize(result_mapper, parsed_response)
1148
+ rescue Exception => e
1149
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1150
+ end
1151
+ end
1152
+
1153
+ result
1154
+ end
1155
+
1156
+ promise.execute
1157
+ end
1158
+
1159
+ #
1160
+ # Lists the record sets of a specified type in a DNS zone.
1161
+ #
1162
+ # @param resource_group_name [String] The name of the resource group.
1163
+ # @param zone_name [String] The name of the DNS zone (without a terminating
1164
+ # dot).
1165
+ # @param record_type [RecordType] The type of record sets to enumerate.
1166
+ # Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
1167
+ # 'SOA', 'SRV', 'TXT'
1168
+ # @param top [Integer] The maximum number of record sets to return. If not
1169
+ # specified, returns up to 100 record sets.
1170
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
1171
+ # that has to be used to filter the record set enumerations. If this parameter
1172
+ # is specified, Enumeration will return only records that end with
1173
+ # .<recordSetNameSuffix>
1174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1175
+ # will be added to the HTTP request.
1176
+ #
1177
+ # @return [RecordSetListResult] which provide lazy access to pages of the
1178
+ # response.
1179
+ #
1180
+ def list_by_type_as_lazy(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
1181
+ response = list_by_type_async(resource_group_name, zone_name, record_type, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers).value!
1182
+ unless response.nil?
1183
+ page = response.body
1184
+ page.next_method = Proc.new do |next_page_link|
1185
+ list_by_type_next_async(next_page_link, custom_headers:custom_headers)
1186
+ end
1187
+ page
1188
+ end
1189
+ end
1190
+
1191
+ #
1192
+ # Lists all record sets in a DNS zone.
1193
+ #
1194
+ # @param resource_group_name [String] The name of the resource group.
1195
+ # @param zone_name [String] The name of the DNS zone (without a terminating
1196
+ # dot).
1197
+ # @param top [Integer] The maximum number of record sets to return. If not
1198
+ # specified, returns up to 100 record sets.
1199
+ # @param recordsetnamesuffix [String] The suffix label of the record set name
1200
+ # that has to be used to filter the record set enumerations. If this parameter
1201
+ # is specified, Enumeration will return only records that end with
1202
+ # .<recordSetNameSuffix>
1203
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1204
+ # will be added to the HTTP request.
1205
+ #
1206
+ # @return [RecordSetListResult] which provide lazy access to pages of the
1207
+ # response.
1208
+ #
1209
+ def list_by_dns_zone_as_lazy(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
1210
+ response = list_by_dns_zone_async(resource_group_name, zone_name, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers:custom_headers).value!
1211
+ unless response.nil?
1212
+ page = response.body
1213
+ page.next_method = Proc.new do |next_page_link|
1214
+ list_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers)
1215
+ end
1216
+ page
1217
+ end
1218
+ end
1219
+
1220
+ #
1221
+ # Lists all record sets in a DNS zone.
1222
+ #
1223
+ # @param resource_group_name [String] The name of the resource group.
1224
+ # @param zone_name [String] The name of the DNS zone (without a terminating
1225
+ # dot).
1226
+ # @param top [Integer] The maximum number of record sets to return. If not
1227
+ # specified, returns up to 100 record sets.
1228
+ # @param record_set_name_suffix [String] The suffix label of the record set
1229
+ # name that has to be used to filter the record set enumerations. If this
1230
+ # parameter is specified, Enumeration will return only records that end with
1231
+ # .<recordSetNameSuffix>
1232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1233
+ # will be added to the HTTP request.
1234
+ #
1235
+ # @return [RecordSetListResult] which provide lazy access to pages of the
1236
+ # response.
1237
+ #
1238
+ def list_all_by_dns_zone_as_lazy(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
1239
+ response = list_all_by_dns_zone_async(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers).value!
1240
+ unless response.nil?
1241
+ page = response.body
1242
+ page.next_method = Proc.new do |next_page_link|
1243
+ list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers)
1244
+ end
1245
+ page
1246
+ end
1247
+ end
1248
+
1249
+ end
1250
+ end