dns_client.go raw
1 // Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
2 // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
3 // Code generated. DO NOT EDIT.
4
5 // DNS API
6 //
7 // API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
8 // For more information, see Overview of the DNS Service (https://docs.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
9 //
10
11 package dns
12
13 import (
14 "context"
15 "fmt"
16 "net/http"
17
18 "github.com/nrdcg/oci-go-sdk/common/v1065"
19 "github.com/nrdcg/oci-go-sdk/common/v1065/auth"
20 )
21
22 // DnsClient a client for Dns
23 type DnsClient struct {
24 common.BaseClient
25 config *common.ConfigurationProvider
26 }
27
28 // NewDnsClientWithConfigurationProvider Creates a new default Dns client with the given configuration provider.
29 // the configuration provider will be used for the default signer as well as reading the region
30 func NewDnsClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client DnsClient, err error) {
31 if enabled := common.CheckForEnabledServices("dns"); !enabled {
32 return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service")
33 }
34 provider, err := auth.GetGenericConfigurationProvider(configProvider)
35 if err != nil {
36 return client, err
37 }
38 baseClient, e := common.NewClientWithConfig(provider)
39 if e != nil {
40 return client, e
41 }
42 return newDnsClientFromBaseClient(baseClient, provider)
43 }
44
45 // NewDnsClientWithOboToken Creates a new default Dns client with the given configuration provider.
46 // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer
47 //
48 // as well as reading the region
49 func NewDnsClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client DnsClient, err error) {
50 baseClient, err := common.NewClientWithOboToken(configProvider, oboToken)
51 if err != nil {
52 return client, err
53 }
54
55 return newDnsClientFromBaseClient(baseClient, configProvider)
56 }
57
58 func newDnsClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client DnsClient, err error) {
59 // Dns service default circuit breaker is enabled
60 baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Dns"))
61 common.ConfigCircuitBreakerFromEnvVar(&baseClient)
62 common.ConfigCircuitBreakerFromGlobalVar(&baseClient)
63
64 client = DnsClient{BaseClient: baseClient}
65 client.BasePath = "20180115"
66 err = client.setConfigurationProvider(configProvider)
67 return
68 }
69
70 // SetRegion overrides the region of this client.
71 func (client *DnsClient) SetRegion(region string) {
72 client.Host = common.StringToRegion(region).EndpointForTemplate("dns", "https://dns.{region}.oci.{secondLevelDomain}")
73 }
74
75 // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid
76 func (client *DnsClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error {
77 if ok, err := common.IsConfigurationProviderValid(configProvider); !ok {
78 return err
79 }
80
81 // Error has been checked already
82 region, _ := configProvider.Region()
83 client.SetRegion(region)
84 if client.Host == "" {
85 return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region")
86 }
87 client.config = &configProvider
88 return nil
89 }
90
91 // ConfigurationProvider the ConfigurationProvider used in this client, or null if none set
92 func (client *DnsClient) ConfigurationProvider() *common.ConfigurationProvider {
93 return client.config
94 }
95
96 // ChangeResolverCompartment Moves a resolver into a different compartment along with its protected default view and any endpoints.
97 // Zones in the default view are not moved. VCN-dedicated resolvers are initially created in the same compartment
98 // as their corresponding VCN, but can then be moved to a different compartment.
99 //
100 // # See also
101 //
102 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ChangeResolverCompartment.go.html to see an example of how to use ChangeResolverCompartment API.
103 // A default retry strategy applies to this operation ChangeResolverCompartment()
104 func (client DnsClient) ChangeResolverCompartment(ctx context.Context, request ChangeResolverCompartmentRequest) (response ChangeResolverCompartmentResponse, err error) {
105 var ociResponse common.OCIResponse
106 policy := common.DefaultRetryPolicy()
107 if client.RetryPolicy() != nil {
108 policy = *client.RetryPolicy()
109 }
110 if request.RetryPolicy() != nil {
111 policy = *request.RetryPolicy()
112 }
113
114 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
115 request.OpcRetryToken = common.String(common.RetryToken())
116 }
117
118 ociResponse, err = common.Retry(ctx, request, client.changeResolverCompartment, policy)
119 if err != nil {
120 if ociResponse != nil {
121 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
122 opcRequestId := httpResponse.Header.Get("opc-request-id")
123 response = ChangeResolverCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
124 } else {
125 response = ChangeResolverCompartmentResponse{}
126 }
127 }
128 return
129 }
130 if convertedResponse, ok := ociResponse.(ChangeResolverCompartmentResponse); ok {
131 response = convertedResponse
132 } else {
133 err = fmt.Errorf("failed to convert OCIResponse into ChangeResolverCompartmentResponse")
134 }
135 return
136 }
137
138 // changeResolverCompartment implements the OCIOperation interface (enables retrying operations)
139 func (client DnsClient) changeResolverCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
140
141 httpRequest, err := request.HTTPRequest(http.MethodPost, "/resolvers/{resolverId}/actions/changeCompartment", binaryReqBody, extraHeaders)
142 if err != nil {
143 return nil, err
144 }
145
146 var response ChangeResolverCompartmentResponse
147 var httpResponse *http.Response
148 httpResponse, err = client.Call(ctx, &httpRequest)
149 defer common.CloseBodyIfValid(httpResponse)
150 response.RawResponse = httpResponse
151 if err != nil {
152 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Resolver/ChangeResolverCompartment"
153 err = common.PostProcessServiceError(err, "Dns", "ChangeResolverCompartment", apiReferenceLink)
154 return response, err
155 }
156
157 err = common.UnmarshalResponse(httpResponse, &response)
158 return response, err
159 }
160
161 // ChangeSteeringPolicyCompartment Moves a steering policy into a different compartment.
162 //
163 // # See also
164 //
165 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ChangeSteeringPolicyCompartment.go.html to see an example of how to use ChangeSteeringPolicyCompartment API.
166 // A default retry strategy applies to this operation ChangeSteeringPolicyCompartment()
167 func (client DnsClient) ChangeSteeringPolicyCompartment(ctx context.Context, request ChangeSteeringPolicyCompartmentRequest) (response ChangeSteeringPolicyCompartmentResponse, err error) {
168 var ociResponse common.OCIResponse
169 policy := common.DefaultRetryPolicy()
170 if client.RetryPolicy() != nil {
171 policy = *client.RetryPolicy()
172 }
173 if request.RetryPolicy() != nil {
174 policy = *request.RetryPolicy()
175 }
176
177 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
178 request.OpcRetryToken = common.String(common.RetryToken())
179 }
180
181 ociResponse, err = common.Retry(ctx, request, client.changeSteeringPolicyCompartment, policy)
182 if err != nil {
183 if ociResponse != nil {
184 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
185 opcRequestId := httpResponse.Header.Get("opc-request-id")
186 response = ChangeSteeringPolicyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
187 } else {
188 response = ChangeSteeringPolicyCompartmentResponse{}
189 }
190 }
191 return
192 }
193 if convertedResponse, ok := ociResponse.(ChangeSteeringPolicyCompartmentResponse); ok {
194 response = convertedResponse
195 } else {
196 err = fmt.Errorf("failed to convert OCIResponse into ChangeSteeringPolicyCompartmentResponse")
197 }
198 return
199 }
200
201 // changeSteeringPolicyCompartment implements the OCIOperation interface (enables retrying operations)
202 func (client DnsClient) changeSteeringPolicyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
203
204 httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicies/{steeringPolicyId}/actions/changeCompartment", binaryReqBody, extraHeaders)
205 if err != nil {
206 return nil, err
207 }
208
209 var response ChangeSteeringPolicyCompartmentResponse
210 var httpResponse *http.Response
211 httpResponse, err = client.Call(ctx, &httpRequest)
212 defer common.CloseBodyIfValid(httpResponse)
213 response.RawResponse = httpResponse
214 if err != nil {
215 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicy/ChangeSteeringPolicyCompartment"
216 err = common.PostProcessServiceError(err, "Dns", "ChangeSteeringPolicyCompartment", apiReferenceLink)
217 return response, err
218 }
219
220 err = common.UnmarshalResponse(httpResponse, &response)
221 return response, err
222 }
223
224 // ChangeTsigKeyCompartment Moves a TSIG key into a different compartment.
225 //
226 // # See also
227 //
228 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ChangeTsigKeyCompartment.go.html to see an example of how to use ChangeTsigKeyCompartment API.
229 // A default retry strategy applies to this operation ChangeTsigKeyCompartment()
230 func (client DnsClient) ChangeTsigKeyCompartment(ctx context.Context, request ChangeTsigKeyCompartmentRequest) (response ChangeTsigKeyCompartmentResponse, err error) {
231 var ociResponse common.OCIResponse
232 policy := common.DefaultRetryPolicy()
233 if client.RetryPolicy() != nil {
234 policy = *client.RetryPolicy()
235 }
236 if request.RetryPolicy() != nil {
237 policy = *request.RetryPolicy()
238 }
239
240 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
241 request.OpcRetryToken = common.String(common.RetryToken())
242 }
243
244 ociResponse, err = common.Retry(ctx, request, client.changeTsigKeyCompartment, policy)
245 if err != nil {
246 if ociResponse != nil {
247 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
248 opcRequestId := httpResponse.Header.Get("opc-request-id")
249 response = ChangeTsigKeyCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
250 } else {
251 response = ChangeTsigKeyCompartmentResponse{}
252 }
253 }
254 return
255 }
256 if convertedResponse, ok := ociResponse.(ChangeTsigKeyCompartmentResponse); ok {
257 response = convertedResponse
258 } else {
259 err = fmt.Errorf("failed to convert OCIResponse into ChangeTsigKeyCompartmentResponse")
260 }
261 return
262 }
263
264 // changeTsigKeyCompartment implements the OCIOperation interface (enables retrying operations)
265 func (client DnsClient) changeTsigKeyCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
266
267 httpRequest, err := request.HTTPRequest(http.MethodPost, "/tsigKeys/{tsigKeyId}/actions/changeCompartment", binaryReqBody, extraHeaders)
268 if err != nil {
269 return nil, err
270 }
271
272 var response ChangeTsigKeyCompartmentResponse
273 var httpResponse *http.Response
274 httpResponse, err = client.Call(ctx, &httpRequest)
275 defer common.CloseBodyIfValid(httpResponse)
276 response.RawResponse = httpResponse
277 if err != nil {
278 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/TsigKey/ChangeTsigKeyCompartment"
279 err = common.PostProcessServiceError(err, "Dns", "ChangeTsigKeyCompartment", apiReferenceLink)
280 return response, err
281 }
282
283 err = common.UnmarshalResponse(httpResponse, &response)
284 return response, err
285 }
286
287 // ChangeViewCompartment Moves a view into a different compartment.
288 // To change the compartment of a protected view, change the compartment of its corresponding resolver.
289 //
290 // # See also
291 //
292 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ChangeViewCompartment.go.html to see an example of how to use ChangeViewCompartment API.
293 // A default retry strategy applies to this operation ChangeViewCompartment()
294 func (client DnsClient) ChangeViewCompartment(ctx context.Context, request ChangeViewCompartmentRequest) (response ChangeViewCompartmentResponse, err error) {
295 var ociResponse common.OCIResponse
296 policy := common.DefaultRetryPolicy()
297 if client.RetryPolicy() != nil {
298 policy = *client.RetryPolicy()
299 }
300 if request.RetryPolicy() != nil {
301 policy = *request.RetryPolicy()
302 }
303
304 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
305 request.OpcRetryToken = common.String(common.RetryToken())
306 }
307
308 ociResponse, err = common.Retry(ctx, request, client.changeViewCompartment, policy)
309 if err != nil {
310 if ociResponse != nil {
311 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
312 opcRequestId := httpResponse.Header.Get("opc-request-id")
313 response = ChangeViewCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
314 } else {
315 response = ChangeViewCompartmentResponse{}
316 }
317 }
318 return
319 }
320 if convertedResponse, ok := ociResponse.(ChangeViewCompartmentResponse); ok {
321 response = convertedResponse
322 } else {
323 err = fmt.Errorf("failed to convert OCIResponse into ChangeViewCompartmentResponse")
324 }
325 return
326 }
327
328 // changeViewCompartment implements the OCIOperation interface (enables retrying operations)
329 func (client DnsClient) changeViewCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
330
331 httpRequest, err := request.HTTPRequest(http.MethodPost, "/views/{viewId}/actions/changeCompartment", binaryReqBody, extraHeaders)
332 if err != nil {
333 return nil, err
334 }
335
336 var response ChangeViewCompartmentResponse
337 var httpResponse *http.Response
338 httpResponse, err = client.Call(ctx, &httpRequest)
339 defer common.CloseBodyIfValid(httpResponse)
340 response.RawResponse = httpResponse
341 if err != nil {
342 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/View/ChangeViewCompartment"
343 err = common.PostProcessServiceError(err, "Dns", "ChangeViewCompartment", apiReferenceLink)
344 return response, err
345 }
346
347 err = common.UnmarshalResponse(httpResponse, &response)
348 return response, err
349 }
350
351 // ChangeZoneCompartment Moves a zone into a different compartment.
352 // Protected zones cannot have their compartment changed. When the zone name is provided as a path
353 // parameter and `PRIVATE` is used for the scope query parameter then the viewId query parameter is
354 // required.
355 // **Note:** All SteeringPolicyAttachment objects associated with this zone will also be moved into
356 // the provided compartment.
357 //
358 // # See also
359 //
360 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ChangeZoneCompartment.go.html to see an example of how to use ChangeZoneCompartment API.
361 // A default retry strategy applies to this operation ChangeZoneCompartment()
362 func (client DnsClient) ChangeZoneCompartment(ctx context.Context, request ChangeZoneCompartmentRequest) (response ChangeZoneCompartmentResponse, err error) {
363 var ociResponse common.OCIResponse
364 policy := common.DefaultRetryPolicy()
365 if client.RetryPolicy() != nil {
366 policy = *client.RetryPolicy()
367 }
368 if request.RetryPolicy() != nil {
369 policy = *request.RetryPolicy()
370 }
371
372 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
373 request.OpcRetryToken = common.String(common.RetryToken())
374 }
375
376 ociResponse, err = common.Retry(ctx, request, client.changeZoneCompartment, policy)
377 if err != nil {
378 if ociResponse != nil {
379 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
380 opcRequestId := httpResponse.Header.Get("opc-request-id")
381 response = ChangeZoneCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
382 } else {
383 response = ChangeZoneCompartmentResponse{}
384 }
385 }
386 return
387 }
388 if convertedResponse, ok := ociResponse.(ChangeZoneCompartmentResponse); ok {
389 response = convertedResponse
390 } else {
391 err = fmt.Errorf("failed to convert OCIResponse into ChangeZoneCompartmentResponse")
392 }
393 return
394 }
395
396 // changeZoneCompartment implements the OCIOperation interface (enables retrying operations)
397 func (client DnsClient) changeZoneCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
398
399 httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones/{zoneId}/actions/changeCompartment", binaryReqBody, extraHeaders)
400 if err != nil {
401 return nil, err
402 }
403
404 var response ChangeZoneCompartmentResponse
405 var httpResponse *http.Response
406 httpResponse, err = client.Call(ctx, &httpRequest)
407 defer common.CloseBodyIfValid(httpResponse)
408 response.RawResponse = httpResponse
409 if err != nil {
410 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/ChangeZoneCompartment"
411 err = common.PostProcessServiceError(err, "Dns", "ChangeZoneCompartment", apiReferenceLink)
412 return response, err
413 }
414
415 err = common.UnmarshalResponse(httpResponse, &response)
416 return response, err
417 }
418
419 // CreateResolverEndpoint Creates a new resolver endpoint in the same compartment as the resolver.
420 //
421 // # See also
422 //
423 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateResolverEndpoint.go.html to see an example of how to use CreateResolverEndpoint API.
424 // A default retry strategy applies to this operation CreateResolverEndpoint()
425 func (client DnsClient) CreateResolverEndpoint(ctx context.Context, request CreateResolverEndpointRequest) (response CreateResolverEndpointResponse, err error) {
426 var ociResponse common.OCIResponse
427 policy := common.DefaultRetryPolicy()
428 if client.RetryPolicy() != nil {
429 policy = *client.RetryPolicy()
430 }
431 if request.RetryPolicy() != nil {
432 policy = *request.RetryPolicy()
433 }
434
435 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
436 request.OpcRetryToken = common.String(common.RetryToken())
437 }
438
439 ociResponse, err = common.Retry(ctx, request, client.createResolverEndpoint, policy)
440 if err != nil {
441 if ociResponse != nil {
442 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
443 opcRequestId := httpResponse.Header.Get("opc-request-id")
444 response = CreateResolverEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
445 } else {
446 response = CreateResolverEndpointResponse{}
447 }
448 }
449 return
450 }
451 if convertedResponse, ok := ociResponse.(CreateResolverEndpointResponse); ok {
452 response = convertedResponse
453 } else {
454 err = fmt.Errorf("failed to convert OCIResponse into CreateResolverEndpointResponse")
455 }
456 return
457 }
458
459 // createResolverEndpoint implements the OCIOperation interface (enables retrying operations)
460 func (client DnsClient) createResolverEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
461
462 httpRequest, err := request.HTTPRequest(http.MethodPost, "/resolvers/{resolverId}/endpoints", binaryReqBody, extraHeaders)
463 if err != nil {
464 return nil, err
465 }
466
467 var response CreateResolverEndpointResponse
468 var httpResponse *http.Response
469 httpResponse, err = client.Call(ctx, &httpRequest)
470 defer common.CloseBodyIfValid(httpResponse)
471 response.RawResponse = httpResponse
472 if err != nil {
473 apiReferenceLink := ""
474 err = common.PostProcessServiceError(err, "Dns", "CreateResolverEndpoint", apiReferenceLink)
475 return response, err
476 }
477
478 err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &resolverendpoint{})
479 return response, err
480 }
481
482 // CreateSteeringPolicy Creates a new steering policy in the specified compartment. For more information on
483 // creating policies with templates, see Traffic Management API Guide (https://docs.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
484 //
485 // # See also
486 //
487 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateSteeringPolicy.go.html to see an example of how to use CreateSteeringPolicy API.
488 // A default retry strategy applies to this operation CreateSteeringPolicy()
489 func (client DnsClient) CreateSteeringPolicy(ctx context.Context, request CreateSteeringPolicyRequest) (response CreateSteeringPolicyResponse, err error) {
490 var ociResponse common.OCIResponse
491 policy := common.DefaultRetryPolicy()
492 if client.RetryPolicy() != nil {
493 policy = *client.RetryPolicy()
494 }
495 if request.RetryPolicy() != nil {
496 policy = *request.RetryPolicy()
497 }
498
499 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
500 request.OpcRetryToken = common.String(common.RetryToken())
501 }
502
503 ociResponse, err = common.Retry(ctx, request, client.createSteeringPolicy, policy)
504 if err != nil {
505 if ociResponse != nil {
506 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
507 opcRequestId := httpResponse.Header.Get("opc-request-id")
508 response = CreateSteeringPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
509 } else {
510 response = CreateSteeringPolicyResponse{}
511 }
512 }
513 return
514 }
515 if convertedResponse, ok := ociResponse.(CreateSteeringPolicyResponse); ok {
516 response = convertedResponse
517 } else {
518 err = fmt.Errorf("failed to convert OCIResponse into CreateSteeringPolicyResponse")
519 }
520 return
521 }
522
523 // createSteeringPolicy implements the OCIOperation interface (enables retrying operations)
524 func (client DnsClient) createSteeringPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
525
526 httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicies", binaryReqBody, extraHeaders)
527 if err != nil {
528 return nil, err
529 }
530
531 var response CreateSteeringPolicyResponse
532 var httpResponse *http.Response
533 httpResponse, err = client.Call(ctx, &httpRequest)
534 defer common.CloseBodyIfValid(httpResponse)
535 response.RawResponse = httpResponse
536 if err != nil {
537 apiReferenceLink := ""
538 err = common.PostProcessServiceError(err, "Dns", "CreateSteeringPolicy", apiReferenceLink)
539 return response, err
540 }
541
542 err = common.UnmarshalResponse(httpResponse, &response)
543 return response, err
544 }
545
546 // CreateSteeringPolicyAttachment Creates a new attachment between a steering policy and a domain, giving the
547 // policy permission to answer queries for the specified domain. A steering policy must
548 // be attached to a domain for the policy to answer DNS queries for that domain.
549 // For the purposes of access control, the attachment is automatically placed
550 // into the same compartment as the domain's zone.
551 //
552 // # See also
553 //
554 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateSteeringPolicyAttachment.go.html to see an example of how to use CreateSteeringPolicyAttachment API.
555 // A default retry strategy applies to this operation CreateSteeringPolicyAttachment()
556 func (client DnsClient) CreateSteeringPolicyAttachment(ctx context.Context, request CreateSteeringPolicyAttachmentRequest) (response CreateSteeringPolicyAttachmentResponse, err error) {
557 var ociResponse common.OCIResponse
558 policy := common.DefaultRetryPolicy()
559 if client.RetryPolicy() != nil {
560 policy = *client.RetryPolicy()
561 }
562 if request.RetryPolicy() != nil {
563 policy = *request.RetryPolicy()
564 }
565
566 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
567 request.OpcRetryToken = common.String(common.RetryToken())
568 }
569
570 ociResponse, err = common.Retry(ctx, request, client.createSteeringPolicyAttachment, policy)
571 if err != nil {
572 if ociResponse != nil {
573 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
574 opcRequestId := httpResponse.Header.Get("opc-request-id")
575 response = CreateSteeringPolicyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
576 } else {
577 response = CreateSteeringPolicyAttachmentResponse{}
578 }
579 }
580 return
581 }
582 if convertedResponse, ok := ociResponse.(CreateSteeringPolicyAttachmentResponse); ok {
583 response = convertedResponse
584 } else {
585 err = fmt.Errorf("failed to convert OCIResponse into CreateSteeringPolicyAttachmentResponse")
586 }
587 return
588 }
589
590 // createSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations)
591 func (client DnsClient) createSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
592
593 httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicyAttachments", binaryReqBody, extraHeaders)
594 if err != nil {
595 return nil, err
596 }
597
598 var response CreateSteeringPolicyAttachmentResponse
599 var httpResponse *http.Response
600 httpResponse, err = client.Call(ctx, &httpRequest)
601 defer common.CloseBodyIfValid(httpResponse)
602 response.RawResponse = httpResponse
603 if err != nil {
604 apiReferenceLink := ""
605 err = common.PostProcessServiceError(err, "Dns", "CreateSteeringPolicyAttachment", apiReferenceLink)
606 return response, err
607 }
608
609 err = common.UnmarshalResponse(httpResponse, &response)
610 return response, err
611 }
612
613 // CreateTsigKey Creates a new TSIG key in the specified compartment. There is no
614 // `opc-retry-token` header since TSIG key names must be globally unique.
615 //
616 // # See also
617 //
618 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateTsigKey.go.html to see an example of how to use CreateTsigKey API.
619 // A default retry strategy applies to this operation CreateTsigKey()
620 func (client DnsClient) CreateTsigKey(ctx context.Context, request CreateTsigKeyRequest) (response CreateTsigKeyResponse, err error) {
621 var ociResponse common.OCIResponse
622 policy := common.DefaultRetryPolicy()
623 if client.RetryPolicy() != nil {
624 policy = *client.RetryPolicy()
625 }
626 if request.RetryPolicy() != nil {
627 policy = *request.RetryPolicy()
628 }
629 ociResponse, err = common.Retry(ctx, request, client.createTsigKey, policy)
630 if err != nil {
631 if ociResponse != nil {
632 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
633 opcRequestId := httpResponse.Header.Get("opc-request-id")
634 response = CreateTsigKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
635 } else {
636 response = CreateTsigKeyResponse{}
637 }
638 }
639 return
640 }
641 if convertedResponse, ok := ociResponse.(CreateTsigKeyResponse); ok {
642 response = convertedResponse
643 } else {
644 err = fmt.Errorf("failed to convert OCIResponse into CreateTsigKeyResponse")
645 }
646 return
647 }
648
649 // createTsigKey implements the OCIOperation interface (enables retrying operations)
650 func (client DnsClient) createTsigKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
651
652 httpRequest, err := request.HTTPRequest(http.MethodPost, "/tsigKeys", binaryReqBody, extraHeaders)
653 if err != nil {
654 return nil, err
655 }
656
657 var response CreateTsigKeyResponse
658 var httpResponse *http.Response
659 httpResponse, err = client.Call(ctx, &httpRequest)
660 defer common.CloseBodyIfValid(httpResponse)
661 response.RawResponse = httpResponse
662 if err != nil {
663 apiReferenceLink := ""
664 err = common.PostProcessServiceError(err, "Dns", "CreateTsigKey", apiReferenceLink)
665 return response, err
666 }
667
668 err = common.UnmarshalResponse(httpResponse, &response)
669 return response, err
670 }
671
672 // CreateView Creates a new view in the specified compartment.
673 //
674 // # See also
675 //
676 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateView.go.html to see an example of how to use CreateView API.
677 // A default retry strategy applies to this operation CreateView()
678 func (client DnsClient) CreateView(ctx context.Context, request CreateViewRequest) (response CreateViewResponse, err error) {
679 var ociResponse common.OCIResponse
680 policy := common.DefaultRetryPolicy()
681 if client.RetryPolicy() != nil {
682 policy = *client.RetryPolicy()
683 }
684 if request.RetryPolicy() != nil {
685 policy = *request.RetryPolicy()
686 }
687
688 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
689 request.OpcRetryToken = common.String(common.RetryToken())
690 }
691
692 ociResponse, err = common.Retry(ctx, request, client.createView, policy)
693 if err != nil {
694 if ociResponse != nil {
695 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
696 opcRequestId := httpResponse.Header.Get("opc-request-id")
697 response = CreateViewResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
698 } else {
699 response = CreateViewResponse{}
700 }
701 }
702 return
703 }
704 if convertedResponse, ok := ociResponse.(CreateViewResponse); ok {
705 response = convertedResponse
706 } else {
707 err = fmt.Errorf("failed to convert OCIResponse into CreateViewResponse")
708 }
709 return
710 }
711
712 // createView implements the OCIOperation interface (enables retrying operations)
713 func (client DnsClient) createView(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
714
715 httpRequest, err := request.HTTPRequest(http.MethodPost, "/views", binaryReqBody, extraHeaders)
716 if err != nil {
717 return nil, err
718 }
719
720 var response CreateViewResponse
721 var httpResponse *http.Response
722 httpResponse, err = client.Call(ctx, &httpRequest)
723 defer common.CloseBodyIfValid(httpResponse)
724 response.RawResponse = httpResponse
725 if err != nil {
726 apiReferenceLink := ""
727 err = common.PostProcessServiceError(err, "Dns", "CreateView", apiReferenceLink)
728 return response, err
729 }
730
731 err = common.UnmarshalResponse(httpResponse, &response)
732 return response, err
733 }
734
735 // CreateZone Creates a new zone in the specified compartment.
736 // Private zones must have a zone type of `PRIMARY`. Creating a private zone at or under `oraclevcn.com`
737 // within the default protected view of a VCN-dedicated resolver is not permitted.
738 //
739 // # See also
740 //
741 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateZone.go.html to see an example of how to use CreateZone API.
742 func (client DnsClient) CreateZone(ctx context.Context, request CreateZoneRequest) (response CreateZoneResponse, err error) {
743 var ociResponse common.OCIResponse
744 policy := common.NoRetryPolicy()
745 if client.RetryPolicy() != nil {
746 policy = *client.RetryPolicy()
747 }
748 if request.RetryPolicy() != nil {
749 policy = *request.RetryPolicy()
750 }
751 ociResponse, err = common.Retry(ctx, request, client.createZone, policy)
752 if err != nil {
753 if ociResponse != nil {
754 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
755 opcRequestId := httpResponse.Header.Get("opc-request-id")
756 response = CreateZoneResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
757 } else {
758 response = CreateZoneResponse{}
759 }
760 }
761 return
762 }
763 if convertedResponse, ok := ociResponse.(CreateZoneResponse); ok {
764 response = convertedResponse
765 } else {
766 err = fmt.Errorf("failed to convert OCIResponse into CreateZoneResponse")
767 }
768 return
769 }
770
771 // createZone implements the OCIOperation interface (enables retrying operations)
772 func (client DnsClient) createZone(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
773
774 httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones", binaryReqBody, extraHeaders)
775 if err != nil {
776 return nil, err
777 }
778
779 var response CreateZoneResponse
780 var httpResponse *http.Response
781 httpResponse, err = client.Call(ctx, &httpRequest)
782 defer common.CloseBodyIfValid(httpResponse)
783 response.RawResponse = httpResponse
784 if err != nil {
785 apiReferenceLink := ""
786 err = common.PostProcessServiceError(err, "Dns", "CreateZone", apiReferenceLink)
787 return response, err
788 }
789
790 err = common.UnmarshalResponse(httpResponse, &response)
791 return response, err
792 }
793
794 // CreateZoneFromZoneFile Creates a new zone from a zone file in the specified compartment. Not supported for private zones.
795 //
796 // # See also
797 //
798 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateZoneFromZoneFile.go.html to see an example of how to use CreateZoneFromZoneFile API.
799 func (client DnsClient) CreateZoneFromZoneFile(ctx context.Context, request CreateZoneFromZoneFileRequest) (response CreateZoneFromZoneFileResponse, err error) {
800 var ociResponse common.OCIResponse
801 policy := common.NoRetryPolicy()
802 if client.RetryPolicy() != nil {
803 policy = *client.RetryPolicy()
804 }
805 if request.RetryPolicy() != nil {
806 policy = *request.RetryPolicy()
807 }
808 ociResponse, err = common.Retry(ctx, request, client.createZoneFromZoneFile, policy)
809 if err != nil {
810 if ociResponse != nil {
811 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
812 opcRequestId := httpResponse.Header.Get("opc-request-id")
813 response = CreateZoneFromZoneFileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
814 } else {
815 response = CreateZoneFromZoneFileResponse{}
816 }
817 }
818 return
819 }
820 if convertedResponse, ok := ociResponse.(CreateZoneFromZoneFileResponse); ok {
821 response = convertedResponse
822 } else {
823 err = fmt.Errorf("failed to convert OCIResponse into CreateZoneFromZoneFileResponse")
824 }
825 return
826 }
827
828 // createZoneFromZoneFile implements the OCIOperation interface (enables retrying operations)
829 func (client DnsClient) createZoneFromZoneFile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
830
831 httpRequest, err := request.HTTPRequest(http.MethodPost, "/actions/createZoneFromZoneFile", binaryReqBody, extraHeaders)
832 if err != nil {
833 return nil, err
834 }
835
836 var response CreateZoneFromZoneFileResponse
837 var httpResponse *http.Response
838 httpResponse, err = client.Call(ctx, &httpRequest)
839 defer common.CloseBodyIfValid(httpResponse)
840 response.RawResponse = httpResponse
841 if err != nil {
842 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/CreateZoneFromZoneFile"
843 err = common.PostProcessServiceError(err, "Dns", "CreateZoneFromZoneFile", apiReferenceLink)
844 return response, err
845 }
846
847 err = common.UnmarshalResponse(httpResponse, &response)
848 return response, err
849 }
850
851 // DeleteDomainRecords Deletes all records at the specified zone and domain.
852 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query parameter
853 // then the viewId query parameter is required.
854 //
855 // # See also
856 //
857 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteDomainRecords.go.html to see an example of how to use DeleteDomainRecords API.
858 // A default retry strategy applies to this operation DeleteDomainRecords()
859 func (client DnsClient) DeleteDomainRecords(ctx context.Context, request DeleteDomainRecordsRequest) (response DeleteDomainRecordsResponse, err error) {
860 var ociResponse common.OCIResponse
861 policy := common.DefaultRetryPolicy()
862 if client.RetryPolicy() != nil {
863 policy = *client.RetryPolicy()
864 }
865 if request.RetryPolicy() != nil {
866 policy = *request.RetryPolicy()
867 }
868 ociResponse, err = common.Retry(ctx, request, client.deleteDomainRecords, policy)
869 if err != nil {
870 if ociResponse != nil {
871 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
872 opcRequestId := httpResponse.Header.Get("opc-request-id")
873 response = DeleteDomainRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
874 } else {
875 response = DeleteDomainRecordsResponse{}
876 }
877 }
878 return
879 }
880 if convertedResponse, ok := ociResponse.(DeleteDomainRecordsResponse); ok {
881 response = convertedResponse
882 } else {
883 err = fmt.Errorf("failed to convert OCIResponse into DeleteDomainRecordsResponse")
884 }
885 return
886 }
887
888 // deleteDomainRecords implements the OCIOperation interface (enables retrying operations)
889 func (client DnsClient) deleteDomainRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
890
891 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}", binaryReqBody, extraHeaders)
892 if err != nil {
893 return nil, err
894 }
895
896 var response DeleteDomainRecordsResponse
897 var httpResponse *http.Response
898 httpResponse, err = client.Call(ctx, &httpRequest)
899 defer common.CloseBodyIfValid(httpResponse)
900 response.RawResponse = httpResponse
901 if err != nil {
902 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/DeleteDomainRecords"
903 err = common.PostProcessServiceError(err, "Dns", "DeleteDomainRecords", apiReferenceLink)
904 return response, err
905 }
906
907 err = common.UnmarshalResponse(httpResponse, &response)
908 return response, err
909 }
910
911 // DeleteRRSet Deletes all records in the specified RRSet.
912 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope
913 // query parameter then the viewId query parameter is required.
914 //
915 // # See also
916 //
917 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteRRSet.go.html to see an example of how to use DeleteRRSet API.
918 // A default retry strategy applies to this operation DeleteRRSet()
919 func (client DnsClient) DeleteRRSet(ctx context.Context, request DeleteRRSetRequest) (response DeleteRRSetResponse, err error) {
920 var ociResponse common.OCIResponse
921 policy := common.DefaultRetryPolicy()
922 if client.RetryPolicy() != nil {
923 policy = *client.RetryPolicy()
924 }
925 if request.RetryPolicy() != nil {
926 policy = *request.RetryPolicy()
927 }
928 ociResponse, err = common.Retry(ctx, request, client.deleteRRSet, policy)
929 if err != nil {
930 if ociResponse != nil {
931 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
932 opcRequestId := httpResponse.Header.Get("opc-request-id")
933 response = DeleteRRSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
934 } else {
935 response = DeleteRRSetResponse{}
936 }
937 }
938 return
939 }
940 if convertedResponse, ok := ociResponse.(DeleteRRSetResponse); ok {
941 response = convertedResponse
942 } else {
943 err = fmt.Errorf("failed to convert OCIResponse into DeleteRRSetResponse")
944 }
945 return
946 }
947
948 // deleteRRSet implements the OCIOperation interface (enables retrying operations)
949 func (client DnsClient) deleteRRSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
950
951 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", binaryReqBody, extraHeaders)
952 if err != nil {
953 return nil, err
954 }
955
956 var response DeleteRRSetResponse
957 var httpResponse *http.Response
958 httpResponse, err = client.Call(ctx, &httpRequest)
959 defer common.CloseBodyIfValid(httpResponse)
960 response.RawResponse = httpResponse
961 if err != nil {
962 apiReferenceLink := ""
963 err = common.PostProcessServiceError(err, "Dns", "DeleteRRSet", apiReferenceLink)
964 return response, err
965 }
966
967 err = common.UnmarshalResponse(httpResponse, &response)
968 return response, err
969 }
970
971 // DeleteResolverEndpoint Deletes the specified resolver endpoint.
972 // Note that attempting to delete a resolver endpoint in the DELETED lifecycle state will result in
973 // a `404` response to be consistent with other operations of the API. Resolver endpoints may not
974 // be deleted if they are referenced by a resolver rule.
975 //
976 // # See also
977 //
978 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteResolverEndpoint.go.html to see an example of how to use DeleteResolverEndpoint API.
979 func (client DnsClient) DeleteResolverEndpoint(ctx context.Context, request DeleteResolverEndpointRequest) (response DeleteResolverEndpointResponse, err error) {
980 var ociResponse common.OCIResponse
981 policy := common.NoRetryPolicy()
982 if client.RetryPolicy() != nil {
983 policy = *client.RetryPolicy()
984 }
985 if request.RetryPolicy() != nil {
986 policy = *request.RetryPolicy()
987 }
988 ociResponse, err = common.Retry(ctx, request, client.deleteResolverEndpoint, policy)
989 if err != nil {
990 if ociResponse != nil {
991 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
992 opcRequestId := httpResponse.Header.Get("opc-request-id")
993 response = DeleteResolverEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
994 } else {
995 response = DeleteResolverEndpointResponse{}
996 }
997 }
998 return
999 }
1000 if convertedResponse, ok := ociResponse.(DeleteResolverEndpointResponse); ok {
1001 response = convertedResponse
1002 } else {
1003 err = fmt.Errorf("failed to convert OCIResponse into DeleteResolverEndpointResponse")
1004 }
1005 return
1006 }
1007
1008 // deleteResolverEndpoint implements the OCIOperation interface (enables retrying operations)
1009 func (client DnsClient) deleteResolverEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1010
1011 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/resolvers/{resolverId}/endpoints/{resolverEndpointName}", binaryReqBody, extraHeaders)
1012 if err != nil {
1013 return nil, err
1014 }
1015
1016 var response DeleteResolverEndpointResponse
1017 var httpResponse *http.Response
1018 httpResponse, err = client.Call(ctx, &httpRequest)
1019 defer common.CloseBodyIfValid(httpResponse)
1020 response.RawResponse = httpResponse
1021 if err != nil {
1022 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/ResolverEndpoint/DeleteResolverEndpoint"
1023 err = common.PostProcessServiceError(err, "Dns", "DeleteResolverEndpoint", apiReferenceLink)
1024 return response, err
1025 }
1026
1027 err = common.UnmarshalResponse(httpResponse, &response)
1028 return response, err
1029 }
1030
1031 // DeleteSteeringPolicy Deletes the specified steering policy.
1032 // A `204` response indicates that the delete has been successful.
1033 // Deletion will fail if the policy is attached to any zones. To detach a
1034 // policy from a zone, see `DeleteSteeringPolicyAttachment`.
1035 //
1036 // # See also
1037 //
1038 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteSteeringPolicy.go.html to see an example of how to use DeleteSteeringPolicy API.
1039 func (client DnsClient) DeleteSteeringPolicy(ctx context.Context, request DeleteSteeringPolicyRequest) (response DeleteSteeringPolicyResponse, err error) {
1040 var ociResponse common.OCIResponse
1041 policy := common.NoRetryPolicy()
1042 if client.RetryPolicy() != nil {
1043 policy = *client.RetryPolicy()
1044 }
1045 if request.RetryPolicy() != nil {
1046 policy = *request.RetryPolicy()
1047 }
1048 ociResponse, err = common.Retry(ctx, request, client.deleteSteeringPolicy, policy)
1049 if err != nil {
1050 if ociResponse != nil {
1051 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1052 opcRequestId := httpResponse.Header.Get("opc-request-id")
1053 response = DeleteSteeringPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1054 } else {
1055 response = DeleteSteeringPolicyResponse{}
1056 }
1057 }
1058 return
1059 }
1060 if convertedResponse, ok := ociResponse.(DeleteSteeringPolicyResponse); ok {
1061 response = convertedResponse
1062 } else {
1063 err = fmt.Errorf("failed to convert OCIResponse into DeleteSteeringPolicyResponse")
1064 }
1065 return
1066 }
1067
1068 // deleteSteeringPolicy implements the OCIOperation interface (enables retrying operations)
1069 func (client DnsClient) deleteSteeringPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1070
1071 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/steeringPolicies/{steeringPolicyId}", binaryReqBody, extraHeaders)
1072 if err != nil {
1073 return nil, err
1074 }
1075
1076 var response DeleteSteeringPolicyResponse
1077 var httpResponse *http.Response
1078 httpResponse, err = client.Call(ctx, &httpRequest)
1079 defer common.CloseBodyIfValid(httpResponse)
1080 response.RawResponse = httpResponse
1081 if err != nil {
1082 apiReferenceLink := ""
1083 err = common.PostProcessServiceError(err, "Dns", "DeleteSteeringPolicy", apiReferenceLink)
1084 return response, err
1085 }
1086
1087 err = common.UnmarshalResponse(httpResponse, &response)
1088 return response, err
1089 }
1090
1091 // DeleteSteeringPolicyAttachment Deletes the specified steering policy attachment.
1092 // A `204` response indicates that the delete has been successful.
1093 //
1094 // # See also
1095 //
1096 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteSteeringPolicyAttachment.go.html to see an example of how to use DeleteSteeringPolicyAttachment API.
1097 func (client DnsClient) DeleteSteeringPolicyAttachment(ctx context.Context, request DeleteSteeringPolicyAttachmentRequest) (response DeleteSteeringPolicyAttachmentResponse, err error) {
1098 var ociResponse common.OCIResponse
1099 policy := common.NoRetryPolicy()
1100 if client.RetryPolicy() != nil {
1101 policy = *client.RetryPolicy()
1102 }
1103 if request.RetryPolicy() != nil {
1104 policy = *request.RetryPolicy()
1105 }
1106 ociResponse, err = common.Retry(ctx, request, client.deleteSteeringPolicyAttachment, policy)
1107 if err != nil {
1108 if ociResponse != nil {
1109 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1110 opcRequestId := httpResponse.Header.Get("opc-request-id")
1111 response = DeleteSteeringPolicyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1112 } else {
1113 response = DeleteSteeringPolicyAttachmentResponse{}
1114 }
1115 }
1116 return
1117 }
1118 if convertedResponse, ok := ociResponse.(DeleteSteeringPolicyAttachmentResponse); ok {
1119 response = convertedResponse
1120 } else {
1121 err = fmt.Errorf("failed to convert OCIResponse into DeleteSteeringPolicyAttachmentResponse")
1122 }
1123 return
1124 }
1125
1126 // deleteSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations)
1127 func (client DnsClient) deleteSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1128
1129 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}", binaryReqBody, extraHeaders)
1130 if err != nil {
1131 return nil, err
1132 }
1133
1134 var response DeleteSteeringPolicyAttachmentResponse
1135 var httpResponse *http.Response
1136 httpResponse, err = client.Call(ctx, &httpRequest)
1137 defer common.CloseBodyIfValid(httpResponse)
1138 response.RawResponse = httpResponse
1139 if err != nil {
1140 apiReferenceLink := ""
1141 err = common.PostProcessServiceError(err, "Dns", "DeleteSteeringPolicyAttachment", apiReferenceLink)
1142 return response, err
1143 }
1144
1145 err = common.UnmarshalResponse(httpResponse, &response)
1146 return response, err
1147 }
1148
1149 // DeleteTsigKey Deletes the specified TSIG key.
1150 //
1151 // # See also
1152 //
1153 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteTsigKey.go.html to see an example of how to use DeleteTsigKey API.
1154 func (client DnsClient) DeleteTsigKey(ctx context.Context, request DeleteTsigKeyRequest) (response DeleteTsigKeyResponse, err error) {
1155 var ociResponse common.OCIResponse
1156 policy := common.NoRetryPolicy()
1157 if client.RetryPolicy() != nil {
1158 policy = *client.RetryPolicy()
1159 }
1160 if request.RetryPolicy() != nil {
1161 policy = *request.RetryPolicy()
1162 }
1163 ociResponse, err = common.Retry(ctx, request, client.deleteTsigKey, policy)
1164 if err != nil {
1165 if ociResponse != nil {
1166 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1167 opcRequestId := httpResponse.Header.Get("opc-request-id")
1168 response = DeleteTsigKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1169 } else {
1170 response = DeleteTsigKeyResponse{}
1171 }
1172 }
1173 return
1174 }
1175 if convertedResponse, ok := ociResponse.(DeleteTsigKeyResponse); ok {
1176 response = convertedResponse
1177 } else {
1178 err = fmt.Errorf("failed to convert OCIResponse into DeleteTsigKeyResponse")
1179 }
1180 return
1181 }
1182
1183 // deleteTsigKey implements the OCIOperation interface (enables retrying operations)
1184 func (client DnsClient) deleteTsigKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1185
1186 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/tsigKeys/{tsigKeyId}", binaryReqBody, extraHeaders)
1187 if err != nil {
1188 return nil, err
1189 }
1190
1191 var response DeleteTsigKeyResponse
1192 var httpResponse *http.Response
1193 httpResponse, err = client.Call(ctx, &httpRequest)
1194 defer common.CloseBodyIfValid(httpResponse)
1195 response.RawResponse = httpResponse
1196 if err != nil {
1197 apiReferenceLink := ""
1198 err = common.PostProcessServiceError(err, "Dns", "DeleteTsigKey", apiReferenceLink)
1199 return response, err
1200 }
1201
1202 err = common.UnmarshalResponse(httpResponse, &response)
1203 return response, err
1204 }
1205
1206 // DeleteView Deletes the specified view.
1207 // Note that attempting to delete a view in the DELETED lifecycleState will result in a `404`
1208 // response to be consistent with other operations of the API. Views cannot be
1209 // deleted if they are referenced by non-deleted zones or resolvers.
1210 // Protected views cannot be deleted.
1211 //
1212 // # See also
1213 //
1214 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteView.go.html to see an example of how to use DeleteView API.
1215 func (client DnsClient) DeleteView(ctx context.Context, request DeleteViewRequest) (response DeleteViewResponse, err error) {
1216 var ociResponse common.OCIResponse
1217 policy := common.NoRetryPolicy()
1218 if client.RetryPolicy() != nil {
1219 policy = *client.RetryPolicy()
1220 }
1221 if request.RetryPolicy() != nil {
1222 policy = *request.RetryPolicy()
1223 }
1224 ociResponse, err = common.Retry(ctx, request, client.deleteView, policy)
1225 if err != nil {
1226 if ociResponse != nil {
1227 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1228 opcRequestId := httpResponse.Header.Get("opc-request-id")
1229 response = DeleteViewResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1230 } else {
1231 response = DeleteViewResponse{}
1232 }
1233 }
1234 return
1235 }
1236 if convertedResponse, ok := ociResponse.(DeleteViewResponse); ok {
1237 response = convertedResponse
1238 } else {
1239 err = fmt.Errorf("failed to convert OCIResponse into DeleteViewResponse")
1240 }
1241 return
1242 }
1243
1244 // deleteView implements the OCIOperation interface (enables retrying operations)
1245 func (client DnsClient) deleteView(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1246
1247 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/views/{viewId}", binaryReqBody, extraHeaders)
1248 if err != nil {
1249 return nil, err
1250 }
1251
1252 var response DeleteViewResponse
1253 var httpResponse *http.Response
1254 httpResponse, err = client.Call(ctx, &httpRequest)
1255 defer common.CloseBodyIfValid(httpResponse)
1256 response.RawResponse = httpResponse
1257 if err != nil {
1258 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/View/DeleteView"
1259 err = common.PostProcessServiceError(err, "Dns", "DeleteView", apiReferenceLink)
1260 return response, err
1261 }
1262
1263 err = common.UnmarshalResponse(httpResponse, &response)
1264 return response, err
1265 }
1266
1267 // DeleteZone Deletes the specified zone and all its steering policy attachments.
1268 // A `204` response indicates that the zone has been successfully deleted. Protected zones cannot be deleted.
1269 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query parameter
1270 // then the viewId query parameter is required.
1271 //
1272 // # See also
1273 //
1274 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/DeleteZone.go.html to see an example of how to use DeleteZone API.
1275 func (client DnsClient) DeleteZone(ctx context.Context, request DeleteZoneRequest) (response DeleteZoneResponse, err error) {
1276 var ociResponse common.OCIResponse
1277 policy := common.NoRetryPolicy()
1278 if client.RetryPolicy() != nil {
1279 policy = *client.RetryPolicy()
1280 }
1281 if request.RetryPolicy() != nil {
1282 policy = *request.RetryPolicy()
1283 }
1284 ociResponse, err = common.Retry(ctx, request, client.deleteZone, policy)
1285 if err != nil {
1286 if ociResponse != nil {
1287 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1288 opcRequestId := httpResponse.Header.Get("opc-request-id")
1289 response = DeleteZoneResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1290 } else {
1291 response = DeleteZoneResponse{}
1292 }
1293 }
1294 return
1295 }
1296 if convertedResponse, ok := ociResponse.(DeleteZoneResponse); ok {
1297 response = convertedResponse
1298 } else {
1299 err = fmt.Errorf("failed to convert OCIResponse into DeleteZoneResponse")
1300 }
1301 return
1302 }
1303
1304 // deleteZone implements the OCIOperation interface (enables retrying operations)
1305 func (client DnsClient) deleteZone(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1306
1307 httpRequest, err := request.HTTPRequest(http.MethodDelete, "/zones/{zoneNameOrId}", binaryReqBody, extraHeaders)
1308 if err != nil {
1309 return nil, err
1310 }
1311
1312 var response DeleteZoneResponse
1313 var httpResponse *http.Response
1314 httpResponse, err = client.Call(ctx, &httpRequest)
1315 defer common.CloseBodyIfValid(httpResponse)
1316 response.RawResponse = httpResponse
1317 if err != nil {
1318 apiReferenceLink := ""
1319 err = common.PostProcessServiceError(err, "Dns", "DeleteZone", apiReferenceLink)
1320 return response, err
1321 }
1322
1323 err = common.UnmarshalResponse(httpResponse, &response)
1324 return response, err
1325 }
1326
1327 // GetDomainRecords Gets a list of all records at the specified zone and domain.
1328 // The results are sorted by `rtype` in alphabetical order by default. You can optionally filter and/or sort
1329 // the results using the listed parameters. When the zone name is provided as a path parameter and `PRIVATE`
1330 // is used for the scope query parameter then the viewId query parameter is required.
1331 //
1332 // # See also
1333 //
1334 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetDomainRecords.go.html to see an example of how to use GetDomainRecords API.
1335 // A default retry strategy applies to this operation GetDomainRecords()
1336 func (client DnsClient) GetDomainRecords(ctx context.Context, request GetDomainRecordsRequest) (response GetDomainRecordsResponse, err error) {
1337 var ociResponse common.OCIResponse
1338 policy := common.DefaultRetryPolicy()
1339 if client.RetryPolicy() != nil {
1340 policy = *client.RetryPolicy()
1341 }
1342 if request.RetryPolicy() != nil {
1343 policy = *request.RetryPolicy()
1344 }
1345 ociResponse, err = common.Retry(ctx, request, client.getDomainRecords, policy)
1346 if err != nil {
1347 if ociResponse != nil {
1348 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1349 opcRequestId := httpResponse.Header.Get("opc-request-id")
1350 response = GetDomainRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1351 } else {
1352 response = GetDomainRecordsResponse{}
1353 }
1354 }
1355 return
1356 }
1357 if convertedResponse, ok := ociResponse.(GetDomainRecordsResponse); ok {
1358 response = convertedResponse
1359 } else {
1360 err = fmt.Errorf("failed to convert OCIResponse into GetDomainRecordsResponse")
1361 }
1362 return
1363 }
1364
1365 // getDomainRecords implements the OCIOperation interface (enables retrying operations)
1366 func (client DnsClient) getDomainRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1367
1368 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}", binaryReqBody, extraHeaders)
1369 if err != nil {
1370 return nil, err
1371 }
1372
1373 var response GetDomainRecordsResponse
1374 var httpResponse *http.Response
1375 httpResponse, err = client.Call(ctx, &httpRequest)
1376 defer common.CloseBodyIfValid(httpResponse)
1377 response.RawResponse = httpResponse
1378 if err != nil {
1379 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/GetDomainRecords"
1380 err = common.PostProcessServiceError(err, "Dns", "GetDomainRecords", apiReferenceLink)
1381 return response, err
1382 }
1383
1384 err = common.UnmarshalResponse(httpResponse, &response)
1385 return response, err
1386 }
1387
1388 // GetRRSet Gets a list of all records in the specified RRSet.
1389 // The results are sorted by `recordHash` by default. When the zone name is provided as a path parameter
1390 // and `PRIVATE` is used for the scope query parameter then the viewId query parameter is required.
1391 //
1392 // # See also
1393 //
1394 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetRRSet.go.html to see an example of how to use GetRRSet API.
1395 // A default retry strategy applies to this operation GetRRSet()
1396 func (client DnsClient) GetRRSet(ctx context.Context, request GetRRSetRequest) (response GetRRSetResponse, err error) {
1397 var ociResponse common.OCIResponse
1398 policy := common.DefaultRetryPolicy()
1399 if client.RetryPolicy() != nil {
1400 policy = *client.RetryPolicy()
1401 }
1402 if request.RetryPolicy() != nil {
1403 policy = *request.RetryPolicy()
1404 }
1405 ociResponse, err = common.Retry(ctx, request, client.getRRSet, policy)
1406 if err != nil {
1407 if ociResponse != nil {
1408 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1409 opcRequestId := httpResponse.Header.Get("opc-request-id")
1410 response = GetRRSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1411 } else {
1412 response = GetRRSetResponse{}
1413 }
1414 }
1415 return
1416 }
1417 if convertedResponse, ok := ociResponse.(GetRRSetResponse); ok {
1418 response = convertedResponse
1419 } else {
1420 err = fmt.Errorf("failed to convert OCIResponse into GetRRSetResponse")
1421 }
1422 return
1423 }
1424
1425 // getRRSet implements the OCIOperation interface (enables retrying operations)
1426 func (client DnsClient) getRRSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1427
1428 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", binaryReqBody, extraHeaders)
1429 if err != nil {
1430 return nil, err
1431 }
1432
1433 var response GetRRSetResponse
1434 var httpResponse *http.Response
1435 httpResponse, err = client.Call(ctx, &httpRequest)
1436 defer common.CloseBodyIfValid(httpResponse)
1437 response.RawResponse = httpResponse
1438 if err != nil {
1439 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/RRSet/GetRRSet"
1440 err = common.PostProcessServiceError(err, "Dns", "GetRRSet", apiReferenceLink)
1441 return response, err
1442 }
1443
1444 err = common.UnmarshalResponse(httpResponse, &response)
1445 return response, err
1446 }
1447
1448 // GetResolver Gets information about a specific resolver.
1449 // Note that attempting to get a resolver in the DELETED lifecycleState will result in a `404`
1450 // response to be consistent with other operations of the API.
1451 //
1452 // # See also
1453 //
1454 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetResolver.go.html to see an example of how to use GetResolver API.
1455 // A default retry strategy applies to this operation GetResolver()
1456 func (client DnsClient) GetResolver(ctx context.Context, request GetResolverRequest) (response GetResolverResponse, err error) {
1457 var ociResponse common.OCIResponse
1458 policy := common.DefaultRetryPolicy()
1459 if client.RetryPolicy() != nil {
1460 policy = *client.RetryPolicy()
1461 }
1462 if request.RetryPolicy() != nil {
1463 policy = *request.RetryPolicy()
1464 }
1465 ociResponse, err = common.Retry(ctx, request, client.getResolver, policy)
1466 if err != nil {
1467 if ociResponse != nil {
1468 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1469 opcRequestId := httpResponse.Header.Get("opc-request-id")
1470 response = GetResolverResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1471 } else {
1472 response = GetResolverResponse{}
1473 }
1474 }
1475 return
1476 }
1477 if convertedResponse, ok := ociResponse.(GetResolverResponse); ok {
1478 response = convertedResponse
1479 } else {
1480 err = fmt.Errorf("failed to convert OCIResponse into GetResolverResponse")
1481 }
1482 return
1483 }
1484
1485 // getResolver implements the OCIOperation interface (enables retrying operations)
1486 func (client DnsClient) getResolver(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1487
1488 httpRequest, err := request.HTTPRequest(http.MethodGet, "/resolvers/{resolverId}", binaryReqBody, extraHeaders)
1489 if err != nil {
1490 return nil, err
1491 }
1492
1493 var response GetResolverResponse
1494 var httpResponse *http.Response
1495 httpResponse, err = client.Call(ctx, &httpRequest)
1496 defer common.CloseBodyIfValid(httpResponse)
1497 response.RawResponse = httpResponse
1498 if err != nil {
1499 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Resolver/GetResolver"
1500 err = common.PostProcessServiceError(err, "Dns", "GetResolver", apiReferenceLink)
1501 return response, err
1502 }
1503
1504 err = common.UnmarshalResponse(httpResponse, &response)
1505 return response, err
1506 }
1507
1508 // GetResolverEndpoint Gets information about a specific resolver endpoint.
1509 // Note that attempting to get a resolver endpoint in the DELETED lifecycle state will result
1510 // in a `404` response to be consistent with other operations of the API.
1511 //
1512 // # See also
1513 //
1514 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetResolverEndpoint.go.html to see an example of how to use GetResolverEndpoint API.
1515 // A default retry strategy applies to this operation GetResolverEndpoint()
1516 func (client DnsClient) GetResolverEndpoint(ctx context.Context, request GetResolverEndpointRequest) (response GetResolverEndpointResponse, err error) {
1517 var ociResponse common.OCIResponse
1518 policy := common.DefaultRetryPolicy()
1519 if client.RetryPolicy() != nil {
1520 policy = *client.RetryPolicy()
1521 }
1522 if request.RetryPolicy() != nil {
1523 policy = *request.RetryPolicy()
1524 }
1525 ociResponse, err = common.Retry(ctx, request, client.getResolverEndpoint, policy)
1526 if err != nil {
1527 if ociResponse != nil {
1528 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1529 opcRequestId := httpResponse.Header.Get("opc-request-id")
1530 response = GetResolverEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1531 } else {
1532 response = GetResolverEndpointResponse{}
1533 }
1534 }
1535 return
1536 }
1537 if convertedResponse, ok := ociResponse.(GetResolverEndpointResponse); ok {
1538 response = convertedResponse
1539 } else {
1540 err = fmt.Errorf("failed to convert OCIResponse into GetResolverEndpointResponse")
1541 }
1542 return
1543 }
1544
1545 // getResolverEndpoint implements the OCIOperation interface (enables retrying operations)
1546 func (client DnsClient) getResolverEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1547
1548 httpRequest, err := request.HTTPRequest(http.MethodGet, "/resolvers/{resolverId}/endpoints/{resolverEndpointName}", binaryReqBody, extraHeaders)
1549 if err != nil {
1550 return nil, err
1551 }
1552
1553 var response GetResolverEndpointResponse
1554 var httpResponse *http.Response
1555 httpResponse, err = client.Call(ctx, &httpRequest)
1556 defer common.CloseBodyIfValid(httpResponse)
1557 response.RawResponse = httpResponse
1558 if err != nil {
1559 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/ResolverEndpoint/GetResolverEndpoint"
1560 err = common.PostProcessServiceError(err, "Dns", "GetResolverEndpoint", apiReferenceLink)
1561 return response, err
1562 }
1563
1564 err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &resolverendpoint{})
1565 return response, err
1566 }
1567
1568 // GetSteeringPolicy Gets information about the specified steering policy.
1569 //
1570 // # See also
1571 //
1572 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetSteeringPolicy.go.html to see an example of how to use GetSteeringPolicy API.
1573 // A default retry strategy applies to this operation GetSteeringPolicy()
1574 func (client DnsClient) GetSteeringPolicy(ctx context.Context, request GetSteeringPolicyRequest) (response GetSteeringPolicyResponse, err error) {
1575 var ociResponse common.OCIResponse
1576 policy := common.DefaultRetryPolicy()
1577 if client.RetryPolicy() != nil {
1578 policy = *client.RetryPolicy()
1579 }
1580 if request.RetryPolicy() != nil {
1581 policy = *request.RetryPolicy()
1582 }
1583 ociResponse, err = common.Retry(ctx, request, client.getSteeringPolicy, policy)
1584 if err != nil {
1585 if ociResponse != nil {
1586 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1587 opcRequestId := httpResponse.Header.Get("opc-request-id")
1588 response = GetSteeringPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1589 } else {
1590 response = GetSteeringPolicyResponse{}
1591 }
1592 }
1593 return
1594 }
1595 if convertedResponse, ok := ociResponse.(GetSteeringPolicyResponse); ok {
1596 response = convertedResponse
1597 } else {
1598 err = fmt.Errorf("failed to convert OCIResponse into GetSteeringPolicyResponse")
1599 }
1600 return
1601 }
1602
1603 // getSteeringPolicy implements the OCIOperation interface (enables retrying operations)
1604 func (client DnsClient) getSteeringPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1605
1606 httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicies/{steeringPolicyId}", binaryReqBody, extraHeaders)
1607 if err != nil {
1608 return nil, err
1609 }
1610
1611 var response GetSteeringPolicyResponse
1612 var httpResponse *http.Response
1613 httpResponse, err = client.Call(ctx, &httpRequest)
1614 defer common.CloseBodyIfValid(httpResponse)
1615 response.RawResponse = httpResponse
1616 if err != nil {
1617 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicy/GetSteeringPolicy"
1618 err = common.PostProcessServiceError(err, "Dns", "GetSteeringPolicy", apiReferenceLink)
1619 return response, err
1620 }
1621
1622 err = common.UnmarshalResponse(httpResponse, &response)
1623 return response, err
1624 }
1625
1626 // GetSteeringPolicyAttachment Gets information about the specified steering policy attachment.
1627 //
1628 // # See also
1629 //
1630 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetSteeringPolicyAttachment.go.html to see an example of how to use GetSteeringPolicyAttachment API.
1631 // A default retry strategy applies to this operation GetSteeringPolicyAttachment()
1632 func (client DnsClient) GetSteeringPolicyAttachment(ctx context.Context, request GetSteeringPolicyAttachmentRequest) (response GetSteeringPolicyAttachmentResponse, err error) {
1633 var ociResponse common.OCIResponse
1634 policy := common.DefaultRetryPolicy()
1635 if client.RetryPolicy() != nil {
1636 policy = *client.RetryPolicy()
1637 }
1638 if request.RetryPolicy() != nil {
1639 policy = *request.RetryPolicy()
1640 }
1641 ociResponse, err = common.Retry(ctx, request, client.getSteeringPolicyAttachment, policy)
1642 if err != nil {
1643 if ociResponse != nil {
1644 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1645 opcRequestId := httpResponse.Header.Get("opc-request-id")
1646 response = GetSteeringPolicyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1647 } else {
1648 response = GetSteeringPolicyAttachmentResponse{}
1649 }
1650 }
1651 return
1652 }
1653 if convertedResponse, ok := ociResponse.(GetSteeringPolicyAttachmentResponse); ok {
1654 response = convertedResponse
1655 } else {
1656 err = fmt.Errorf("failed to convert OCIResponse into GetSteeringPolicyAttachmentResponse")
1657 }
1658 return
1659 }
1660
1661 // getSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations)
1662 func (client DnsClient) getSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1663
1664 httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}", binaryReqBody, extraHeaders)
1665 if err != nil {
1666 return nil, err
1667 }
1668
1669 var response GetSteeringPolicyAttachmentResponse
1670 var httpResponse *http.Response
1671 httpResponse, err = client.Call(ctx, &httpRequest)
1672 defer common.CloseBodyIfValid(httpResponse)
1673 response.RawResponse = httpResponse
1674 if err != nil {
1675 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicyAttachment/GetSteeringPolicyAttachment"
1676 err = common.PostProcessServiceError(err, "Dns", "GetSteeringPolicyAttachment", apiReferenceLink)
1677 return response, err
1678 }
1679
1680 err = common.UnmarshalResponse(httpResponse, &response)
1681 return response, err
1682 }
1683
1684 // GetTsigKey Gets information about the specified TSIG key.
1685 //
1686 // # See also
1687 //
1688 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetTsigKey.go.html to see an example of how to use GetTsigKey API.
1689 // A default retry strategy applies to this operation GetTsigKey()
1690 func (client DnsClient) GetTsigKey(ctx context.Context, request GetTsigKeyRequest) (response GetTsigKeyResponse, err error) {
1691 var ociResponse common.OCIResponse
1692 policy := common.DefaultRetryPolicy()
1693 if client.RetryPolicy() != nil {
1694 policy = *client.RetryPolicy()
1695 }
1696 if request.RetryPolicy() != nil {
1697 policy = *request.RetryPolicy()
1698 }
1699 ociResponse, err = common.Retry(ctx, request, client.getTsigKey, policy)
1700 if err != nil {
1701 if ociResponse != nil {
1702 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1703 opcRequestId := httpResponse.Header.Get("opc-request-id")
1704 response = GetTsigKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1705 } else {
1706 response = GetTsigKeyResponse{}
1707 }
1708 }
1709 return
1710 }
1711 if convertedResponse, ok := ociResponse.(GetTsigKeyResponse); ok {
1712 response = convertedResponse
1713 } else {
1714 err = fmt.Errorf("failed to convert OCIResponse into GetTsigKeyResponse")
1715 }
1716 return
1717 }
1718
1719 // getTsigKey implements the OCIOperation interface (enables retrying operations)
1720 func (client DnsClient) getTsigKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1721
1722 httpRequest, err := request.HTTPRequest(http.MethodGet, "/tsigKeys/{tsigKeyId}", binaryReqBody, extraHeaders)
1723 if err != nil {
1724 return nil, err
1725 }
1726
1727 var response GetTsigKeyResponse
1728 var httpResponse *http.Response
1729 httpResponse, err = client.Call(ctx, &httpRequest)
1730 defer common.CloseBodyIfValid(httpResponse)
1731 response.RawResponse = httpResponse
1732 if err != nil {
1733 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/TsigKey/GetTsigKey"
1734 err = common.PostProcessServiceError(err, "Dns", "GetTsigKey", apiReferenceLink)
1735 return response, err
1736 }
1737
1738 err = common.UnmarshalResponse(httpResponse, &response)
1739 return response, err
1740 }
1741
1742 // GetView Gets information about a specific view.
1743 // Note that attempting to get a
1744 // view in the DELETED lifecycleState will result in a `404` response to be
1745 // consistent with other operations of the API.
1746 //
1747 // # See also
1748 //
1749 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetView.go.html to see an example of how to use GetView API.
1750 // A default retry strategy applies to this operation GetView()
1751 func (client DnsClient) GetView(ctx context.Context, request GetViewRequest) (response GetViewResponse, err error) {
1752 var ociResponse common.OCIResponse
1753 policy := common.DefaultRetryPolicy()
1754 if client.RetryPolicy() != nil {
1755 policy = *client.RetryPolicy()
1756 }
1757 if request.RetryPolicy() != nil {
1758 policy = *request.RetryPolicy()
1759 }
1760 ociResponse, err = common.Retry(ctx, request, client.getView, policy)
1761 if err != nil {
1762 if ociResponse != nil {
1763 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1764 opcRequestId := httpResponse.Header.Get("opc-request-id")
1765 response = GetViewResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1766 } else {
1767 response = GetViewResponse{}
1768 }
1769 }
1770 return
1771 }
1772 if convertedResponse, ok := ociResponse.(GetViewResponse); ok {
1773 response = convertedResponse
1774 } else {
1775 err = fmt.Errorf("failed to convert OCIResponse into GetViewResponse")
1776 }
1777 return
1778 }
1779
1780 // getView implements the OCIOperation interface (enables retrying operations)
1781 func (client DnsClient) getView(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1782
1783 httpRequest, err := request.HTTPRequest(http.MethodGet, "/views/{viewId}", binaryReqBody, extraHeaders)
1784 if err != nil {
1785 return nil, err
1786 }
1787
1788 var response GetViewResponse
1789 var httpResponse *http.Response
1790 httpResponse, err = client.Call(ctx, &httpRequest)
1791 defer common.CloseBodyIfValid(httpResponse)
1792 response.RawResponse = httpResponse
1793 if err != nil {
1794 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/View/GetView"
1795 err = common.PostProcessServiceError(err, "Dns", "GetView", apiReferenceLink)
1796 return response, err
1797 }
1798
1799 err = common.UnmarshalResponse(httpResponse, &response)
1800 return response, err
1801 }
1802
1803 // GetZone Gets information about the specified zone, including its creation date, zone type, and serial.
1804 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query
1805 // parameter then the viewId query parameter is required.
1806 //
1807 // # See also
1808 //
1809 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetZone.go.html to see an example of how to use GetZone API.
1810 // A default retry strategy applies to this operation GetZone()
1811 func (client DnsClient) GetZone(ctx context.Context, request GetZoneRequest) (response GetZoneResponse, err error) {
1812 var ociResponse common.OCIResponse
1813 policy := common.DefaultRetryPolicy()
1814 if client.RetryPolicy() != nil {
1815 policy = *client.RetryPolicy()
1816 }
1817 if request.RetryPolicy() != nil {
1818 policy = *request.RetryPolicy()
1819 }
1820 ociResponse, err = common.Retry(ctx, request, client.getZone, policy)
1821 if err != nil {
1822 if ociResponse != nil {
1823 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1824 opcRequestId := httpResponse.Header.Get("opc-request-id")
1825 response = GetZoneResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1826 } else {
1827 response = GetZoneResponse{}
1828 }
1829 }
1830 return
1831 }
1832 if convertedResponse, ok := ociResponse.(GetZoneResponse); ok {
1833 response = convertedResponse
1834 } else {
1835 err = fmt.Errorf("failed to convert OCIResponse into GetZoneResponse")
1836 }
1837 return
1838 }
1839
1840 // getZone implements the OCIOperation interface (enables retrying operations)
1841 func (client DnsClient) getZone(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1842
1843 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}", binaryReqBody, extraHeaders)
1844 if err != nil {
1845 return nil, err
1846 }
1847
1848 var response GetZoneResponse
1849 var httpResponse *http.Response
1850 httpResponse, err = client.Call(ctx, &httpRequest)
1851 defer common.CloseBodyIfValid(httpResponse)
1852 response.RawResponse = httpResponse
1853 if err != nil {
1854 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/GetZone"
1855 err = common.PostProcessServiceError(err, "Dns", "GetZone", apiReferenceLink)
1856 return response, err
1857 }
1858
1859 err = common.UnmarshalResponse(httpResponse, &response)
1860 return response, err
1861 }
1862
1863 // GetZoneContent Gets the requested zone's zone file.
1864 //
1865 // # See also
1866 //
1867 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetZoneContent.go.html to see an example of how to use GetZoneContent API.
1868 // A default retry strategy applies to this operation GetZoneContent()
1869 func (client DnsClient) GetZoneContent(ctx context.Context, request GetZoneContentRequest) (response GetZoneContentResponse, err error) {
1870 var ociResponse common.OCIResponse
1871 policy := common.DefaultRetryPolicy()
1872 if client.RetryPolicy() != nil {
1873 policy = *client.RetryPolicy()
1874 }
1875 if request.RetryPolicy() != nil {
1876 policy = *request.RetryPolicy()
1877 }
1878 ociResponse, err = common.Retry(ctx, request, client.getZoneContent, policy)
1879 if err != nil {
1880 if ociResponse != nil {
1881 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1882 opcRequestId := httpResponse.Header.Get("opc-request-id")
1883 response = GetZoneContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1884 } else {
1885 response = GetZoneContentResponse{}
1886 }
1887 }
1888 return
1889 }
1890 if convertedResponse, ok := ociResponse.(GetZoneContentResponse); ok {
1891 response = convertedResponse
1892 } else {
1893 err = fmt.Errorf("failed to convert OCIResponse into GetZoneContentResponse")
1894 }
1895 return
1896 }
1897
1898 // getZoneContent implements the OCIOperation interface (enables retrying operations)
1899 func (client DnsClient) getZoneContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1900
1901 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/content", binaryReqBody, extraHeaders)
1902 if err != nil {
1903 return nil, err
1904 }
1905
1906 var response GetZoneContentResponse
1907 var httpResponse *http.Response
1908 httpResponse, err = client.Call(ctx, &httpRequest)
1909 response.RawResponse = httpResponse
1910 if err != nil {
1911 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/GetZoneContent"
1912 err = common.PostProcessServiceError(err, "Dns", "GetZoneContent", apiReferenceLink)
1913 return response, err
1914 }
1915
1916 err = common.UnmarshalResponse(httpResponse, &response)
1917 return response, err
1918 }
1919
1920 // GetZoneRecords Gets all records in the specified zone.
1921 // The results are sorted by `domain` in alphabetical order by default. For more information about records,
1922 // see Resource Record (RR) TYPEs (https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
1923 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query parameter
1924 // then the viewId query parameter is required.
1925 //
1926 // # See also
1927 //
1928 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/GetZoneRecords.go.html to see an example of how to use GetZoneRecords API.
1929 // A default retry strategy applies to this operation GetZoneRecords()
1930 func (client DnsClient) GetZoneRecords(ctx context.Context, request GetZoneRecordsRequest) (response GetZoneRecordsResponse, err error) {
1931 var ociResponse common.OCIResponse
1932 policy := common.DefaultRetryPolicy()
1933 if client.RetryPolicy() != nil {
1934 policy = *client.RetryPolicy()
1935 }
1936 if request.RetryPolicy() != nil {
1937 policy = *request.RetryPolicy()
1938 }
1939 ociResponse, err = common.Retry(ctx, request, client.getZoneRecords, policy)
1940 if err != nil {
1941 if ociResponse != nil {
1942 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
1943 opcRequestId := httpResponse.Header.Get("opc-request-id")
1944 response = GetZoneRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
1945 } else {
1946 response = GetZoneRecordsResponse{}
1947 }
1948 }
1949 return
1950 }
1951 if convertedResponse, ok := ociResponse.(GetZoneRecordsResponse); ok {
1952 response = convertedResponse
1953 } else {
1954 err = fmt.Errorf("failed to convert OCIResponse into GetZoneRecordsResponse")
1955 }
1956 return
1957 }
1958
1959 // getZoneRecords implements the OCIOperation interface (enables retrying operations)
1960 func (client DnsClient) getZoneRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
1961
1962 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones/{zoneNameOrId}/records", binaryReqBody, extraHeaders)
1963 if err != nil {
1964 return nil, err
1965 }
1966
1967 var response GetZoneRecordsResponse
1968 var httpResponse *http.Response
1969 httpResponse, err = client.Call(ctx, &httpRequest)
1970 defer common.CloseBodyIfValid(httpResponse)
1971 response.RawResponse = httpResponse
1972 if err != nil {
1973 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/GetZoneRecords"
1974 err = common.PostProcessServiceError(err, "Dns", "GetZoneRecords", apiReferenceLink)
1975 return response, err
1976 }
1977
1978 err = common.UnmarshalResponse(httpResponse, &response)
1979 return response, err
1980 }
1981
1982 // listresolverendpointsummary allows to unmarshal list of polymorphic ResolverEndpointSummary
1983 type listresolverendpointsummary []resolverendpointsummary
1984
1985 // UnmarshalPolymorphicJSON unmarshals polymorphic json list of items
1986 func (m *listresolverendpointsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {
1987 res := make([]ResolverEndpointSummary, len(*m))
1988 for i, v := range *m {
1989 nn, err := v.UnmarshalPolymorphicJSON(v.JsonData)
1990 if err != nil {
1991 return nil, err
1992 }
1993 res[i] = nn.(ResolverEndpointSummary)
1994 }
1995 return res, nil
1996 }
1997
1998 // ListResolverEndpoints Gets a list of all endpoints within a resolver. The collection can be filtered by name or lifecycle state.
1999 // It can be sorted on creation time or name both in ASC or DESC order. Note that when no lifecycleState
2000 // query parameter is provided, the collection does not include resolver endpoints in the DELETED
2001 // lifecycle state to be consistent with other operations of the API.
2002 //
2003 // # See also
2004 //
2005 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListResolverEndpoints.go.html to see an example of how to use ListResolverEndpoints API.
2006 // A default retry strategy applies to this operation ListResolverEndpoints()
2007 func (client DnsClient) ListResolverEndpoints(ctx context.Context, request ListResolverEndpointsRequest) (response ListResolverEndpointsResponse, err error) {
2008 var ociResponse common.OCIResponse
2009 policy := common.DefaultRetryPolicy()
2010 if client.RetryPolicy() != nil {
2011 policy = *client.RetryPolicy()
2012 }
2013 if request.RetryPolicy() != nil {
2014 policy = *request.RetryPolicy()
2015 }
2016 ociResponse, err = common.Retry(ctx, request, client.listResolverEndpoints, policy)
2017 if err != nil {
2018 if ociResponse != nil {
2019 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2020 opcRequestId := httpResponse.Header.Get("opc-request-id")
2021 response = ListResolverEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2022 } else {
2023 response = ListResolverEndpointsResponse{}
2024 }
2025 }
2026 return
2027 }
2028 if convertedResponse, ok := ociResponse.(ListResolverEndpointsResponse); ok {
2029 response = convertedResponse
2030 } else {
2031 err = fmt.Errorf("failed to convert OCIResponse into ListResolverEndpointsResponse")
2032 }
2033 return
2034 }
2035
2036 // listResolverEndpoints implements the OCIOperation interface (enables retrying operations)
2037 func (client DnsClient) listResolverEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2038
2039 httpRequest, err := request.HTTPRequest(http.MethodGet, "/resolvers/{resolverId}/endpoints", binaryReqBody, extraHeaders)
2040 if err != nil {
2041 return nil, err
2042 }
2043
2044 var response ListResolverEndpointsResponse
2045 var httpResponse *http.Response
2046 httpResponse, err = client.Call(ctx, &httpRequest)
2047 defer common.CloseBodyIfValid(httpResponse)
2048 response.RawResponse = httpResponse
2049 if err != nil {
2050 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/ResolverEndpoint/ListResolverEndpoints"
2051 err = common.PostProcessServiceError(err, "Dns", "ListResolverEndpoints", apiReferenceLink)
2052 return response, err
2053 }
2054
2055 err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listresolverendpointsummary{})
2056 return response, err
2057 }
2058
2059 // ListResolvers Gets a list of all resolvers within a compartment.
2060 // The collection can be filtered by display name, id, or lifecycle state. It can be sorted
2061 // on creation time or displayName both in ASC or DESC order. Note that when no lifecycleState
2062 // query parameter is provided, the collection does not include resolvers in the DELETED
2063 // lifecycleState to be consistent with other operations of the API.
2064 //
2065 // # See also
2066 //
2067 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListResolvers.go.html to see an example of how to use ListResolvers API.
2068 // A default retry strategy applies to this operation ListResolvers()
2069 func (client DnsClient) ListResolvers(ctx context.Context, request ListResolversRequest) (response ListResolversResponse, err error) {
2070 var ociResponse common.OCIResponse
2071 policy := common.DefaultRetryPolicy()
2072 if client.RetryPolicy() != nil {
2073 policy = *client.RetryPolicy()
2074 }
2075 if request.RetryPolicy() != nil {
2076 policy = *request.RetryPolicy()
2077 }
2078 ociResponse, err = common.Retry(ctx, request, client.listResolvers, policy)
2079 if err != nil {
2080 if ociResponse != nil {
2081 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2082 opcRequestId := httpResponse.Header.Get("opc-request-id")
2083 response = ListResolversResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2084 } else {
2085 response = ListResolversResponse{}
2086 }
2087 }
2088 return
2089 }
2090 if convertedResponse, ok := ociResponse.(ListResolversResponse); ok {
2091 response = convertedResponse
2092 } else {
2093 err = fmt.Errorf("failed to convert OCIResponse into ListResolversResponse")
2094 }
2095 return
2096 }
2097
2098 // listResolvers implements the OCIOperation interface (enables retrying operations)
2099 func (client DnsClient) listResolvers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2100
2101 httpRequest, err := request.HTTPRequest(http.MethodGet, "/resolvers", binaryReqBody, extraHeaders)
2102 if err != nil {
2103 return nil, err
2104 }
2105
2106 var response ListResolversResponse
2107 var httpResponse *http.Response
2108 httpResponse, err = client.Call(ctx, &httpRequest)
2109 defer common.CloseBodyIfValid(httpResponse)
2110 response.RawResponse = httpResponse
2111 if err != nil {
2112 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Resolver/ListResolvers"
2113 err = common.PostProcessServiceError(err, "Dns", "ListResolvers", apiReferenceLink)
2114 return response, err
2115 }
2116
2117 err = common.UnmarshalResponse(httpResponse, &response)
2118 return response, err
2119 }
2120
2121 // ListSteeringPolicies Gets a list of all steering policies in the specified compartment.
2122 //
2123 // # See also
2124 //
2125 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListSteeringPolicies.go.html to see an example of how to use ListSteeringPolicies API.
2126 // A default retry strategy applies to this operation ListSteeringPolicies()
2127 func (client DnsClient) ListSteeringPolicies(ctx context.Context, request ListSteeringPoliciesRequest) (response ListSteeringPoliciesResponse, err error) {
2128 var ociResponse common.OCIResponse
2129 policy := common.DefaultRetryPolicy()
2130 if client.RetryPolicy() != nil {
2131 policy = *client.RetryPolicy()
2132 }
2133 if request.RetryPolicy() != nil {
2134 policy = *request.RetryPolicy()
2135 }
2136 ociResponse, err = common.Retry(ctx, request, client.listSteeringPolicies, policy)
2137 if err != nil {
2138 if ociResponse != nil {
2139 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2140 opcRequestId := httpResponse.Header.Get("opc-request-id")
2141 response = ListSteeringPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2142 } else {
2143 response = ListSteeringPoliciesResponse{}
2144 }
2145 }
2146 return
2147 }
2148 if convertedResponse, ok := ociResponse.(ListSteeringPoliciesResponse); ok {
2149 response = convertedResponse
2150 } else {
2151 err = fmt.Errorf("failed to convert OCIResponse into ListSteeringPoliciesResponse")
2152 }
2153 return
2154 }
2155
2156 // listSteeringPolicies implements the OCIOperation interface (enables retrying operations)
2157 func (client DnsClient) listSteeringPolicies(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2158
2159 httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicies", binaryReqBody, extraHeaders)
2160 if err != nil {
2161 return nil, err
2162 }
2163
2164 var response ListSteeringPoliciesResponse
2165 var httpResponse *http.Response
2166 httpResponse, err = client.Call(ctx, &httpRequest)
2167 defer common.CloseBodyIfValid(httpResponse)
2168 response.RawResponse = httpResponse
2169 if err != nil {
2170 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicy/ListSteeringPolicies"
2171 err = common.PostProcessServiceError(err, "Dns", "ListSteeringPolicies", apiReferenceLink)
2172 return response, err
2173 }
2174
2175 err = common.UnmarshalResponse(httpResponse, &response)
2176 return response, err
2177 }
2178
2179 // ListSteeringPolicyAttachments Lists the steering policy attachments in the specified compartment.
2180 //
2181 // # See also
2182 //
2183 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListSteeringPolicyAttachments.go.html to see an example of how to use ListSteeringPolicyAttachments API.
2184 // A default retry strategy applies to this operation ListSteeringPolicyAttachments()
2185 func (client DnsClient) ListSteeringPolicyAttachments(ctx context.Context, request ListSteeringPolicyAttachmentsRequest) (response ListSteeringPolicyAttachmentsResponse, err error) {
2186 var ociResponse common.OCIResponse
2187 policy := common.DefaultRetryPolicy()
2188 if client.RetryPolicy() != nil {
2189 policy = *client.RetryPolicy()
2190 }
2191 if request.RetryPolicy() != nil {
2192 policy = *request.RetryPolicy()
2193 }
2194 ociResponse, err = common.Retry(ctx, request, client.listSteeringPolicyAttachments, policy)
2195 if err != nil {
2196 if ociResponse != nil {
2197 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2198 opcRequestId := httpResponse.Header.Get("opc-request-id")
2199 response = ListSteeringPolicyAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2200 } else {
2201 response = ListSteeringPolicyAttachmentsResponse{}
2202 }
2203 }
2204 return
2205 }
2206 if convertedResponse, ok := ociResponse.(ListSteeringPolicyAttachmentsResponse); ok {
2207 response = convertedResponse
2208 } else {
2209 err = fmt.Errorf("failed to convert OCIResponse into ListSteeringPolicyAttachmentsResponse")
2210 }
2211 return
2212 }
2213
2214 // listSteeringPolicyAttachments implements the OCIOperation interface (enables retrying operations)
2215 func (client DnsClient) listSteeringPolicyAttachments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2216
2217 httpRequest, err := request.HTTPRequest(http.MethodGet, "/steeringPolicyAttachments", binaryReqBody, extraHeaders)
2218 if err != nil {
2219 return nil, err
2220 }
2221
2222 var response ListSteeringPolicyAttachmentsResponse
2223 var httpResponse *http.Response
2224 httpResponse, err = client.Call(ctx, &httpRequest)
2225 defer common.CloseBodyIfValid(httpResponse)
2226 response.RawResponse = httpResponse
2227 if err != nil {
2228 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicyAttachment/ListSteeringPolicyAttachments"
2229 err = common.PostProcessServiceError(err, "Dns", "ListSteeringPolicyAttachments", apiReferenceLink)
2230 return response, err
2231 }
2232
2233 err = common.UnmarshalResponse(httpResponse, &response)
2234 return response, err
2235 }
2236
2237 // ListTsigKeys Gets a list of all TSIG keys in the specified compartment.
2238 //
2239 // # See also
2240 //
2241 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListTsigKeys.go.html to see an example of how to use ListTsigKeys API.
2242 // A default retry strategy applies to this operation ListTsigKeys()
2243 func (client DnsClient) ListTsigKeys(ctx context.Context, request ListTsigKeysRequest) (response ListTsigKeysResponse, err error) {
2244 var ociResponse common.OCIResponse
2245 policy := common.DefaultRetryPolicy()
2246 if client.RetryPolicy() != nil {
2247 policy = *client.RetryPolicy()
2248 }
2249 if request.RetryPolicy() != nil {
2250 policy = *request.RetryPolicy()
2251 }
2252 ociResponse, err = common.Retry(ctx, request, client.listTsigKeys, policy)
2253 if err != nil {
2254 if ociResponse != nil {
2255 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2256 opcRequestId := httpResponse.Header.Get("opc-request-id")
2257 response = ListTsigKeysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2258 } else {
2259 response = ListTsigKeysResponse{}
2260 }
2261 }
2262 return
2263 }
2264 if convertedResponse, ok := ociResponse.(ListTsigKeysResponse); ok {
2265 response = convertedResponse
2266 } else {
2267 err = fmt.Errorf("failed to convert OCIResponse into ListTsigKeysResponse")
2268 }
2269 return
2270 }
2271
2272 // listTsigKeys implements the OCIOperation interface (enables retrying operations)
2273 func (client DnsClient) listTsigKeys(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2274
2275 httpRequest, err := request.HTTPRequest(http.MethodGet, "/tsigKeys", binaryReqBody, extraHeaders)
2276 if err != nil {
2277 return nil, err
2278 }
2279
2280 var response ListTsigKeysResponse
2281 var httpResponse *http.Response
2282 httpResponse, err = client.Call(ctx, &httpRequest)
2283 defer common.CloseBodyIfValid(httpResponse)
2284 response.RawResponse = httpResponse
2285 if err != nil {
2286 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/TsigKey/ListTsigKeys"
2287 err = common.PostProcessServiceError(err, "Dns", "ListTsigKeys", apiReferenceLink)
2288 return response, err
2289 }
2290
2291 err = common.UnmarshalResponse(httpResponse, &response)
2292 return response, err
2293 }
2294
2295 // ListViews Gets a list of all views within a compartment.
2296 // The collection can be filtered by display name, id, or lifecycle state. It can be sorted
2297 // on creation time or displayName both in ASC or DESC order. Note that when no lifecycleState
2298 // query parameter is provided, the collection does not include views in the DELETED
2299 // lifecycleState to be consistent with other operations of the API.
2300 //
2301 // # See also
2302 //
2303 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListViews.go.html to see an example of how to use ListViews API.
2304 // A default retry strategy applies to this operation ListViews()
2305 func (client DnsClient) ListViews(ctx context.Context, request ListViewsRequest) (response ListViewsResponse, err error) {
2306 var ociResponse common.OCIResponse
2307 policy := common.DefaultRetryPolicy()
2308 if client.RetryPolicy() != nil {
2309 policy = *client.RetryPolicy()
2310 }
2311 if request.RetryPolicy() != nil {
2312 policy = *request.RetryPolicy()
2313 }
2314 ociResponse, err = common.Retry(ctx, request, client.listViews, policy)
2315 if err != nil {
2316 if ociResponse != nil {
2317 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2318 opcRequestId := httpResponse.Header.Get("opc-request-id")
2319 response = ListViewsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2320 } else {
2321 response = ListViewsResponse{}
2322 }
2323 }
2324 return
2325 }
2326 if convertedResponse, ok := ociResponse.(ListViewsResponse); ok {
2327 response = convertedResponse
2328 } else {
2329 err = fmt.Errorf("failed to convert OCIResponse into ListViewsResponse")
2330 }
2331 return
2332 }
2333
2334 // listViews implements the OCIOperation interface (enables retrying operations)
2335 func (client DnsClient) listViews(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2336
2337 httpRequest, err := request.HTTPRequest(http.MethodGet, "/views", binaryReqBody, extraHeaders)
2338 if err != nil {
2339 return nil, err
2340 }
2341
2342 var response ListViewsResponse
2343 var httpResponse *http.Response
2344 httpResponse, err = client.Call(ctx, &httpRequest)
2345 defer common.CloseBodyIfValid(httpResponse)
2346 response.RawResponse = httpResponse
2347 if err != nil {
2348 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/View/ListViews"
2349 err = common.PostProcessServiceError(err, "Dns", "ListViews", apiReferenceLink)
2350 return response, err
2351 }
2352
2353 err = common.UnmarshalResponse(httpResponse, &response)
2354 return response, err
2355 }
2356
2357 // ListZoneTransferServers Gets a list of IP addresses of OCI nameservers for inbound and outbound transfer of zones in the specified
2358 // compartment (which must be the root compartment of a tenancy) that transfer zone data with external master or
2359 // downstream nameservers.
2360 //
2361 // # See also
2362 //
2363 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListZoneTransferServers.go.html to see an example of how to use ListZoneTransferServers API.
2364 // A default retry strategy applies to this operation ListZoneTransferServers()
2365 func (client DnsClient) ListZoneTransferServers(ctx context.Context, request ListZoneTransferServersRequest) (response ListZoneTransferServersResponse, err error) {
2366 var ociResponse common.OCIResponse
2367 policy := common.DefaultRetryPolicy()
2368 if client.RetryPolicy() != nil {
2369 policy = *client.RetryPolicy()
2370 }
2371 if request.RetryPolicy() != nil {
2372 policy = *request.RetryPolicy()
2373 }
2374 ociResponse, err = common.Retry(ctx, request, client.listZoneTransferServers, policy)
2375 if err != nil {
2376 if ociResponse != nil {
2377 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2378 opcRequestId := httpResponse.Header.Get("opc-request-id")
2379 response = ListZoneTransferServersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2380 } else {
2381 response = ListZoneTransferServersResponse{}
2382 }
2383 }
2384 return
2385 }
2386 if convertedResponse, ok := ociResponse.(ListZoneTransferServersResponse); ok {
2387 response = convertedResponse
2388 } else {
2389 err = fmt.Errorf("failed to convert OCIResponse into ListZoneTransferServersResponse")
2390 }
2391 return
2392 }
2393
2394 // listZoneTransferServers implements the OCIOperation interface (enables retrying operations)
2395 func (client DnsClient) listZoneTransferServers(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2396
2397 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zoneTransferServers", binaryReqBody, extraHeaders)
2398 if err != nil {
2399 return nil, err
2400 }
2401
2402 var response ListZoneTransferServersResponse
2403 var httpResponse *http.Response
2404 httpResponse, err = client.Call(ctx, &httpRequest)
2405 defer common.CloseBodyIfValid(httpResponse)
2406 response.RawResponse = httpResponse
2407 if err != nil {
2408 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/ZoneTransferServer/ListZoneTransferServers"
2409 err = common.PostProcessServiceError(err, "Dns", "ListZoneTransferServers", apiReferenceLink)
2410 return response, err
2411 }
2412
2413 err = common.UnmarshalResponse(httpResponse, &response)
2414 return response, err
2415 }
2416
2417 // ListZones Gets a list of all zones in the specified compartment.
2418 // The collection can be filtered by name, time created, scope, associated view, and zone type.
2419 // Filtering by view is only supported for private zones.
2420 //
2421 // # See also
2422 //
2423 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/ListZones.go.html to see an example of how to use ListZones API.
2424 // A default retry strategy applies to this operation ListZones()
2425 func (client DnsClient) ListZones(ctx context.Context, request ListZonesRequest) (response ListZonesResponse, err error) {
2426 var ociResponse common.OCIResponse
2427 policy := common.DefaultRetryPolicy()
2428 if client.RetryPolicy() != nil {
2429 policy = *client.RetryPolicy()
2430 }
2431 if request.RetryPolicy() != nil {
2432 policy = *request.RetryPolicy()
2433 }
2434 ociResponse, err = common.Retry(ctx, request, client.listZones, policy)
2435 if err != nil {
2436 if ociResponse != nil {
2437 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2438 opcRequestId := httpResponse.Header.Get("opc-request-id")
2439 response = ListZonesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2440 } else {
2441 response = ListZonesResponse{}
2442 }
2443 }
2444 return
2445 }
2446 if convertedResponse, ok := ociResponse.(ListZonesResponse); ok {
2447 response = convertedResponse
2448 } else {
2449 err = fmt.Errorf("failed to convert OCIResponse into ListZonesResponse")
2450 }
2451 return
2452 }
2453
2454 // listZones implements the OCIOperation interface (enables retrying operations)
2455 func (client DnsClient) listZones(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2456
2457 httpRequest, err := request.HTTPRequest(http.MethodGet, "/zones", binaryReqBody, extraHeaders)
2458 if err != nil {
2459 return nil, err
2460 }
2461
2462 var response ListZonesResponse
2463 var httpResponse *http.Response
2464 httpResponse, err = client.Call(ctx, &httpRequest)
2465 defer common.CloseBodyIfValid(httpResponse)
2466 response.RawResponse = httpResponse
2467 if err != nil {
2468 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/ListZones"
2469 err = common.PostProcessServiceError(err, "Dns", "ListZones", apiReferenceLink)
2470 return response, err
2471 }
2472
2473 err = common.UnmarshalResponse(httpResponse, &response)
2474 return response, err
2475 }
2476
2477 // PatchDomainRecords Updates records in the specified zone at a domain.
2478 // You can update one record or all records for the specified zone depending on the changes provided in the
2479 // request body. You can also add or remove records using this function. When the zone name is provided as
2480 // a path parameter and `PRIVATE` is used for the scope query parameter then the viewId query parameter is
2481 // required.
2482 //
2483 // # See also
2484 //
2485 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/PatchDomainRecords.go.html to see an example of how to use PatchDomainRecords API.
2486 // A default retry strategy applies to this operation PatchDomainRecords()
2487 func (client DnsClient) PatchDomainRecords(ctx context.Context, request PatchDomainRecordsRequest) (response PatchDomainRecordsResponse, err error) {
2488 var ociResponse common.OCIResponse
2489 policy := common.DefaultRetryPolicy()
2490 if client.RetryPolicy() != nil {
2491 policy = *client.RetryPolicy()
2492 }
2493 if request.RetryPolicy() != nil {
2494 policy = *request.RetryPolicy()
2495 }
2496 ociResponse, err = common.Retry(ctx, request, client.patchDomainRecords, policy)
2497 if err != nil {
2498 if ociResponse != nil {
2499 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2500 opcRequestId := httpResponse.Header.Get("opc-request-id")
2501 response = PatchDomainRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2502 } else {
2503 response = PatchDomainRecordsResponse{}
2504 }
2505 }
2506 return
2507 }
2508 if convertedResponse, ok := ociResponse.(PatchDomainRecordsResponse); ok {
2509 response = convertedResponse
2510 } else {
2511 err = fmt.Errorf("failed to convert OCIResponse into PatchDomainRecordsResponse")
2512 }
2513 return
2514 }
2515
2516 // patchDomainRecords implements the OCIOperation interface (enables retrying operations)
2517 func (client DnsClient) patchDomainRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2518
2519 httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}", binaryReqBody, extraHeaders)
2520 if err != nil {
2521 return nil, err
2522 }
2523
2524 var response PatchDomainRecordsResponse
2525 var httpResponse *http.Response
2526 httpResponse, err = client.Call(ctx, &httpRequest)
2527 defer common.CloseBodyIfValid(httpResponse)
2528 response.RawResponse = httpResponse
2529 if err != nil {
2530 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/PatchDomainRecords"
2531 err = common.PostProcessServiceError(err, "Dns", "PatchDomainRecords", apiReferenceLink)
2532 return response, err
2533 }
2534
2535 err = common.UnmarshalResponse(httpResponse, &response)
2536 return response, err
2537 }
2538
2539 // PatchRRSet Updates records in the specified RRSet.
2540 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query
2541 // parameter then the viewId query parameter is required.
2542 //
2543 // # See also
2544 //
2545 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/PatchRRSet.go.html to see an example of how to use PatchRRSet API.
2546 // A default retry strategy applies to this operation PatchRRSet()
2547 func (client DnsClient) PatchRRSet(ctx context.Context, request PatchRRSetRequest) (response PatchRRSetResponse, err error) {
2548 var ociResponse common.OCIResponse
2549 policy := common.DefaultRetryPolicy()
2550 if client.RetryPolicy() != nil {
2551 policy = *client.RetryPolicy()
2552 }
2553 if request.RetryPolicy() != nil {
2554 policy = *request.RetryPolicy()
2555 }
2556 ociResponse, err = common.Retry(ctx, request, client.patchRRSet, policy)
2557 if err != nil {
2558 if ociResponse != nil {
2559 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2560 opcRequestId := httpResponse.Header.Get("opc-request-id")
2561 response = PatchRRSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2562 } else {
2563 response = PatchRRSetResponse{}
2564 }
2565 }
2566 return
2567 }
2568 if convertedResponse, ok := ociResponse.(PatchRRSetResponse); ok {
2569 response = convertedResponse
2570 } else {
2571 err = fmt.Errorf("failed to convert OCIResponse into PatchRRSetResponse")
2572 }
2573 return
2574 }
2575
2576 // patchRRSet implements the OCIOperation interface (enables retrying operations)
2577 func (client DnsClient) patchRRSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2578
2579 httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", binaryReqBody, extraHeaders)
2580 if err != nil {
2581 return nil, err
2582 }
2583
2584 var response PatchRRSetResponse
2585 var httpResponse *http.Response
2586 httpResponse, err = client.Call(ctx, &httpRequest)
2587 defer common.CloseBodyIfValid(httpResponse)
2588 response.RawResponse = httpResponse
2589 if err != nil {
2590 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/RRSet/PatchRRSet"
2591 err = common.PostProcessServiceError(err, "Dns", "PatchRRSet", apiReferenceLink)
2592 return response, err
2593 }
2594
2595 err = common.UnmarshalResponse(httpResponse, &response)
2596 return response, err
2597 }
2598
2599 // PatchZoneRecords Updates a collection of records in the specified zone.
2600 // You can update one record or all records for the specified zone depending on the changes provided in the
2601 // request body. You can also add or remove records using this function. When the zone name is provided as
2602 // a path parameter and `PRIVATE` is used for the scope query parameter then the viewId query parameter is
2603 // required.
2604 //
2605 // # See also
2606 //
2607 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/PatchZoneRecords.go.html to see an example of how to use PatchZoneRecords API.
2608 // A default retry strategy applies to this operation PatchZoneRecords()
2609 func (client DnsClient) PatchZoneRecords(ctx context.Context, request PatchZoneRecordsRequest) (response PatchZoneRecordsResponse, err error) {
2610 var ociResponse common.OCIResponse
2611 policy := common.DefaultRetryPolicy()
2612 if client.RetryPolicy() != nil {
2613 policy = *client.RetryPolicy()
2614 }
2615 if request.RetryPolicy() != nil {
2616 policy = *request.RetryPolicy()
2617 }
2618 ociResponse, err = common.Retry(ctx, request, client.patchZoneRecords, policy)
2619 if err != nil {
2620 if ociResponse != nil {
2621 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2622 opcRequestId := httpResponse.Header.Get("opc-request-id")
2623 response = PatchZoneRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2624 } else {
2625 response = PatchZoneRecordsResponse{}
2626 }
2627 }
2628 return
2629 }
2630 if convertedResponse, ok := ociResponse.(PatchZoneRecordsResponse); ok {
2631 response = convertedResponse
2632 } else {
2633 err = fmt.Errorf("failed to convert OCIResponse into PatchZoneRecordsResponse")
2634 }
2635 return
2636 }
2637
2638 // patchZoneRecords implements the OCIOperation interface (enables retrying operations)
2639 func (client DnsClient) patchZoneRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2640
2641 httpRequest, err := request.HTTPRequest(http.MethodPatch, "/zones/{zoneNameOrId}/records", binaryReqBody, extraHeaders)
2642 if err != nil {
2643 return nil, err
2644 }
2645
2646 var response PatchZoneRecordsResponse
2647 var httpResponse *http.Response
2648 httpResponse, err = client.Call(ctx, &httpRequest)
2649 defer common.CloseBodyIfValid(httpResponse)
2650 response.RawResponse = httpResponse
2651 if err != nil {
2652 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/PatchZoneRecords"
2653 err = common.PostProcessServiceError(err, "Dns", "PatchZoneRecords", apiReferenceLink)
2654 return response, err
2655 }
2656
2657 err = common.UnmarshalResponse(httpResponse, &response)
2658 return response, err
2659 }
2660
2661 // PromoteZoneDnssecKeyVersion Promotes a specified `DnssecKeyVersion` on the zone.
2662 // If the `DnssecKeyVersion` identified in the request body is a key signing key (KSK) that is replacing
2663 // another `DnssecKeyVersion`, then the old `DnssecKeyVersion` is scheduled for removal from the zone.
2664 // For key signing keys (KSKs), you must create the DS record with the new key information **before** promoting
2665 // the new key to establish a chain of trust. To avoid a service disruption, remove the old DS record as soon
2666 // as its TTL (time to live) expires.
2667 // For more information, see DNSSEC (https://docs.oracle.com/iaas/Content/DNS/Concepts/dnssec.htm).
2668 //
2669 // # See also
2670 //
2671 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/PromoteZoneDnssecKeyVersion.go.html to see an example of how to use PromoteZoneDnssecKeyVersion API.
2672 // A default retry strategy applies to this operation PromoteZoneDnssecKeyVersion()
2673 func (client DnsClient) PromoteZoneDnssecKeyVersion(ctx context.Context, request PromoteZoneDnssecKeyVersionRequest) (response PromoteZoneDnssecKeyVersionResponse, err error) {
2674 var ociResponse common.OCIResponse
2675 policy := common.DefaultRetryPolicy()
2676 if client.RetryPolicy() != nil {
2677 policy = *client.RetryPolicy()
2678 }
2679 if request.RetryPolicy() != nil {
2680 policy = *request.RetryPolicy()
2681 }
2682
2683 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
2684 request.OpcRetryToken = common.String(common.RetryToken())
2685 }
2686
2687 ociResponse, err = common.Retry(ctx, request, client.promoteZoneDnssecKeyVersion, policy)
2688 if err != nil {
2689 if ociResponse != nil {
2690 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2691 opcRequestId := httpResponse.Header.Get("opc-request-id")
2692 response = PromoteZoneDnssecKeyVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2693 } else {
2694 response = PromoteZoneDnssecKeyVersionResponse{}
2695 }
2696 }
2697 return
2698 }
2699 if convertedResponse, ok := ociResponse.(PromoteZoneDnssecKeyVersionResponse); ok {
2700 response = convertedResponse
2701 } else {
2702 err = fmt.Errorf("failed to convert OCIResponse into PromoteZoneDnssecKeyVersionResponse")
2703 }
2704 return
2705 }
2706
2707 // promoteZoneDnssecKeyVersion implements the OCIOperation interface (enables retrying operations)
2708 func (client DnsClient) promoteZoneDnssecKeyVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2709
2710 httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones/{zoneId}/actions/promoteDnssecKeyVersion", binaryReqBody, extraHeaders)
2711 if err != nil {
2712 return nil, err
2713 }
2714
2715 var response PromoteZoneDnssecKeyVersionResponse
2716 var httpResponse *http.Response
2717 httpResponse, err = client.Call(ctx, &httpRequest)
2718 defer common.CloseBodyIfValid(httpResponse)
2719 response.RawResponse = httpResponse
2720 if err != nil {
2721 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/PromoteZoneDnssecKeyVersion"
2722 err = common.PostProcessServiceError(err, "Dns", "PromoteZoneDnssecKeyVersion", apiReferenceLink)
2723 return response, err
2724 }
2725
2726 err = common.UnmarshalResponse(httpResponse, &response)
2727 return response, err
2728 }
2729
2730 // StageZoneDnssecKeyVersion Stages a new `DnssecKeyVersion` on the zone. Staging is a process that generates a new "successor" key version
2731 // that replaces an existing "predecessor" key version.
2732 // **Note:** A new key-signing key (KSK) version is inert until you update the parent zone DS records.
2733 // For more information, see the DNSSEC (https://docs.oracle.com/iaas/Content/DNS/Concepts/dnssec.htm) documentation.
2734 //
2735 // # See also
2736 //
2737 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/StageZoneDnssecKeyVersion.go.html to see an example of how to use StageZoneDnssecKeyVersion API.
2738 // A default retry strategy applies to this operation StageZoneDnssecKeyVersion()
2739 func (client DnsClient) StageZoneDnssecKeyVersion(ctx context.Context, request StageZoneDnssecKeyVersionRequest) (response StageZoneDnssecKeyVersionResponse, err error) {
2740 var ociResponse common.OCIResponse
2741 policy := common.DefaultRetryPolicy()
2742 if client.RetryPolicy() != nil {
2743 policy = *client.RetryPolicy()
2744 }
2745 if request.RetryPolicy() != nil {
2746 policy = *request.RetryPolicy()
2747 }
2748
2749 if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
2750 request.OpcRetryToken = common.String(common.RetryToken())
2751 }
2752
2753 ociResponse, err = common.Retry(ctx, request, client.stageZoneDnssecKeyVersion, policy)
2754 if err != nil {
2755 if ociResponse != nil {
2756 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2757 opcRequestId := httpResponse.Header.Get("opc-request-id")
2758 response = StageZoneDnssecKeyVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2759 } else {
2760 response = StageZoneDnssecKeyVersionResponse{}
2761 }
2762 }
2763 return
2764 }
2765 if convertedResponse, ok := ociResponse.(StageZoneDnssecKeyVersionResponse); ok {
2766 response = convertedResponse
2767 } else {
2768 err = fmt.Errorf("failed to convert OCIResponse into StageZoneDnssecKeyVersionResponse")
2769 }
2770 return
2771 }
2772
2773 // stageZoneDnssecKeyVersion implements the OCIOperation interface (enables retrying operations)
2774 func (client DnsClient) stageZoneDnssecKeyVersion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2775
2776 httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones/{zoneId}/actions/stageDnssecKeyVersion", binaryReqBody, extraHeaders)
2777 if err != nil {
2778 return nil, err
2779 }
2780
2781 var response StageZoneDnssecKeyVersionResponse
2782 var httpResponse *http.Response
2783 httpResponse, err = client.Call(ctx, &httpRequest)
2784 defer common.CloseBodyIfValid(httpResponse)
2785 response.RawResponse = httpResponse
2786 if err != nil {
2787 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/StageZoneDnssecKeyVersion"
2788 err = common.PostProcessServiceError(err, "Dns", "StageZoneDnssecKeyVersion", apiReferenceLink)
2789 return response, err
2790 }
2791
2792 err = common.UnmarshalResponse(httpResponse, &response)
2793 return response, err
2794 }
2795
2796 // UpdateDomainRecords Replaces records in the specified zone at a domain with the records specified in the request body.
2797 // If a specified record does not exist, it will be created. If the record exists, then it will be updated to
2798 // represent the record in the body of the request. If a record in the zone does not exist in the request body,
2799 // the record will be removed from the zone. When the zone name is provided as a path parameter and `PRIVATE`
2800 // is used for the scope query parameter then the viewId query parameter is required.
2801 //
2802 // # See also
2803 //
2804 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateDomainRecords.go.html to see an example of how to use UpdateDomainRecords API.
2805 // A default retry strategy applies to this operation UpdateDomainRecords()
2806 func (client DnsClient) UpdateDomainRecords(ctx context.Context, request UpdateDomainRecordsRequest) (response UpdateDomainRecordsResponse, err error) {
2807 var ociResponse common.OCIResponse
2808 policy := common.DefaultRetryPolicy()
2809 if client.RetryPolicy() != nil {
2810 policy = *client.RetryPolicy()
2811 }
2812 if request.RetryPolicy() != nil {
2813 policy = *request.RetryPolicy()
2814 }
2815 ociResponse, err = common.Retry(ctx, request, client.updateDomainRecords, policy)
2816 if err != nil {
2817 if ociResponse != nil {
2818 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2819 opcRequestId := httpResponse.Header.Get("opc-request-id")
2820 response = UpdateDomainRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2821 } else {
2822 response = UpdateDomainRecordsResponse{}
2823 }
2824 }
2825 return
2826 }
2827 if convertedResponse, ok := ociResponse.(UpdateDomainRecordsResponse); ok {
2828 response = convertedResponse
2829 } else {
2830 err = fmt.Errorf("failed to convert OCIResponse into UpdateDomainRecordsResponse")
2831 }
2832 return
2833 }
2834
2835 // updateDomainRecords implements the OCIOperation interface (enables retrying operations)
2836 func (client DnsClient) updateDomainRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2837
2838 httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}", binaryReqBody, extraHeaders)
2839 if err != nil {
2840 return nil, err
2841 }
2842
2843 var response UpdateDomainRecordsResponse
2844 var httpResponse *http.Response
2845 httpResponse, err = client.Call(ctx, &httpRequest)
2846 defer common.CloseBodyIfValid(httpResponse)
2847 response.RawResponse = httpResponse
2848 if err != nil {
2849 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/UpdateDomainRecords"
2850 err = common.PostProcessServiceError(err, "Dns", "UpdateDomainRecords", apiReferenceLink)
2851 return response, err
2852 }
2853
2854 err = common.UnmarshalResponse(httpResponse, &response)
2855 return response, err
2856 }
2857
2858 // UpdateRRSet Replaces records in the specified RRSet.
2859 // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope
2860 // query parameter then the viewId query parameter is required.
2861 //
2862 // # See also
2863 //
2864 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateRRSet.go.html to see an example of how to use UpdateRRSet API.
2865 // A default retry strategy applies to this operation UpdateRRSet()
2866 func (client DnsClient) UpdateRRSet(ctx context.Context, request UpdateRRSetRequest) (response UpdateRRSetResponse, err error) {
2867 var ociResponse common.OCIResponse
2868 policy := common.DefaultRetryPolicy()
2869 if client.RetryPolicy() != nil {
2870 policy = *client.RetryPolicy()
2871 }
2872 if request.RetryPolicy() != nil {
2873 policy = *request.RetryPolicy()
2874 }
2875 ociResponse, err = common.Retry(ctx, request, client.updateRRSet, policy)
2876 if err != nil {
2877 if ociResponse != nil {
2878 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2879 opcRequestId := httpResponse.Header.Get("opc-request-id")
2880 response = UpdateRRSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2881 } else {
2882 response = UpdateRRSetResponse{}
2883 }
2884 }
2885 return
2886 }
2887 if convertedResponse, ok := ociResponse.(UpdateRRSetResponse); ok {
2888 response = convertedResponse
2889 } else {
2890 err = fmt.Errorf("failed to convert OCIResponse into UpdateRRSetResponse")
2891 }
2892 return
2893 }
2894
2895 // updateRRSet implements the OCIOperation interface (enables retrying operations)
2896 func (client DnsClient) updateRRSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2897
2898 httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records/{domain}/{rtype}", binaryReqBody, extraHeaders)
2899 if err != nil {
2900 return nil, err
2901 }
2902
2903 var response UpdateRRSetResponse
2904 var httpResponse *http.Response
2905 httpResponse, err = client.Call(ctx, &httpRequest)
2906 defer common.CloseBodyIfValid(httpResponse)
2907 response.RawResponse = httpResponse
2908 if err != nil {
2909 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/RRSet/UpdateRRSet"
2910 err = common.PostProcessServiceError(err, "Dns", "UpdateRRSet", apiReferenceLink)
2911 return response, err
2912 }
2913
2914 err = common.UnmarshalResponse(httpResponse, &response)
2915 return response, err
2916 }
2917
2918 // UpdateResolver Updates the specified resolver with your new information.
2919 //
2920 // # See also
2921 //
2922 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateResolver.go.html to see an example of how to use UpdateResolver API.
2923 // A default retry strategy applies to this operation UpdateResolver()
2924 func (client DnsClient) UpdateResolver(ctx context.Context, request UpdateResolverRequest) (response UpdateResolverResponse, err error) {
2925 var ociResponse common.OCIResponse
2926 policy := common.DefaultRetryPolicy()
2927 if client.RetryPolicy() != nil {
2928 policy = *client.RetryPolicy()
2929 }
2930 if request.RetryPolicy() != nil {
2931 policy = *request.RetryPolicy()
2932 }
2933 ociResponse, err = common.Retry(ctx, request, client.updateResolver, policy)
2934 if err != nil {
2935 if ociResponse != nil {
2936 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2937 opcRequestId := httpResponse.Header.Get("opc-request-id")
2938 response = UpdateResolverResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2939 } else {
2940 response = UpdateResolverResponse{}
2941 }
2942 }
2943 return
2944 }
2945 if convertedResponse, ok := ociResponse.(UpdateResolverResponse); ok {
2946 response = convertedResponse
2947 } else {
2948 err = fmt.Errorf("failed to convert OCIResponse into UpdateResolverResponse")
2949 }
2950 return
2951 }
2952
2953 // updateResolver implements the OCIOperation interface (enables retrying operations)
2954 func (client DnsClient) updateResolver(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
2955
2956 httpRequest, err := request.HTTPRequest(http.MethodPut, "/resolvers/{resolverId}", binaryReqBody, extraHeaders)
2957 if err != nil {
2958 return nil, err
2959 }
2960
2961 var response UpdateResolverResponse
2962 var httpResponse *http.Response
2963 httpResponse, err = client.Call(ctx, &httpRequest)
2964 defer common.CloseBodyIfValid(httpResponse)
2965 response.RawResponse = httpResponse
2966 if err != nil {
2967 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Resolver/UpdateResolver"
2968 err = common.PostProcessServiceError(err, "Dns", "UpdateResolver", apiReferenceLink)
2969 return response, err
2970 }
2971
2972 err = common.UnmarshalResponse(httpResponse, &response)
2973 return response, err
2974 }
2975
2976 // UpdateResolverEndpoint Updates the specified resolver endpoint with your new information.
2977 //
2978 // # See also
2979 //
2980 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateResolverEndpoint.go.html to see an example of how to use UpdateResolverEndpoint API.
2981 // A default retry strategy applies to this operation UpdateResolverEndpoint()
2982 func (client DnsClient) UpdateResolverEndpoint(ctx context.Context, request UpdateResolverEndpointRequest) (response UpdateResolverEndpointResponse, err error) {
2983 var ociResponse common.OCIResponse
2984 policy := common.DefaultRetryPolicy()
2985 if client.RetryPolicy() != nil {
2986 policy = *client.RetryPolicy()
2987 }
2988 if request.RetryPolicy() != nil {
2989 policy = *request.RetryPolicy()
2990 }
2991 ociResponse, err = common.Retry(ctx, request, client.updateResolverEndpoint, policy)
2992 if err != nil {
2993 if ociResponse != nil {
2994 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
2995 opcRequestId := httpResponse.Header.Get("opc-request-id")
2996 response = UpdateResolverEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
2997 } else {
2998 response = UpdateResolverEndpointResponse{}
2999 }
3000 }
3001 return
3002 }
3003 if convertedResponse, ok := ociResponse.(UpdateResolverEndpointResponse); ok {
3004 response = convertedResponse
3005 } else {
3006 err = fmt.Errorf("failed to convert OCIResponse into UpdateResolverEndpointResponse")
3007 }
3008 return
3009 }
3010
3011 // updateResolverEndpoint implements the OCIOperation interface (enables retrying operations)
3012 func (client DnsClient) updateResolverEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3013
3014 httpRequest, err := request.HTTPRequest(http.MethodPut, "/resolvers/{resolverId}/endpoints/{resolverEndpointName}", binaryReqBody, extraHeaders)
3015 if err != nil {
3016 return nil, err
3017 }
3018
3019 var response UpdateResolverEndpointResponse
3020 var httpResponse *http.Response
3021 httpResponse, err = client.Call(ctx, &httpRequest)
3022 defer common.CloseBodyIfValid(httpResponse)
3023 response.RawResponse = httpResponse
3024 if err != nil {
3025 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/ResolverEndpoint/UpdateResolverEndpoint"
3026 err = common.PostProcessServiceError(err, "Dns", "UpdateResolverEndpoint", apiReferenceLink)
3027 return response, err
3028 }
3029
3030 err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &resolverendpoint{})
3031 return response, err
3032 }
3033
3034 // UpdateSteeringPolicy Updates the configuration of the specified steering policy.
3035 //
3036 // # See also
3037 //
3038 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateSteeringPolicy.go.html to see an example of how to use UpdateSteeringPolicy API.
3039 // A default retry strategy applies to this operation UpdateSteeringPolicy()
3040 func (client DnsClient) UpdateSteeringPolicy(ctx context.Context, request UpdateSteeringPolicyRequest) (response UpdateSteeringPolicyResponse, err error) {
3041 var ociResponse common.OCIResponse
3042 policy := common.DefaultRetryPolicy()
3043 if client.RetryPolicy() != nil {
3044 policy = *client.RetryPolicy()
3045 }
3046 if request.RetryPolicy() != nil {
3047 policy = *request.RetryPolicy()
3048 }
3049 ociResponse, err = common.Retry(ctx, request, client.updateSteeringPolicy, policy)
3050 if err != nil {
3051 if ociResponse != nil {
3052 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3053 opcRequestId := httpResponse.Header.Get("opc-request-id")
3054 response = UpdateSteeringPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3055 } else {
3056 response = UpdateSteeringPolicyResponse{}
3057 }
3058 }
3059 return
3060 }
3061 if convertedResponse, ok := ociResponse.(UpdateSteeringPolicyResponse); ok {
3062 response = convertedResponse
3063 } else {
3064 err = fmt.Errorf("failed to convert OCIResponse into UpdateSteeringPolicyResponse")
3065 }
3066 return
3067 }
3068
3069 // updateSteeringPolicy implements the OCIOperation interface (enables retrying operations)
3070 func (client DnsClient) updateSteeringPolicy(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3071
3072 httpRequest, err := request.HTTPRequest(http.MethodPut, "/steeringPolicies/{steeringPolicyId}", binaryReqBody, extraHeaders)
3073 if err != nil {
3074 return nil, err
3075 }
3076
3077 var response UpdateSteeringPolicyResponse
3078 var httpResponse *http.Response
3079 httpResponse, err = client.Call(ctx, &httpRequest)
3080 defer common.CloseBodyIfValid(httpResponse)
3081 response.RawResponse = httpResponse
3082 if err != nil {
3083 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicy/UpdateSteeringPolicy"
3084 err = common.PostProcessServiceError(err, "Dns", "UpdateSteeringPolicy", apiReferenceLink)
3085 return response, err
3086 }
3087
3088 err = common.UnmarshalResponse(httpResponse, &response)
3089 return response, err
3090 }
3091
3092 // UpdateSteeringPolicyAttachment Updates the specified steering policy attachment with your new information.
3093 //
3094 // # See also
3095 //
3096 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateSteeringPolicyAttachment.go.html to see an example of how to use UpdateSteeringPolicyAttachment API.
3097 // A default retry strategy applies to this operation UpdateSteeringPolicyAttachment()
3098 func (client DnsClient) UpdateSteeringPolicyAttachment(ctx context.Context, request UpdateSteeringPolicyAttachmentRequest) (response UpdateSteeringPolicyAttachmentResponse, err error) {
3099 var ociResponse common.OCIResponse
3100 policy := common.DefaultRetryPolicy()
3101 if client.RetryPolicy() != nil {
3102 policy = *client.RetryPolicy()
3103 }
3104 if request.RetryPolicy() != nil {
3105 policy = *request.RetryPolicy()
3106 }
3107 ociResponse, err = common.Retry(ctx, request, client.updateSteeringPolicyAttachment, policy)
3108 if err != nil {
3109 if ociResponse != nil {
3110 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3111 opcRequestId := httpResponse.Header.Get("opc-request-id")
3112 response = UpdateSteeringPolicyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3113 } else {
3114 response = UpdateSteeringPolicyAttachmentResponse{}
3115 }
3116 }
3117 return
3118 }
3119 if convertedResponse, ok := ociResponse.(UpdateSteeringPolicyAttachmentResponse); ok {
3120 response = convertedResponse
3121 } else {
3122 err = fmt.Errorf("failed to convert OCIResponse into UpdateSteeringPolicyAttachmentResponse")
3123 }
3124 return
3125 }
3126
3127 // updateSteeringPolicyAttachment implements the OCIOperation interface (enables retrying operations)
3128 func (client DnsClient) updateSteeringPolicyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3129
3130 httpRequest, err := request.HTTPRequest(http.MethodPut, "/steeringPolicyAttachments/{steeringPolicyAttachmentId}", binaryReqBody, extraHeaders)
3131 if err != nil {
3132 return nil, err
3133 }
3134
3135 var response UpdateSteeringPolicyAttachmentResponse
3136 var httpResponse *http.Response
3137 httpResponse, err = client.Call(ctx, &httpRequest)
3138 defer common.CloseBodyIfValid(httpResponse)
3139 response.RawResponse = httpResponse
3140 if err != nil {
3141 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/SteeringPolicyAttachment/UpdateSteeringPolicyAttachment"
3142 err = common.PostProcessServiceError(err, "Dns", "UpdateSteeringPolicyAttachment", apiReferenceLink)
3143 return response, err
3144 }
3145
3146 err = common.UnmarshalResponse(httpResponse, &response)
3147 return response, err
3148 }
3149
3150 // UpdateTsigKey Updates the specified TSIG key.
3151 //
3152 // # See also
3153 //
3154 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateTsigKey.go.html to see an example of how to use UpdateTsigKey API.
3155 // A default retry strategy applies to this operation UpdateTsigKey()
3156 func (client DnsClient) UpdateTsigKey(ctx context.Context, request UpdateTsigKeyRequest) (response UpdateTsigKeyResponse, err error) {
3157 var ociResponse common.OCIResponse
3158 policy := common.DefaultRetryPolicy()
3159 if client.RetryPolicy() != nil {
3160 policy = *client.RetryPolicy()
3161 }
3162 if request.RetryPolicy() != nil {
3163 policy = *request.RetryPolicy()
3164 }
3165 ociResponse, err = common.Retry(ctx, request, client.updateTsigKey, policy)
3166 if err != nil {
3167 if ociResponse != nil {
3168 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3169 opcRequestId := httpResponse.Header.Get("opc-request-id")
3170 response = UpdateTsigKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3171 } else {
3172 response = UpdateTsigKeyResponse{}
3173 }
3174 }
3175 return
3176 }
3177 if convertedResponse, ok := ociResponse.(UpdateTsigKeyResponse); ok {
3178 response = convertedResponse
3179 } else {
3180 err = fmt.Errorf("failed to convert OCIResponse into UpdateTsigKeyResponse")
3181 }
3182 return
3183 }
3184
3185 // updateTsigKey implements the OCIOperation interface (enables retrying operations)
3186 func (client DnsClient) updateTsigKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3187
3188 httpRequest, err := request.HTTPRequest(http.MethodPut, "/tsigKeys/{tsigKeyId}", binaryReqBody, extraHeaders)
3189 if err != nil {
3190 return nil, err
3191 }
3192
3193 var response UpdateTsigKeyResponse
3194 var httpResponse *http.Response
3195 httpResponse, err = client.Call(ctx, &httpRequest)
3196 defer common.CloseBodyIfValid(httpResponse)
3197 response.RawResponse = httpResponse
3198 if err != nil {
3199 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/TsigKey/UpdateTsigKey"
3200 err = common.PostProcessServiceError(err, "Dns", "UpdateTsigKey", apiReferenceLink)
3201 return response, err
3202 }
3203
3204 err = common.UnmarshalResponse(httpResponse, &response)
3205 return response, err
3206 }
3207
3208 // UpdateView Updates the specified view with your new information.
3209 //
3210 // # See also
3211 //
3212 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateView.go.html to see an example of how to use UpdateView API.
3213 // A default retry strategy applies to this operation UpdateView()
3214 func (client DnsClient) UpdateView(ctx context.Context, request UpdateViewRequest) (response UpdateViewResponse, err error) {
3215 var ociResponse common.OCIResponse
3216 policy := common.DefaultRetryPolicy()
3217 if client.RetryPolicy() != nil {
3218 policy = *client.RetryPolicy()
3219 }
3220 if request.RetryPolicy() != nil {
3221 policy = *request.RetryPolicy()
3222 }
3223 ociResponse, err = common.Retry(ctx, request, client.updateView, policy)
3224 if err != nil {
3225 if ociResponse != nil {
3226 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3227 opcRequestId := httpResponse.Header.Get("opc-request-id")
3228 response = UpdateViewResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3229 } else {
3230 response = UpdateViewResponse{}
3231 }
3232 }
3233 return
3234 }
3235 if convertedResponse, ok := ociResponse.(UpdateViewResponse); ok {
3236 response = convertedResponse
3237 } else {
3238 err = fmt.Errorf("failed to convert OCIResponse into UpdateViewResponse")
3239 }
3240 return
3241 }
3242
3243 // updateView implements the OCIOperation interface (enables retrying operations)
3244 func (client DnsClient) updateView(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3245
3246 httpRequest, err := request.HTTPRequest(http.MethodPut, "/views/{viewId}", binaryReqBody, extraHeaders)
3247 if err != nil {
3248 return nil, err
3249 }
3250
3251 var response UpdateViewResponse
3252 var httpResponse *http.Response
3253 httpResponse, err = client.Call(ctx, &httpRequest)
3254 defer common.CloseBodyIfValid(httpResponse)
3255 response.RawResponse = httpResponse
3256 if err != nil {
3257 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/View/UpdateView"
3258 err = common.PostProcessServiceError(err, "Dns", "UpdateView", apiReferenceLink)
3259 return response, err
3260 }
3261
3262 err = common.UnmarshalResponse(httpResponse, &response)
3263 return response, err
3264 }
3265
3266 // UpdateZone Updates the zone with the specified information.
3267 // Global secondary zones may have their external masters updated. For more information about secondary
3268 // zones, see Manage DNS Service Zone (https://docs.oracle.com/iaas/Content/DNS/Tasks/managingdnszones.htm). When the zone name
3269 // is provided as a path parameter and `PRIVATE` is used for the scope query parameter then the viewId
3270 // query parameter is required.
3271 //
3272 // # See also
3273 //
3274 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateZone.go.html to see an example of how to use UpdateZone API.
3275 // A default retry strategy applies to this operation UpdateZone()
3276 func (client DnsClient) UpdateZone(ctx context.Context, request UpdateZoneRequest) (response UpdateZoneResponse, err error) {
3277 var ociResponse common.OCIResponse
3278 policy := common.DefaultRetryPolicy()
3279 if client.RetryPolicy() != nil {
3280 policy = *client.RetryPolicy()
3281 }
3282 if request.RetryPolicy() != nil {
3283 policy = *request.RetryPolicy()
3284 }
3285 ociResponse, err = common.Retry(ctx, request, client.updateZone, policy)
3286 if err != nil {
3287 if ociResponse != nil {
3288 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3289 opcRequestId := httpResponse.Header.Get("opc-request-id")
3290 response = UpdateZoneResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3291 } else {
3292 response = UpdateZoneResponse{}
3293 }
3294 }
3295 return
3296 }
3297 if convertedResponse, ok := ociResponse.(UpdateZoneResponse); ok {
3298 response = convertedResponse
3299 } else {
3300 err = fmt.Errorf("failed to convert OCIResponse into UpdateZoneResponse")
3301 }
3302 return
3303 }
3304
3305 // updateZone implements the OCIOperation interface (enables retrying operations)
3306 func (client DnsClient) updateZone(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3307
3308 httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}", binaryReqBody, extraHeaders)
3309 if err != nil {
3310 return nil, err
3311 }
3312
3313 var response UpdateZoneResponse
3314 var httpResponse *http.Response
3315 httpResponse, err = client.Call(ctx, &httpRequest)
3316 defer common.CloseBodyIfValid(httpResponse)
3317 response.RawResponse = httpResponse
3318 if err != nil {
3319 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Zone/UpdateZone"
3320 err = common.PostProcessServiceError(err, "Dns", "UpdateZone", apiReferenceLink)
3321 return response, err
3322 }
3323
3324 err = common.UnmarshalResponse(httpResponse, &response)
3325 return response, err
3326 }
3327
3328 // UpdateZoneRecords Replaces records in the specified zone with the records specified in the request body.
3329 // If a specified record does not exist, it will be created. If the record exists, then it will be updated
3330 // to represent the record in the body of the request. If a record in the zone does not exist in the
3331 // request body, the record will be removed from the zone. When the zone name is provided as a path
3332 // parameter and `PRIVATE` is used for the scope query parameter then the viewId query parameter is
3333 // required.
3334 //
3335 // # See also
3336 //
3337 // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/UpdateZoneRecords.go.html to see an example of how to use UpdateZoneRecords API.
3338 // A default retry strategy applies to this operation UpdateZoneRecords()
3339 func (client DnsClient) UpdateZoneRecords(ctx context.Context, request UpdateZoneRecordsRequest) (response UpdateZoneRecordsResponse, err error) {
3340 var ociResponse common.OCIResponse
3341 policy := common.DefaultRetryPolicy()
3342 if client.RetryPolicy() != nil {
3343 policy = *client.RetryPolicy()
3344 }
3345 if request.RetryPolicy() != nil {
3346 policy = *request.RetryPolicy()
3347 }
3348 ociResponse, err = common.Retry(ctx, request, client.updateZoneRecords, policy)
3349 if err != nil {
3350 if ociResponse != nil {
3351 if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {
3352 opcRequestId := httpResponse.Header.Get("opc-request-id")
3353 response = UpdateZoneRecordsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}
3354 } else {
3355 response = UpdateZoneRecordsResponse{}
3356 }
3357 }
3358 return
3359 }
3360 if convertedResponse, ok := ociResponse.(UpdateZoneRecordsResponse); ok {
3361 response = convertedResponse
3362 } else {
3363 err = fmt.Errorf("failed to convert OCIResponse into UpdateZoneRecordsResponse")
3364 }
3365 return
3366 }
3367
3368 // updateZoneRecords implements the OCIOperation interface (enables retrying operations)
3369 func (client DnsClient) updateZoneRecords(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) {
3370
3371 httpRequest, err := request.HTTPRequest(http.MethodPut, "/zones/{zoneNameOrId}/records", binaryReqBody, extraHeaders)
3372 if err != nil {
3373 return nil, err
3374 }
3375
3376 var response UpdateZoneRecordsResponse
3377 var httpResponse *http.Response
3378 httpResponse, err = client.Call(ctx, &httpRequest)
3379 defer common.CloseBodyIfValid(httpResponse)
3380 response.RawResponse = httpResponse
3381 if err != nil {
3382 apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dns/20180115/Records/UpdateZoneRecords"
3383 err = common.PostProcessServiceError(err, "Dns", "UpdateZoneRecords", apiReferenceLink)
3384 return response, err
3385 }
3386
3387 err = common.UnmarshalResponse(httpResponse, &response)
3388 return response, err
3389 }
3390