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// ListVolumesRequest wrapper for the ListVolumes operation
12type ListVolumesRequest struct {
13
14	// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment.
15	CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"`
16
17	// The name of the availability domain.
18	// Example: `Uocm:PHX-AD-1`
19	AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"`
20
21	// For list pagination. The maximum number of results per page, or items to return in a paginated
22	// "List" call. For important details about how pagination works, see
23	// List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
24	// Example: `50`
25	Limit *int `mandatory:"false" contributesTo:"query" name:"limit"`
26
27	// For list pagination. The value of the `opc-next-page` response header from the previous "List"
28	// call. For important details about how pagination works, see
29	// List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
30	Page *string `mandatory:"false" contributesTo:"query" name:"page"`
31
32	// A filter to return only resources that match the given display name exactly.
33	DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"`
34
35	// The field to sort by. You can provide one sort order (`sortOrder`). Default order for
36	// TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME
37	// sort order is case sensitive.
38	// **Note:** In general, some "List" operations (for example, `ListInstances`) let you
39	// optionally filter by availability domain if the scope of the resource type is within a
40	// single availability domain. If you call one of these "List" operations without specifying
41	// an availability domain, the resources are grouped by availability domain, then sorted.
42	SortBy ListVolumesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"`
43
44	// The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order
45	// is case sensitive.
46	SortOrder ListVolumesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"`
47
48	// The OCID of the volume group.
49	VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"`
50
51	// A filter to only return resources that match the given lifecycle state.  The state value is case-insensitive.
52	LifecycleState VolumeLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"`
53
54	// Unique Oracle-assigned identifier for the request.
55	// If you need to contact Oracle about a particular request, please provide the request ID.
56	OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
57
58	// Metadata about the request. This information will not be transmitted to the service, but
59	// represents information that the SDK will consume to drive retry behavior.
60	RequestMetadata common.RequestMetadata
61}
62
63func (request ListVolumesRequest) String() string {
64	return common.PointerString(request)
65}
66
67// HTTPRequest implements the OCIRequest interface
68func (request ListVolumesRequest) HTTPRequest(method, path string) (http.Request, error) {
69	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
70}
71
72// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
73func (request ListVolumesRequest) RetryPolicy() *common.RetryPolicy {
74	return request.RequestMetadata.RetryPolicy
75}
76
77// ListVolumesResponse wrapper for the ListVolumes operation
78type ListVolumesResponse struct {
79
80	// The underlying http response
81	RawResponse *http.Response
82
83	// A list of []Volume instances
84	Items []Volume `presentIn:"body"`
85
86	// For list pagination. When this header appears in the response, additional pages
87	// of results remain. For important details about how pagination works, see
88	// List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
89	OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
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
96func (response ListVolumesResponse) String() string {
97	return common.PointerString(response)
98}
99
100// HTTPResponse implements the OCIResponse interface
101func (response ListVolumesResponse) HTTPResponse() *http.Response {
102	return response.RawResponse
103}
104
105// ListVolumesSortByEnum Enum with underlying type: string
106type ListVolumesSortByEnum string
107
108// Set of constants representing the allowable values for ListVolumesSortByEnum
109const (
110	ListVolumesSortByTimecreated ListVolumesSortByEnum = "TIMECREATED"
111	ListVolumesSortByDisplayname ListVolumesSortByEnum = "DISPLAYNAME"
112)
113
114var mappingListVolumesSortBy = map[string]ListVolumesSortByEnum{
115	"TIMECREATED": ListVolumesSortByTimecreated,
116	"DISPLAYNAME": ListVolumesSortByDisplayname,
117}
118
119// GetListVolumesSortByEnumValues Enumerates the set of values for ListVolumesSortByEnum
120func GetListVolumesSortByEnumValues() []ListVolumesSortByEnum {
121	values := make([]ListVolumesSortByEnum, 0)
122	for _, v := range mappingListVolumesSortBy {
123		values = append(values, v)
124	}
125	return values
126}
127
128// ListVolumesSortOrderEnum Enum with underlying type: string
129type ListVolumesSortOrderEnum string
130
131// Set of constants representing the allowable values for ListVolumesSortOrderEnum
132const (
133	ListVolumesSortOrderAsc  ListVolumesSortOrderEnum = "ASC"
134	ListVolumesSortOrderDesc ListVolumesSortOrderEnum = "DESC"
135)
136
137var mappingListVolumesSortOrder = map[string]ListVolumesSortOrderEnum{
138	"ASC":  ListVolumesSortOrderAsc,
139	"DESC": ListVolumesSortOrderDesc,
140}
141
142// GetListVolumesSortOrderEnumValues Enumerates the set of values for ListVolumesSortOrderEnum
143func GetListVolumesSortOrderEnumValues() []ListVolumesSortOrderEnum {
144	values := make([]ListVolumesSortOrderEnum, 0)
145	for _, v := range mappingListVolumesSortOrder {
146		values = append(values, v)
147	}
148	return values
149}
150