# 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'

# 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
fleet_apps_management_client =
  OCI::FleetAppsManagement::FleetAppsManagementClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_fleet_response =
  fleet_apps_management_client.update_fleet(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-fleetId-Value',
    OCI::FleetAppsManagement::Models::UpdateFleetDetails.new(
      display_name: 'EXAMPLE-displayName-Value',
      description: 'EXAMPLE-description-Value',
      notification_preferences: [
        OCI::FleetAppsManagement::Models::NotificationPreference.new(
          topic_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-topicId-Value',
          compartment_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
          preferences:
            OCI::FleetAppsManagement::Models::Preferences.new(
              upcoming_schedule:
                OCI::FleetAppsManagement::Models::UpcomingSchedule.new(
                  on_upcoming_schedule: true,
                  notify_before: 'EXAMPLE-notifyBefore-Value'
                ),
              on_job_failure: false,
              on_topology_modification: true,
              on_task_pause: true,
              on_task_failure: true,
              on_task_success: false,
              on_resource_non_compliance: true,
              on_runbook_newer_version: true,
              on_job_success: false,
              on_job_start: true,
              on_job_canceled: true,
              on_job_schedule_change: true
            )
        )
      ],
      is_target_auto_confirm: true,
      resource_selection:
        OCI::FleetAppsManagement::Models::ManualResourceSelection.new(
          resource_selection_type: 'MANUAL'
        ),
      products: %w[EXAMPLE--Value],
      freeform_tags: {
        'EXAMPLE_KEY_8oLoH' => 'EXAMPLE_VALUE_HamVfJgsmEBgutKNVe34'
      },
      defined_tags: {
        'EXAMPLE_KEY_zuwjT' => { 'EXAMPLE_KEY_QZf8P' => 'EXAMPLE--Value' }
      },
      environment_type: 'EXAMPLE-environmentType-Value'
    )
  )

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