/** 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.stackmonitoring.StackMonitoringClient;
import com.oracle.bmc.stackmonitoring.model.*;
import com.oracle.bmc.stackmonitoring.requests.*;
import com.oracle.bmc.stackmonitoring.responses.*;
import java.math.BigDecimal;

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


public class SearchMonitoredResourcesExample {
    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 */
        StackMonitoringClient client = new StackMonitoringClient(provider);

        /* Create a request and dependent object(s). */
	SearchMonitoredResourcesDetails searchMonitoredResourcesDetails = SearchMonitoredResourcesDetails.builder()
		.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
		.name("EXAMPLE-name-Value")
		.nameContains("EXAMPLE-nameContains-Value")
		.type("EXAMPLE-type-Value")
		.hostName("EXAMPLE-hostName-Value")
		.externalId("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value")
		.hostNameContains("EXAMPLE-hostNameContains-Value")
		.managementAgentId("ocid1.test.oc1..<unique_ID>EXAMPLE-managementAgentId-Value")
		.lifecycleState(ResourceLifecycleState.Deleted)
		.timeCreatedGreaterThanOrEqualTo(new Date("Tue Oct 16 14:17:26 UTC 2001"))
		.timeCreatedLessThan(new Date("Thu Nov 11 11:30:04 UTC 2049"))
		.timeUpdatedGreaterThanOrEqualTo(new Date("Thu Jul 03 02:09:19 UTC 2036"))
		.timeUpdatedLessThan(new Date("Mon Jul 30 11:28:52 UTC 2018"))
		.resourceTimeZone("EXAMPLE-resourceTimeZone-Value")
		.sortOrder(SortOrder.Desc)
		.sortBy(SearchMonitoredResourcesDetails.SortBy.TimeCreated)
		.propertyEquals(new HashMap<java.lang.String, java.lang.String>() {
				{
					put("EXAMPLE_KEY_o942j","EXAMPLE_VALUE_9TkH9t4A7gGH6qUjU1tq");
				}
 			}).build();

	SearchMonitoredResourcesRequest searchMonitoredResourcesRequest = SearchMonitoredResourcesRequest.builder()
		.searchMonitoredResourcesDetails(searchMonitoredResourcesDetails)
		.limit(349)
		.page("EXAMPLE-page-Value")
		.fields(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
		.excludeFields(new ArrayList<>(Arrays.asList("EXAMPLE--Value")))
		.opcRequestId("QTO71HP66F6WVECJLSPA<unique_ID>")
		.opcRetryToken("EXAMPLE-opcRetryToken-Value")
		.ifMatch("EXAMPLE-ifMatch-Value").build();

        /* Send request to the Client */
        SearchMonitoredResourcesResponse response = client.searchMonitoredResources(searchMonitoredResourcesRequest);
    }

    
}