1// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2// Code generated. DO NOT EDIT.
3
4package objectstorage
5
6import (
7	"github.com/oracle/oci-go-sdk/common"
8	"net/http"
9)
10
11// ListBucketsRequest wrapper for the ListBuckets operation
12type ListBucketsRequest struct {
13
14	// The Object Storage namespace used for the request.
15	NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"`
16
17	// The ID of the compartment in which to list buckets.
18	CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"`
19
20	// The maximum number of items to return.
21	Limit *int `mandatory:"false" contributesTo:"query" name:"limit"`
22
23	// The page at which to start retrieving results.
24	Page *string `mandatory:"false" contributesTo:"query" name:"page"`
25
26	// Bucket summary in list of buckets includes the 'namespace', 'name', 'compartmentId', 'createdBy', 'timeCreated',
27	// and 'etag' fields. This parameter can also include 'tags' (freeformTags and definedTags). The only supported value
28	// of this parameter is 'tags' for now. Example 'tags'.
29	Fields []ListBucketsFieldsEnum `contributesTo:"query" name:"fields" omitEmpty:"true" collectionFormat:"csv"`
30
31	// The client request ID for tracing.
32	OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"`
33
34	// Metadata about the request. This information will not be transmitted to the service, but
35	// represents information that the SDK will consume to drive retry behavior.
36	RequestMetadata common.RequestMetadata
37}
38
39func (request ListBucketsRequest) String() string {
40	return common.PointerString(request)
41}
42
43// HTTPRequest implements the OCIRequest interface
44func (request ListBucketsRequest) HTTPRequest(method, path string) (http.Request, error) {
45	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
46}
47
48// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
49func (request ListBucketsRequest) RetryPolicy() *common.RetryPolicy {
50	return request.RequestMetadata.RetryPolicy
51}
52
53// ListBucketsResponse wrapper for the ListBuckets operation
54type ListBucketsResponse struct {
55
56	// The underlying http response
57	RawResponse *http.Response
58
59	// A list of []BucketSummary instances
60	Items []BucketSummary `presentIn:"body"`
61
62	// Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging.
63	OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"`
64
65	// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular
66	// request, provide this request ID.
67	OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
68
69	// Paginating a list of buckets.
70	// In the GET request, set the limit to the number of buckets items that you want returned in the response.
71	// If the opc-next-page header appears in the response, then this is a partial list and there are additional
72	// buckets to get. Include the header's value as the `page` parameter in the subsequent GET request to get the
73	// next batch of buckets. Repeat this process to retrieve the entire list of buckets.
74	// By default, the page limit is set to 25 buckets per page, but you can specify a value from 1 to 1000.
75	OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
76}
77
78func (response ListBucketsResponse) String() string {
79	return common.PointerString(response)
80}
81
82// HTTPResponse implements the OCIResponse interface
83func (response ListBucketsResponse) HTTPResponse() *http.Response {
84	return response.RawResponse
85}
86
87// ListBucketsFieldsEnum Enum with underlying type: string
88type ListBucketsFieldsEnum string
89
90// Set of constants representing the allowable values for ListBucketsFieldsEnum
91const (
92	ListBucketsFieldsTags ListBucketsFieldsEnum = "tags"
93)
94
95var mappingListBucketsFields = map[string]ListBucketsFieldsEnum{
96	"tags": ListBucketsFieldsTags,
97}
98
99// GetListBucketsFieldsEnumValues Enumerates the set of values for ListBucketsFieldsEnum
100func GetListBucketsFieldsEnumValues() []ListBucketsFieldsEnum {
101	values := make([]ListBucketsFieldsEnum, 0)
102	for _, v := range mappingListBucketsFields {
103		values = append(values, v)
104	}
105	return values
106}
107