|
| 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 database |
| 6 | + |
| 7 | +import ( |
| 8 | + "fmt" |
| 9 | + "github.com/oracle/oci-go-sdk/v65/common" |
| 10 | + "net/http" |
| 11 | + "strings" |
| 12 | +) |
| 13 | + |
| 14 | +// ListSystemVersionMinorVersionsRequest wrapper for the ListSystemVersionMinorVersions operation |
| 15 | +// |
| 16 | +// # See also |
| 17 | +// |
| 18 | +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ListSystemVersionMinorVersions.go.html to see an example of how to use ListSystemVersionMinorVersionsRequest. |
| 19 | +type ListSystemVersionMinorVersionsRequest struct { |
| 20 | + |
| 21 | + // The System major version. |
| 22 | + MajorVersion *string `mandatory:"true" contributesTo:"path" name:"majorVersion"` |
| 23 | + |
| 24 | + // The compartment OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). |
| 25 | + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` |
| 26 | + |
| 27 | + // Specifies gi version query parameter. |
| 28 | + GiVersion *string `mandatory:"true" contributesTo:"query" name:"giVersion"` |
| 29 | + |
| 30 | + // The maximum number of items to return per page. |
| 31 | + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` |
| 32 | + |
| 33 | + // The pagination token to continue listing from. |
| 34 | + Page *string `mandatory:"false" contributesTo:"query" name:"page"` |
| 35 | + |
| 36 | + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). |
| 37 | + SortOrder ListSystemVersionMinorVersionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` |
| 38 | + |
| 39 | + // Unique identifier for the request. |
| 40 | + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` |
| 41 | + |
| 42 | + // If provided, filters the results for the given shape. |
| 43 | + Shape *string `mandatory:"false" contributesTo:"query" name:"shape"` |
| 44 | + |
| 45 | + // If provided, filters the results for the specified resource Id. |
| 46 | + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` |
| 47 | + |
| 48 | + // If provided, return highest versions from each major version family. |
| 49 | + IsLatest *bool `mandatory:"false" contributesTo:"query" name:"isLatest"` |
| 50 | + |
| 51 | + // Metadata about the request. This information will not be transmitted to the service, but |
| 52 | + // represents information that the SDK will consume to drive retry behavior. |
| 53 | + RequestMetadata common.RequestMetadata |
| 54 | +} |
| 55 | + |
| 56 | +func (request ListSystemVersionMinorVersionsRequest) String() string { |
| 57 | + return common.PointerString(request) |
| 58 | +} |
| 59 | + |
| 60 | +// HTTPRequest implements the OCIRequest interface |
| 61 | +func (request ListSystemVersionMinorVersionsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { |
| 62 | + |
| 63 | + _, err := request.ValidateEnumValue() |
| 64 | + if err != nil { |
| 65 | + return http.Request{}, err |
| 66 | + } |
| 67 | + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) |
| 68 | +} |
| 69 | + |
| 70 | +// BinaryRequestBody implements the OCIRequest interface |
| 71 | +func (request ListSystemVersionMinorVersionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { |
| 72 | + |
| 73 | + return nil, false |
| 74 | + |
| 75 | +} |
| 76 | + |
| 77 | +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. |
| 78 | +func (request ListSystemVersionMinorVersionsRequest) RetryPolicy() *common.RetryPolicy { |
| 79 | + return request.RequestMetadata.RetryPolicy |
| 80 | +} |
| 81 | + |
| 82 | +// ValidateEnumValue returns an error when providing an unsupported enum value |
| 83 | +// This function is being called during constructing API request process |
| 84 | +// Not recommended for calling this function directly |
| 85 | +func (request ListSystemVersionMinorVersionsRequest) ValidateEnumValue() (bool, error) { |
| 86 | + errMessage := []string{} |
| 87 | + if _, ok := GetMappingListSystemVersionMinorVersionsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { |
| 88 | + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListSystemVersionMinorVersionsSortOrderEnumStringValues(), ","))) |
| 89 | + } |
| 90 | + if len(errMessage) > 0 { |
| 91 | + return true, fmt.Errorf(strings.Join(errMessage, "\n")) |
| 92 | + } |
| 93 | + return false, nil |
| 94 | +} |
| 95 | + |
| 96 | +// ListSystemVersionMinorVersionsResponse wrapper for the ListSystemVersionMinorVersions operation |
| 97 | +type ListSystemVersionMinorVersionsResponse struct { |
| 98 | + |
| 99 | + // The underlying http response |
| 100 | + RawResponse *http.Response |
| 101 | + |
| 102 | + // A list of SystemVersionMinorVersionCollection instances |
| 103 | + SystemVersionMinorVersionCollection `presentIn:"body"` |
| 104 | + |
| 105 | + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about |
| 106 | + // a particular request, please provide the request ID. |
| 107 | + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` |
| 108 | + |
| 109 | + // For pagination of a list of items. When paging through a list, if this header appears in the response, |
| 110 | + // then there are additional items still to get. Include this value as the `page` parameter for the |
| 111 | + // subsequent GET request. For information about pagination, see |
| 112 | + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). |
| 113 | + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` |
| 114 | +} |
| 115 | + |
| 116 | +func (response ListSystemVersionMinorVersionsResponse) String() string { |
| 117 | + return common.PointerString(response) |
| 118 | +} |
| 119 | + |
| 120 | +// HTTPResponse implements the OCIResponse interface |
| 121 | +func (response ListSystemVersionMinorVersionsResponse) HTTPResponse() *http.Response { |
| 122 | + return response.RawResponse |
| 123 | +} |
| 124 | + |
| 125 | +// ListSystemVersionMinorVersionsSortOrderEnum Enum with underlying type: string |
| 126 | +type ListSystemVersionMinorVersionsSortOrderEnum string |
| 127 | + |
| 128 | +// Set of constants representing the allowable values for ListSystemVersionMinorVersionsSortOrderEnum |
| 129 | +const ( |
| 130 | + ListSystemVersionMinorVersionsSortOrderAsc ListSystemVersionMinorVersionsSortOrderEnum = "ASC" |
| 131 | + ListSystemVersionMinorVersionsSortOrderDesc ListSystemVersionMinorVersionsSortOrderEnum = "DESC" |
| 132 | +) |
| 133 | + |
| 134 | +var mappingListSystemVersionMinorVersionsSortOrderEnum = map[string]ListSystemVersionMinorVersionsSortOrderEnum{ |
| 135 | + "ASC": ListSystemVersionMinorVersionsSortOrderAsc, |
| 136 | + "DESC": ListSystemVersionMinorVersionsSortOrderDesc, |
| 137 | +} |
| 138 | + |
| 139 | +var mappingListSystemVersionMinorVersionsSortOrderEnumLowerCase = map[string]ListSystemVersionMinorVersionsSortOrderEnum{ |
| 140 | + "asc": ListSystemVersionMinorVersionsSortOrderAsc, |
| 141 | + "desc": ListSystemVersionMinorVersionsSortOrderDesc, |
| 142 | +} |
| 143 | + |
| 144 | +// GetListSystemVersionMinorVersionsSortOrderEnumValues Enumerates the set of values for ListSystemVersionMinorVersionsSortOrderEnum |
| 145 | +func GetListSystemVersionMinorVersionsSortOrderEnumValues() []ListSystemVersionMinorVersionsSortOrderEnum { |
| 146 | + values := make([]ListSystemVersionMinorVersionsSortOrderEnum, 0) |
| 147 | + for _, v := range mappingListSystemVersionMinorVersionsSortOrderEnum { |
| 148 | + values = append(values, v) |
| 149 | + } |
| 150 | + return values |
| 151 | +} |
| 152 | + |
| 153 | +// GetListSystemVersionMinorVersionsSortOrderEnumStringValues Enumerates the set of values in String for ListSystemVersionMinorVersionsSortOrderEnum |
| 154 | +func GetListSystemVersionMinorVersionsSortOrderEnumStringValues() []string { |
| 155 | + return []string{ |
| 156 | + "ASC", |
| 157 | + "DESC", |
| 158 | + } |
| 159 | +} |
| 160 | + |
| 161 | +// GetMappingListSystemVersionMinorVersionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum |
| 162 | +func GetMappingListSystemVersionMinorVersionsSortOrderEnum(val string) (ListSystemVersionMinorVersionsSortOrderEnum, bool) { |
| 163 | + enum, ok := mappingListSystemVersionMinorVersionsSortOrderEnumLowerCase[strings.ToLower(val)] |
| 164 | + return enum, ok |
| 165 | +} |
0 commit comments