1// Copyright (c) 2016, 2018, 2020, 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 5package core 6 7import ( 8 "github.com/oracle/oci-go-sdk/common" 9 "net/http" 10) 11 12// ListInstanceDevicesRequest wrapper for the ListInstanceDevices operation 13type ListInstanceDevicesRequest struct { 14 15 // The OCID of the instance. 16 InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` 17 18 // A filter to return only available devices or only used devices. 19 IsAvailable *bool `mandatory:"false" contributesTo:"query" name:"isAvailable"` 20 21 // A filter to return only devices that match the given name exactly. 22 Name *string `mandatory:"false" contributesTo:"query" name:"name"` 23 24 // For list pagination. The maximum number of results per page, or items to return in a paginated 25 // "List" call. For important details about how pagination works, see 26 // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). 27 // Example: `50` 28 Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` 29 30 // For list pagination. The value of the `opc-next-page` response header from the previous "List" 31 // call. For important details about how pagination works, see 32 // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). 33 Page *string `mandatory:"false" contributesTo:"query" name:"page"` 34 35 // Unique identifier for the request. 36 // If you need to contact Oracle about a particular request, please provide the request ID. 37 OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` 38 39 // The field to sort by. You can provide one sort order (`sortOrder`). Default order for 40 // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME 41 // sort order is case sensitive. 42 // **Note:** In general, some "List" operations (for example, `ListInstances`) let you 43 // optionally filter by availability domain if the scope of the resource type is within a 44 // single availability domain. If you call one of these "List" operations without specifying 45 // an availability domain, the resources are grouped by availability domain, then sorted. 46 SortBy ListInstanceDevicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` 47 48 // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order 49 // is case sensitive. 50 SortOrder ListInstanceDevicesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` 51 52 // Metadata about the request. This information will not be transmitted to the service, but 53 // represents information that the SDK will consume to drive retry behavior. 54 RequestMetadata common.RequestMetadata 55} 56 57func (request ListInstanceDevicesRequest) String() string { 58 return common.PointerString(request) 59} 60 61// HTTPRequest implements the OCIRequest interface 62func (request ListInstanceDevicesRequest) HTTPRequest(method, path string) (http.Request, error) { 63 return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) 64} 65 66// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. 67func (request ListInstanceDevicesRequest) RetryPolicy() *common.RetryPolicy { 68 return request.RequestMetadata.RetryPolicy 69} 70 71// ListInstanceDevicesResponse wrapper for the ListInstanceDevices operation 72type ListInstanceDevicesResponse struct { 73 74 // The underlying http response 75 RawResponse *http.Response 76 77 // A list of []Device instances 78 Items []Device `presentIn:"body"` 79 80 // For list pagination. When this header appears in the response, additional pages 81 // of results remain. For important details about how pagination works, see 82 // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). 83 OpcNextPage *string `presentIn:"header" name:"opc-next-page"` 84 85 // Unique Oracle-assigned identifier for the request. If you need to contact 86 // Oracle about a particular request, please provide the request ID. 87 OpcRequestId *string `presentIn:"header" name:"opc-request-id"` 88} 89 90func (response ListInstanceDevicesResponse) String() string { 91 return common.PointerString(response) 92} 93 94// HTTPResponse implements the OCIResponse interface 95func (response ListInstanceDevicesResponse) HTTPResponse() *http.Response { 96 return response.RawResponse 97} 98 99// ListInstanceDevicesSortByEnum Enum with underlying type: string 100type ListInstanceDevicesSortByEnum string 101 102// Set of constants representing the allowable values for ListInstanceDevicesSortByEnum 103const ( 104 ListInstanceDevicesSortByTimecreated ListInstanceDevicesSortByEnum = "TIMECREATED" 105 ListInstanceDevicesSortByDisplayname ListInstanceDevicesSortByEnum = "DISPLAYNAME" 106) 107 108var mappingListInstanceDevicesSortBy = map[string]ListInstanceDevicesSortByEnum{ 109 "TIMECREATED": ListInstanceDevicesSortByTimecreated, 110 "DISPLAYNAME": ListInstanceDevicesSortByDisplayname, 111} 112 113// GetListInstanceDevicesSortByEnumValues Enumerates the set of values for ListInstanceDevicesSortByEnum 114func GetListInstanceDevicesSortByEnumValues() []ListInstanceDevicesSortByEnum { 115 values := make([]ListInstanceDevicesSortByEnum, 0) 116 for _, v := range mappingListInstanceDevicesSortBy { 117 values = append(values, v) 118 } 119 return values 120} 121 122// ListInstanceDevicesSortOrderEnum Enum with underlying type: string 123type ListInstanceDevicesSortOrderEnum string 124 125// Set of constants representing the allowable values for ListInstanceDevicesSortOrderEnum 126const ( 127 ListInstanceDevicesSortOrderAsc ListInstanceDevicesSortOrderEnum = "ASC" 128 ListInstanceDevicesSortOrderDesc ListInstanceDevicesSortOrderEnum = "DESC" 129) 130 131var mappingListInstanceDevicesSortOrder = map[string]ListInstanceDevicesSortOrderEnum{ 132 "ASC": ListInstanceDevicesSortOrderAsc, 133 "DESC": ListInstanceDevicesSortOrderDesc, 134} 135 136// GetListInstanceDevicesSortOrderEnumValues Enumerates the set of values for ListInstanceDevicesSortOrderEnum 137func GetListInstanceDevicesSortOrderEnumValues() []ListInstanceDevicesSortOrderEnum { 138 values := make([]ListInstanceDevicesSortOrderEnum, 0) 139 for _, v := range mappingListInstanceDevicesSortOrder { 140 values = append(values, v) 141 } 142 return values 143} 144