# 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
dif_client = OCI::Dif::StackClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
add_service_response =
  dif_client.add_service(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-stackId-Value',
    OCI::Dif::Models::AddServiceDetails.new(
      stack_templates: %w[AISERVICES],
      services: %w[OMK],
      adb: [
        OCI::Dif::Models::AdbDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          db_workload: 'DW',
          ecpu: 873,
          data_storage_size_in_tbs: 544,
          admin_password_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-adminPasswordId-Value',
          db_version: 'EXAMPLE-dbVersion-Value',
          is_mtls_connection_required: false,
          subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
          tools_public_access: 'EXAMPLE-toolsPublicAccess-Value',
          is_public: true
        )
      ],
      ggcs: [
        OCI::Dif::Models::GgcsDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          ocpu: 455,
          subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
          password_secret_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value',
          public_subnet_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-publicSubnetId-Value',
          ogg_version: 'EXAMPLE-oggVersion-Value',
          connections: [
            OCI::Dif::Models::GgcsConnectionDetails.new(
              connection_name: 'EXAMPLE-connectionName-Value',
              dif_dependencies: [
                OCI::Dif::Models::DifDependencyDetails.new(
                  service_type: 'EXAMPLE-serviceType-Value',
                  service_instance_id:
                    'ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value'
                )
              ],
              gg_admin_secret_id:
                'ocid1.test.oc1..<unique_ID>EXAMPLE-ggAdminSecretId-Value',
              connection_id:
                'ocid1.test.oc1..<unique_ID>EXAMPLE-connectionId-Value'
            )
          ]
        )
      ],
      dataflow: [
        OCI::Dif::Models::DataflowDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          spark_version: 'EXAMPLE-sparkVersion-Value',
          driver_shape: 'EXAMPLE-driverShape-Value',
          executor_shape: 'EXAMPLE-executorShape-Value',
          num_executors: 913,
          log_bucket_instance_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-logBucketInstanceId-Value',
          driver_shape_config:
            OCI::Dif::Models::ShapeConfig.new(memory_in_gbs: 430, ocpus: 861),
          executor_shape_config:
            OCI::Dif::Models::ShapeConfig.new(memory_in_gbs: 778, ocpus: 452),
          private_endpoint_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value',
          connections:
            OCI::Dif::Models::DataflowConnections.new(
              subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
              connection_details:
                OCI::Dif::Models::DataflowConnectionDetails.new(
                  dif_dependencies: [
                    OCI::Dif::Models::DifDependencyDetails.new(
                      service_type: 'EXAMPLE-serviceType-Value',
                      service_instance_id:
                        'ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value'
                    )
                  ],
                  domain_names: %w[EXAMPLE--Value]
                )
            ),
          warehouse_bucket_instance_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-warehouseBucketInstanceId-Value'
        )
      ],
      objectstorage: [
        OCI::Dif::Models::ObjectStorageDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          object_versioning: 'ENABLED',
          storage_tier: 'ARCHIVE',
          auto_tiering: 'INFREQUENTACCESS'
        )
      ],
      genai: [
        OCI::Dif::Models::GenAiDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          cluster_type: 'HOSTING',
          base_model: 'EXAMPLE-baseModel-Value',
          oci_region: 'EXAMPLE-ociRegion-Value',
          unit_count: 67,
          endpoints: [
            OCI::Dif::Models::EndpointDetails.new(
              endpoint_name: 'EXAMPLE-endpointName-Value',
              is_content_moderation_enabled: true
            )
          ]
        )
      ],
      aidataplatform: [
        OCI::Dif::Models::AiDataPlatformDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          default_workspace_name: 'EXAMPLE-defaultWorkspaceName-Value'
        )
      ],
      omk: [
        OCI::Dif::Models::OmkDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          cluster_namespace_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterNamespaceId-Value',
          cluster_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value',
          namespace_name: 'EXAMPLE-namespaceName-Value'
        )
      ],
      oke: [
        OCI::Dif::Models::OkeDetail.new(
          instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
          cluster_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value',
          namespace_name: 'EXAMPLE-namespaceName-Value'
        )
      ]
    )
  )

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