|
| 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 | +package goldengate |
| 6 | + |
| 7 | +import ( |
| 8 | + "fmt" |
| 9 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 10 | + "net/http" |
| 11 | + "strings" |
| 12 | +) |
| 13 | + |
| 14 | +// CollectPipelineDiagnosticRequest wrapper for the CollectPipelineDiagnostic operation |
| 15 | +// |
| 16 | +// # See also |
| 17 | +// |
| 18 | +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CollectPipelineDiagnostic.go.html to see an example of how to use CollectPipelineDiagnosticRequest. |
| 19 | +type CollectPipelineDiagnosticRequest struct { |
| 20 | + |
| 21 | + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the pipeline created. |
| 22 | + PipelineId *string `mandatory:"true" contributesTo:"path" name:"pipelineId"` |
| 23 | + |
| 24 | + // Details for collecting the diagnostic. It includes the object storage information where the diagnostic will be uploaded. |
| 25 | + CollectPipelineDiagnosticDetails `contributesTo:"body"` |
| 26 | + |
| 27 | + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the |
| 28 | + // `if-match` parameter to the value of the etag from a previous GET or POST response for that |
| 29 | + // resource. The resource is updated or deleted only if the etag you provide matches the |
| 30 | + // resource's current etag value. |
| 31 | + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` |
| 32 | + |
| 33 | + // The client request ID for tracing. |
| 34 | + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` |
| 35 | + |
| 36 | + // A token that uniquely identifies a request so it can be retried, in case of a timeout or server error, |
| 37 | + // without the risk of executing that same action again. Retry tokens expire after 24 hours but can be |
| 38 | + // invalidated before then due to conflicting operations. For example, if a resource was deleted and purged |
| 39 | + // from the system, then a retry of the original creation request is rejected. |
| 40 | + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` |
| 41 | + |
| 42 | + // Metadata about the request. This information will not be transmitted to the service, but |
| 43 | + // represents information that the SDK will consume to drive retry behavior. |
| 44 | + RequestMetadata common.RequestMetadata |
| 45 | +} |
| 46 | + |
| 47 | +func (request CollectPipelineDiagnosticRequest) String() string { |
| 48 | + return common.PointerString(request) |
| 49 | +} |
| 50 | + |
| 51 | +// HTTPRequest implements the OCIRequest interface |
| 52 | +func (request CollectPipelineDiagnosticRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { |
| 53 | + |
| 54 | + _, err := request.ValidateEnumValue() |
| 55 | + if err != nil { |
| 56 | + return http.Request{}, err |
| 57 | + } |
| 58 | + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) |
| 59 | +} |
| 60 | + |
| 61 | +// BinaryRequestBody implements the OCIRequest interface |
| 62 | +func (request CollectPipelineDiagnosticRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { |
| 63 | + |
| 64 | + return nil, false |
| 65 | + |
| 66 | +} |
| 67 | + |
| 68 | +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. |
| 69 | +func (request CollectPipelineDiagnosticRequest) RetryPolicy() *common.RetryPolicy { |
| 70 | + return request.RequestMetadata.RetryPolicy |
| 71 | +} |
| 72 | + |
| 73 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 74 | +// This function is being called during constructing API request process |
| 75 | +// Not recommended for calling this function directly |
| 76 | +func (request CollectPipelineDiagnosticRequest) ValidateEnumValue() (bool, error) { |
| 77 | + errMessage := []string{} |
| 78 | + if len(errMessage) > 0 { |
| 79 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 80 | + } |
| 81 | + return false, nil |
| 82 | +} |
| 83 | + |
| 84 | +// CollectPipelineDiagnosticResponse wrapper for the CollectPipelineDiagnostic operation |
| 85 | +type CollectPipelineDiagnosticResponse struct { |
| 86 | + |
| 87 | + // The underlying http response |
| 88 | + RawResponse *http.Response |
| 89 | + |
| 90 | + // A unique Oracle-assigned identifier for an asynchronous request. You can use this to query |
| 91 | + // status of the asynchronous operation. |
| 92 | + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` |
| 93 | + |
| 94 | + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a |
| 95 | + // particular request, please include the request ID. |
| 96 | + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` |
| 97 | +} |
| 98 | + |
| 99 | +func (response CollectPipelineDiagnosticResponse) String() string { |
| 100 | + return common.PointerString(response) |
| 101 | +} |
| 102 | + |
| 103 | +// HTTPResponse implements the OCIResponse interface |
| 104 | +func (response CollectPipelineDiagnosticResponse) HTTPResponse() *http.Response { |
| 105 | + return response.RawResponse |
| 106 | +} |
0 commit comments