# 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 oci
from datetime import datetime

# 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.config.from_file()


# Initialize service client with default config file
operator_access_control_client = oci.operator_access_control.OperatorControlAssignmentClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_operator_control_assignment_response = operator_access_control_client.update_operator_control_assignment(
    operator_control_assignment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-operatorControlAssignmentId-Value",
    update_operator_control_assignment_details=oci.operator_access_control.models.UpdateOperatorControlAssignmentDetails(
        is_enforced_always=True,
        time_assignment_from=datetime.strptime(
            "2020-11-20T15:20:05.381Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_assignment_to=datetime.strptime(
            "2021-11-18T03:16:40.575Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        comment="EXAMPLE-comment-Value",
        is_log_forwarded=True,
        remote_syslog_server_address="EXAMPLE-remoteSyslogServerAddress-Value",
        remote_syslog_server_port=774,
        remote_syslog_server_ca_cert="EXAMPLE-remoteSyslogServerCACert-Value",
        is_hypervisor_log_forwarded=True,
        is_auto_approve_during_maintenance=False,
        freeform_tags={
            'EXAMPLE_KEY_a6mEW': 'EXAMPLE_VALUE_bpPNjR7NMssq2XgEqNDA'},
        defined_tags={
            'EXAMPLE_KEY_80o8b': {
                'EXAMPLE_KEY_k8UfU': 'EXAMPLE--Value'}}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="98XDCSFMBKZJEBGB2OXR<unique_ID>")

# Get the data from response
print(update_operator_control_assignment_response.data)