
#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Google.Gemini
{
    /// <summary>
    /// A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
    /// </summary>
    public sealed partial class Part
    {
        /// <summary>
        /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("partMetadata")]
        public object? PartMetadata { get; set; }

        /// <summary>
        /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("toolResponse")]
        public global::Google.Gemini.ToolResponse? ToolResponse { get; set; }

        /// <summary>
        /// Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("thoughtSignature")]
        public byte[]? ThoughtSignature { get; set; }

        /// <summary>
        /// URI based data.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("fileData")]
        public global::Google.Gemini.FileData? FileData { get; set; }

        /// <summary>
        /// Inline text.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("text")]
        public string? Text { get; set; }

        /// <summary>
        /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("functionResponse")]
        public global::Google.Gemini.FunctionResponse? FunctionResponse { get; set; }

        /// <summary>
        /// Deprecated: Use `GenerateContentRequest.processing_options` instead. Metadata describes the input video content.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("videoMetadata")]
        [global::System.Obsolete("This property marked as deprecated.")]
        public global::Google.Gemini.VideoMetadata? VideoMetadata { get; set; }

        /// <summary>
        /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("functionCall")]
        public global::Google.Gemini.FunctionCall? FunctionCall { get; set; }

        /// <summary>
        /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("toolCall")]
        public global::Google.Gemini.ToolCall? ToolCall { get; set; }

        /// <summary>
        /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("inlineData")]
        public global::Google.Gemini.Blob? InlineData { get; set; }

        /// <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>
        [global::System.Text.Json.Serialization.JsonPropertyName("executableCode")]
        public global::Google.Gemini.ExecutableCode? ExecutableCode { get; set; }

        /// <summary>
        /// Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("codeExecutionResult")]
        public global::Google.Gemini.CodeExecutionResult? CodeExecutionResult { get; set; }

        /// <summary>
        /// Optional. Indicates if the part is thought from the model.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("thought")]
        public bool? Thought { 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="Part" /> class.
        /// </summary>
        /// <param name="partMetadata">
        /// Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams.
        /// </param>
        /// <param name="toolResponse">
        /// The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.
        /// </param>
        /// <param name="thoughtSignature">
        /// Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        /// </param>
        /// <param name="fileData">
        /// URI based data.
        /// </param>
        /// <param name="text">
        /// Inline text.
        /// </param>
        /// <param name="functionResponse">
        /// The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.
        /// </param>
        /// <param name="functionCall">
        /// A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.
        /// </param>
        /// <param name="toolCall">
        /// A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.
        /// </param>
        /// <param name="inlineData">
        /// Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.
        /// </param>
        /// <param name="executableCode">
        /// 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.
        /// </param>
        /// <param name="codeExecutionResult">
        /// Result of executing the `ExecutableCode`. Generated only when the `CodeExecution` tool is used.
        /// </param>
        /// <param name="thought">
        /// Optional. Indicates if the part is thought from the model.
        /// </param>
#if NET7_0_OR_GREATER
        [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
        public Part(
            object? partMetadata,
            global::Google.Gemini.ToolResponse? toolResponse,
            byte[]? thoughtSignature,
            global::Google.Gemini.FileData? fileData,
            string? text,
            global::Google.Gemini.FunctionResponse? functionResponse,
            global::Google.Gemini.FunctionCall? functionCall,
            global::Google.Gemini.ToolCall? toolCall,
            global::Google.Gemini.Blob? inlineData,
            global::Google.Gemini.ExecutableCode? executableCode,
            global::Google.Gemini.CodeExecutionResult? codeExecutionResult,
            bool? thought)
        {
            this.PartMetadata = partMetadata;
            this.ToolResponse = toolResponse;
            this.ThoughtSignature = thoughtSignature;
            this.FileData = fileData;
            this.Text = text;
            this.FunctionResponse = functionResponse;
            this.FunctionCall = functionCall;
            this.ToolCall = toolCall;
            this.InlineData = inlineData;
            this.ExecutableCode = executableCode;
            this.CodeExecutionResult = codeExecutionResult;
            this.Thought = thought;
        }

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

    }
}