/** 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.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.Updating)
		.timeCreatedGreaterThanOrEqualTo(new Date("Sun May 13 12:57:10 UTC 2046"))
		.timeCreatedLessThan(new Date("Tue Jun 20 14:54:12 UTC 2023"))
		.timeUpdatedGreaterThanOrEqualTo(new Date("Mon Mar 19 22:30:30 UTC 2012"))
		.timeUpdatedLessThan(new Date("Tue Jan 23 16:36:44 UTC 2018"))
		.resourceTimeZone("EXAMPLE-resourceTimeZone-Value")
		.sortOrder(SortOrder.Desc)
		.sortBy(SearchMonitoredResourcesDetails.SortBy.ResourceName)
		.propertyEquals(new HashMap<java.lang.String, java.lang.String>() {
				{
					put("EXAMPLE_KEY_vwqD3","EXAMPLE_VALUE_0wa8XVMQb22KD9aEUAyC");
				}
 			}).build();

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

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

    
}