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