// 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 * as rover from "oci-rover";
import common = require("oci-common");

// 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.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new rover.RoverNodeClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  createRoverNodeDetails = {
		displayName: "EXAMPLE-displayName-Value",
		compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
		shape: "EXAMPLE-shape-Value",
		customerShippingAddress: {
			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",

			}
,
		nodeWorkloads: [{
				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",

				}
				],
		superUserPassword: "EXAMPLE-superUserPassword-Value",
		unlockPassphrase: "EXAMPLE-unlockPassphrase-Value",
		pointOfContact: "EXAMPLE-pointOfContact-Value",
		pointOfContactPhoneNumber: "EXAMPLE-pointOfContactPhoneNumber-Value",
		shippingPreference: rover.models.CreateRoverNodeDetails.ShippingPreference.OracleShipped,
		shippingVendor: "EXAMPLE-shippingVendor-Value",
		timePickupExpected: new Date("Mon Aug 12 06:30:39 UTC 2002"),
		publicKey: "EXAMPLE-publicKey-Value",
		timeReturnWindowStarts: new Date("Tue Mar 25 01:25:22 UTC 2014"),
		timeReturnWindowEnds: new Date("Sat Apr 28 22:26:19 UTC 2035"),
		lifecycleState: rover.models.LifecycleState.Failed,
		enclosureType: rover.models.EnclosureType.Ruggadized,
		lifecycleStateDetails: "EXAMPLE-lifecycleStateDetails-Value",
		serialNumber: "EXAMPLE-serialNumber-Value",
		oracleShippingTrackingUrl: "EXAMPLE-oracleShippingTrackingUrl-Value",
		isImportRequested: true,
		importCompartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value",
		importFileBucket: "EXAMPLE-importFileBucket-Value",
		dataValidationCode: "EXAMPLE-dataValidationCode-Value",
		masterKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-masterKeyId-Value",
		certificateAuthorityId: "ocid1.test.oc1..<unique_ID>EXAMPLE-certificateAuthorityId-Value",
		timeCertValidityEnd: new Date("Tue Sep 19 23:58:37 UTC 2034"),
		commonName: "EXAMPLE-commonName-Value",
		certCompartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-certCompartmentId-Value",
		certKeyAlgorithm: rover.models.CertKeyAlgorithm.EcdsaP384,
		certSignatureAlgorithm: rover.models.CertSignatureAlgorithm.Sha384WithRsa,
		freeformTags: {
			EXAMPLE_KEY_DfpBD :"EXAMPLE_VALUE_2mzGqQAjq6AMFqFZczo4"
			},
		definedTags: {
			EXAMPLE_KEY_2swgV :{
				EXAMPLE_KEY_xEhk7 :"EXAMPLE--Value"
				}
			},
		systemTags: {
			EXAMPLE_KEY_LcjRx :{
				EXAMPLE_KEY_5eOjE :"EXAMPLE--Value"
				}
			},

		}

	const createRoverNodeRequest: rover.requests.CreateRoverNodeRequest = { 
	createRoverNodeDetails: createRoverNodeDetails,
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",
	opcRequestId: "TDFRXO1ZL2G5LC5CEKPG<unique_ID>",

		}; 


     // Send request to the Client.
     const createRoverNodeResponse = await client.createRoverNode(createRoverNodeRequest);
     }
     catch (error) {
         console.log("createRoverNode Failed with error  " + error);
     }
})();