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

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


public class UpdateRoverNodeExample {
    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 */
        RoverNodeClient client = RoverNodeClient.builder().build(provider);

        /* Create a request and dependent object(s). */
	UpdateRoverNodeDetails updateRoverNodeDetails = UpdateRoverNodeDetails.builder()
		.displayName("EXAMPLE-displayName-Value")
		.shape("EXAMPLE-shape-Value")
		.serialNumber("EXAMPLE-serialNumber-Value")
		.customerShippingAddress(ShippingAddress.builder()
			.addressee("EXAMPLE-addressee-Value")
			.careOf("EXAMPLE-careOf-Value")
			.address1("EXAMPLE-address1-Value")
			.address2("EXAMPLE-address2-Value")
			.address3("EXAMPLE-address3-Value")
			.address4("EXAMPLE-address4-Value")
			.cityOrLocality("EXAMPLE-cityOrLocality-Value")
			.stateOrRegion("EXAMPLE-stateOrRegion-Value")
			.zipcode("EXAMPLE-zipcode-Value")
			.country("EXAMPLE-country-Value")
			.phoneNumber("EXAMPLE-phoneNumber-Value")
			.email("EXAMPLE-email-Value").build())
		.nodeWorkloads(new ArrayList<>(Arrays.asList(RoverWorkload.builder()
				.name("EXAMPLE-name-Value")
				.compartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value")
				.id("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")
				.size("EXAMPLE-size-Value")
				.objectCount("EXAMPLE-objectCount-Value")
				.prefix("EXAMPLE-prefix-Value")
				.rangeStart("EXAMPLE-rangeStart-Value")
				.rangeEnd("EXAMPLE-rangeEnd-Value")
				.workloadType("EXAMPLE-workloadType-Value")
				.workRequestId("ocid1.test.oc1..<unique_ID>EXAMPLE-workRequestId-Value").build())))
		.superUserPassword("EXAMPLE-superUserPassword-Value")
		.unlockPassphrase("EXAMPLE-unlockPassphrase-Value")
		.pointOfContact("EXAMPLE-pointOfContact-Value")
		.pointOfContactPhoneNumber("EXAMPLE-pointOfContactPhoneNumber-Value")
		.oracleShippingTrackingUrl("EXAMPLE-oracleShippingTrackingUrl-Value")
		.shippingPreference(UpdateRoverNodeDetails.ShippingPreference.CustomerPickup)
		.shippingVendor("EXAMPLE-shippingVendor-Value")
		.timePickupExpected(new Date("Tue Jan 25 00:02:24 UTC 2022"))
		.lifecycleState(LifecycleState.Active)
		.enclosureType(EnclosureType.Ruggadized)
		.lifecycleStateDetails("EXAMPLE-lifecycleStateDetails-Value")
		.timeReturnWindowStarts(new Date("Fri Jul 18 22:20:04 UTC 2014"))
		.timeReturnWindowEnds(new Date("Thu Jun 21 18:00:44 UTC 2035"))
		.isImportRequested(true)
		.importCompartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value")
		.importFileBucket("EXAMPLE-importFileBucket-Value")
		.dataValidationCode("EXAMPLE-dataValidationCode-Value")
		.publicKey("EXAMPLE-publicKey-Value")
		.certificateAuthorityId("ocid1.test.oc1..<unique_ID>EXAMPLE-certificateAuthorityId-Value")
		.timeCertValidityEnd(new Date("Wed Jun 24 02:02:36 UTC 2009"))
		.commonName("EXAMPLE-commonName-Value")
		.certCompartmentId("ocid1.test.oc1..<unique_ID>EXAMPLE-certCompartmentId-Value")
		.certKeyAlgorithm(CertKeyAlgorithm.Rsa2048)
		.certSignatureAlgorithm(CertSignatureAlgorithm.Sha384WithEcdsa)
		.freeformTags(new HashMap<java.lang.String, java.lang.String>() {
				{
					put("EXAMPLE_KEY_hk72s","EXAMPLE_VALUE_wgV5eOjELcjRxTDFrxO1");
				}
 			})
		.definedTags(new HashMap<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>() {
				{
					put("EXAMPLE_KEY_Lc5ce",new HashMap<java.lang.String, java.lang.Object>() {
					{
						put("EXAMPLE_KEY_Zl2g5","EXAMPLE--Value");
					}
 				});
				}
 			})
		.systemTags(new HashMap<java.lang.String, java.util.Map<java.lang.String, java.lang.Object>>() {
				{
					put("EXAMPLE_KEY_T7bOm",new HashMap<java.lang.String, java.lang.Object>() {
					{
						put("EXAMPLE_KEY_KPG42","EXAMPLE--Value");
					}
 				});
				}
 			}).build();

	UpdateRoverNodeRequest updateRoverNodeRequest = UpdateRoverNodeRequest.builder()
		.roverNodeId("ocid1.test.oc1..<unique_ID>EXAMPLE-roverNodeId-Value")
		.updateRoverNodeDetails(updateRoverNodeDetails)
		.ifMatch("EXAMPLE-ifMatch-Value")
		.opcRequestId("VAXS8E2LL57X9GQWXDQH<unique_ID>").build();

        /* Send request to the Client */
        UpdateRoverNodeResponse response = client.updateRoverNode(updateRoverNodeRequest);
    }

    
}