
#nullable enable

namespace Google.Gemini
{
    /// <summary>
    /// Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.
    /// </summary>
    public sealed partial class ExecutableCode
    {
        /// <summary>
        /// Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("id")]
        public string? Id { get; set; }

        /// <summary>
        /// Required. The code to be executed.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("code")]
        public string? Code { get; set; }

        /// <summary>
        /// Required. Programming language of the `code`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("language")]
        [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.ExecutableCodeLanguageJsonConverter))]
        public global::Google.Gemini.ExecutableCodeLanguage? Language { get; set; }

        /// <summary>
        /// Additional properties that are not explicitly defined in the schema
        /// </summary>
        [global::System.Text.Json.Serialization.JsonExtensionData]
        public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();

        /// <summary>
        /// Initializes a new instance of the <see cref="ExecutableCode" /> class.
        /// </summary>
        /// <param name="id">
        /// Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`.
        /// </param>
        /// <param name="code">
        /// Required. The code to be executed.
        /// </param>
        /// <param name="language">
        /// Required. Programming language of the `code`.
        /// </param>
#if NET7_0_OR_GREATER
        [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
        public ExecutableCode(
            string? id,
            string? code,
            global::Google.Gemini.ExecutableCodeLanguage? language)
        {
            this.Id = id;
            this.Code = code;
            this.Language = language;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ExecutableCode" /> class.
        /// </summary>
        public ExecutableCode()
        {
        }

    }
}