
#nullable enable

namespace Google.Gemini
{
    /// <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>
    public sealed partial class FunctionResponse
    {
        /// <summary>
        /// Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("parts")]
        public global::System.Collections.Generic.IList<global::Google.Gemini.FunctionResponsePart>? Parts { get; set; }

        /// <summary>
        /// Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("willContinue")]
        public bool? WillContinue { get; set; }

        /// <summary>
        /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("name")]
        public string? Name { get; set; }

        /// <summary>
        /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. Multimedia can be included by using a subobject containing a single "$ref" key whose value is the `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See https://ai.google.dev/gemini-api/docs/function-calling#multimodal.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("response")]
        public object? Response { get; set; }

        /// <summary>
        /// Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("scheduling")]
        [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Google.Gemini.JsonConverters.FunctionResponseSchedulingJsonConverter))]
        public global::Google.Gemini.FunctionResponseScheduling? Scheduling { get; set; }

        /// <summary>
        /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.
        /// </summary>
        [global::System.Text.Json.Serialization.JsonPropertyName("id")]
        public string? Id { 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="FunctionResponse" /> class.
        /// </summary>
        /// <param name="parts">
        /// Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
        /// </param>
        /// <param name="willContinue">
        /// Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.
        /// </param>
        /// <param name="name">
        /// Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 128.
        /// </param>
        /// <param name="response">
        /// Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model. Multimedia can be included by using a subobject containing a single "$ref" key whose value is the `inline_data.display_name` of a `FunctionResponsePart` holding the multimedia. See https://ai.google.dev/gemini-api/docs/function-calling#multimodal.
        /// </param>
        /// <param name="scheduling">
        /// Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
        /// </param>
        /// <param name="id">
        /// Optional. The identifier of the function call this response is for. Populated by the client to match the corresponding function call `id`.
        /// </param>
#if NET7_0_OR_GREATER
        [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
        public FunctionResponse(
            global::System.Collections.Generic.IList<global::Google.Gemini.FunctionResponsePart>? parts,
            bool? willContinue,
            string? name,
            object? response,
            global::Google.Gemini.FunctionResponseScheduling? scheduling,
            string? id)
        {
            this.Parts = parts;
            this.WillContinue = willContinue;
            this.Name = name;
            this.Response = response;
            this.Scheduling = scheduling;
            this.Id = id;
        }

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

    }
}