|
| 1 | +// Copyright (c) 2016, 2018, 2024, 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 capacitymanagement |
| 6 | + |
| 7 | +import ( |
| 8 | + "fmt" |
| 9 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 10 | + "net/http" |
| 11 | + "strings" |
| 12 | +) |
| 13 | + |
| 14 | +// CreateOccAvailabilityCatalogRequest wrapper for the CreateOccAvailabilityCatalog operation |
| 15 | +// |
| 16 | +// # See also |
| 17 | +// |
| 18 | +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/capacitymanagement/CreateOccAvailabilityCatalog.go.html to see an example of how to use CreateOccAvailabilityCatalogRequest. |
| 19 | +type CreateOccAvailabilityCatalogRequest struct { |
| 20 | + |
| 21 | + // The request details for creating an availability catalog. |
| 22 | + CreateOccAvailabilityCatalogDetails `contributesTo:"body"` |
| 23 | + |
| 24 | + // A token that uniquely identifies a request so it can be retried in case of a timeout or |
| 25 | + // server error without risk of executing that same action again. Retry tokens expire after 24 |
| 26 | + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource |
| 27 | + // has been deleted and purged from the system, then a retry of the original creation request |
| 28 | + // might be rejected. |
| 29 | + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` |
| 30 | + |
| 31 | + // The client request ID for tracing. The only valid characters for request IDs are letters, numbers, |
| 32 | + // underscore, and dash. |
| 33 | + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` |
| 34 | + |
| 35 | + // Metadata about the request. This information will not be transmitted to the service, but |
| 36 | + // represents information that the SDK will consume to drive retry behavior. |
| 37 | + RequestMetadata common.RequestMetadata |
| 38 | +} |
| 39 | + |
| 40 | +func (request CreateOccAvailabilityCatalogRequest) String() string { |
| 41 | + return common.PointerString(request) |
| 42 | +} |
| 43 | + |
| 44 | +// HTTPRequest implements the OCIRequest interface |
| 45 | +func (request CreateOccAvailabilityCatalogRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { |
| 46 | + |
| 47 | + _, err := request.ValidateEnumValue() |
| 48 | + if err != nil { |
| 49 | + return http.Request{}, err |
| 50 | + } |
| 51 | + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) |
| 52 | +} |
| 53 | + |
| 54 | +// BinaryRequestBody implements the OCIRequest interface |
| 55 | +func (request CreateOccAvailabilityCatalogRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { |
| 56 | + |
| 57 | + return nil, false |
| 58 | + |
| 59 | +} |
| 60 | + |
| 61 | +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. |
| 62 | +func (request CreateOccAvailabilityCatalogRequest) RetryPolicy() *common.RetryPolicy { |
| 63 | + return request.RequestMetadata.RetryPolicy |
| 64 | +} |
| 65 | + |
| 66 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 67 | +// This function is being called during constructing API request process |
| 68 | +// Not recommended for calling this function directly |
| 69 | +func (request CreateOccAvailabilityCatalogRequest) ValidateEnumValue() (bool, error) { |
| 70 | + errMessage := []string{} |
| 71 | + if len(errMessage) > 0 { |
| 72 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 73 | + } |
| 74 | + return false, nil |
| 75 | +} |
| 76 | + |
| 77 | +// CreateOccAvailabilityCatalogResponse wrapper for the CreateOccAvailabilityCatalog operation |
| 78 | +type CreateOccAvailabilityCatalogResponse struct { |
| 79 | + |
| 80 | + // The underlying http response |
| 81 | + RawResponse *http.Response |
| 82 | + |
| 83 | + // The OccAvailabilityCatalog instance |
| 84 | + OccAvailabilityCatalog `presentIn:"body"` |
| 85 | + |
| 86 | + // For optimistic concurrency control. See `if-match`. |
| 87 | + Etag *string `presentIn:"header" name:"etag"` |
| 88 | + |
| 89 | + // For pagination of a list of items. When paging through a list, if this header appears in the response, |
| 90 | + // then a partial list might have been returned. Include this value as the `page` parameter for the |
| 91 | + // subsequent GET request to get the next batch of items. |
| 92 | + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` |
| 93 | + |
| 94 | + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. |
| 95 | + RetryAfter *int `presentIn:"header" name:"retry-after"` |
| 96 | +} |
| 97 | + |
| 98 | +func (response CreateOccAvailabilityCatalogResponse) String() string { |
| 99 | + return common.PointerString(response) |
| 100 | +} |
| 101 | + |
| 102 | +// HTTPResponse implements the OCIResponse interface |
| 103 | +func (response CreateOccAvailabilityCatalogResponse) HTTPResponse() *http.Response { |
| 104 | + return response.RawResponse |
| 105 | +} |
0 commit comments