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