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