# 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).

require 'oci'
require 'date'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
rover_client = OCI::Rover::RoverNodeClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_rover_node_response =
  rover_client.update_rover_node(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-roverNodeId-Value',
    OCI::Rover::Models::UpdateRoverNodeDetails.new(
      display_name: 'EXAMPLE-displayName-Value',
      shape: 'EXAMPLE-shape-Value',
      serial_number: 'EXAMPLE-serialNumber-Value',
      customer_shipping_address:
        OCI::Rover::Models::ShippingAddress.new(
          addressee: 'EXAMPLE-addressee-Value',
          address1: 'EXAMPLE-address1-Value',
          city_or_locality: 'EXAMPLE-cityOrLocality-Value',
          state_or_region: 'EXAMPLE-stateOrRegion-Value',
          zipcode: 'EXAMPLE-zipcode-Value',
          country: 'EXAMPLE-country-Value',
          phone_number: 'EXAMPLE-phoneNumber-Value',
          care_of: 'EXAMPLE-careOf-Value',
          address2: 'EXAMPLE-address2-Value',
          address3: 'EXAMPLE-address3-Value',
          address4: 'EXAMPLE-address4-Value',
          email: 'EXAMPLE-email-Value'
        ),
      node_workloads: [
        OCI::Rover::Models::RoverWorkload.new(
          compartment_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
          id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value',
          workload_type: 'EXAMPLE-workloadType-Value',
          name: 'EXAMPLE-name-Value',
          size: 'EXAMPLE-size-Value',
          object_count: 'EXAMPLE-objectCount-Value',
          prefix: 'EXAMPLE-prefix-Value',
          range_start: 'EXAMPLE-rangeStart-Value',
          range_end: 'EXAMPLE-rangeEnd-Value',
          work_request_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-workRequestId-Value'
        )
      ],
      super_user_password: 'EXAMPLE-superUserPassword-Value',
      unlock_passphrase: 'EXAMPLE-unlockPassphrase-Value',
      point_of_contact: 'EXAMPLE-pointOfContact-Value',
      point_of_contact_phone_number: 'EXAMPLE-pointOfContactPhoneNumber-Value',
      oracle_shipping_tracking_url: 'EXAMPLE-oracleShippingTrackingUrl-Value',
      shipping_preference: 'CUSTOMER_PICKUP',
      shipping_vendor: 'EXAMPLE-shippingVendor-Value',
      time_pickup_expected: DateTime.parse('2030-08-27T13:15:08.172Z'),
      lifecycle_state: 'CREATING',
      enclosure_type: 'RUGGADIZED',
      lifecycle_state_details: 'EXAMPLE-lifecycleStateDetails-Value',
      time_return_window_starts: DateTime.parse('2035-05-26T10:57:54.782Z'),
      time_return_window_ends: DateTime.parse('2018-01-21T02:58:00.817Z'),
      is_import_requested: true,
      import_compartment_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value',
      import_file_bucket: 'EXAMPLE-importFileBucket-Value',
      data_validation_code: 'EXAMPLE-dataValidationCode-Value',
      public_key: 'EXAMPLE-publicKey-Value',
      certificate_authority_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-certificateAuthorityId-Value',
      time_cert_validity_end: DateTime.parse('2047-11-30T01:24:51.716Z'),
      common_name: 'EXAMPLE-commonName-Value',
      cert_compartment_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-certCompartmentId-Value',
      cert_key_algorithm: 'RSA2048',
      cert_signature_algorithm: 'SHA512_WITH_ECDSA',
      freeform_tags: {
        'EXAMPLE_KEY_Hjm5J' => 'EXAMPLE_VALUE_NcpcukLHJcrNaBEMBH9R'
      },
      defined_tags: {
        'EXAMPLE_KEY_ybeYy' => { 'EXAMPLE_KEY_WfiSH' => 'EXAMPLE--Value' }
      },
      system_tags: {
        'EXAMPLE_KEY_eLkO4' => { 'EXAMPLE_KEY_CSJfG' => 'EXAMPLE--Value' }
      }
    )
  )

# Get the data from response
puts "#{update_rover_node_response.data}"