/** This is an automatically generated code sample. 
To make this code sample work in your Oracle Cloud tenancy, 
please replace the values for any parameters whose current values do not fit
your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and 
boolean, number, and enum parameters with values not fitting your use case).
*/

import com.oracle.bmc.ConfigFileReader;
import com.oracle.bmc.auth.AuthenticationDetailsProvider;
import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider;
import com.oracle.bmc.datacatalog.DataCatalogClient;
import com.oracle.bmc.datacatalog.model.*;
import com.oracle.bmc.datacatalog.requests.*;
import com.oracle.bmc.datacatalog.responses.*;
import java.math.BigDecimal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.Arrays;


public class SearchCriteriaExample {
    public static void main(String[] args) throws Exception {

        /**
         * Create a default authentication provider that uses the DEFAULT
         * profile in the configuration file.
         * Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
         */
        final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
        final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);

        /* Create a service client */
        DataCatalogClient client = new DataCatalogClient(provider);

        /* Create a request and dependent object(s). */
	SearchCriteria searchCriteria = SearchCriteria.builder()
		.query("EXAMPLE-query-Value")
		.facetedQuery("EXAMPLE-facetedQuery-Value")
		.dimensions(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
		.sort(new ArrayList<>(Arrays.asList(FacetedSearchSortRequest.builder()
				.sortBy("EXAMPLE-sortBy-Value")
				.sortOrder(FacetedSearchSortRequest.SortOrder.Desc).build())))
		.filters(FacetedSearchFilterRequest.builder()
			.searchDateFilters(new ArrayList<>(Arrays.asList(FacetedSearchDateFilterRequest.builder()
					.fieldName("EXAMPLE-fieldName-Value")
					.timeAfter(new Date("Thu Feb 27 11:19:59 UTC 2014"))
					.timeBefore(new Date("Wed Sep 17 19:31:29 UTC 2003")).build())))
			.searchStringFilters(new ArrayList<>(Arrays.asList(FacetedSearchStringFilterRequest.builder()
					.field("EXAMPLE-field-Value")
					.values(new ArrayList<>(Arrays.asList("EXAMPLE--Value"))).build()))).build()).build();

	SearchCriteriaRequest searchCriteriaRequest = SearchCriteriaRequest.builder()
		.catalogId("ocid1.test.oc1..<unique_ID>EXAMPLE-catalogId-Value")
		.searchCriteriaDetails(searchCriteria)
		.displayName("EXAMPLE-displayName-Value")
		.name("EXAMPLE-name-Value")
		.lifecycleState(LifecycleState.Deleted)
		.timeout("EXAMPLE-timeout-Value")
		.sortBy(SearchCriteriaRequest.SortBy.Timecreated)
		.sortOrder(SearchCriteriaRequest.SortOrder.Desc)
		.limit(431)
		.page("EXAMPLE-page-Value")
		.opcRequestId("GYIAZ7OWDIYG9ZNVI1AN<unique_ID>").build();

        /* Send request to the Client */
        SearchCriteriaResponse response = client.searchCriteria(searchCriteriaRequest);
    }

    
}