# 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
generative_ai_agent_client =
  OCI::GenerativeAiAgent::GenerativeAiAgentClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_tool_response =
  generative_ai_agent_client.update_tool(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-toolId-Value',
    OCI::GenerativeAiAgent::Models::UpdateToolDetails.new(
      display_name: 'EXAMPLE-displayName-Value',
      description: 'EXAMPLE-description-Value',
      tool_config:
        OCI::GenerativeAiAgent::Models::HttpEndpointToolConfig.new(
          tool_config_type: 'HTTP_ENDPOINT_TOOL_CONFIG',
          api_schema:
            OCI::GenerativeAiAgent::Models::ApiSchemaInlineInputLocation.new(
              api_schema_input_location_type: 'INLINE',
              content: 'EXAMPLE-content-Value'
            ),
          subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
          http_endpoint_auth_config:
            OCI::GenerativeAiAgent::Models::HttpEndpointAuthConfig.new(
              http_endpoint_auth_sources: [
                OCI::GenerativeAiAgent::Models::HttpEndpointAuthSource.new(
                  http_endpoint_auth_scope: 'AGENT',
                  http_endpoint_auth_scope_config:
                    OCI::GenerativeAiAgent::Models::HttpEndpointBasicAuthScopeConfig
                      .new(
                      http_endpoint_auth_scope_config_type:
                        'HTTP_ENDPOINT_BASIC_AUTH_SCOPE_CONFIG',
                      vault_secret_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-vaultSecretId-Value'
                    )
                )
              ]
            )
        ),
      metadata: { 'EXAMPLE_KEY_Q3uUb' => 'EXAMPLE_VALUE_YGgJ9lMFIEugCoFJLcdC' },
      freeform_tags: {
        'EXAMPLE_KEY_5R9tM' => 'EXAMPLE_VALUE_V5JMDYMEyyU7RpkOYwWn'
      },
      defined_tags: {
        'EXAMPLE_KEY_vx990' => { 'EXAMPLE_KEY_K5gcj' => 'EXAMPLE--Value' }
      }
    )
  )

# Get the data from response
puts "#{update_tool_response.headers}"