// Generated by @typespec/http-server-csharp
// <auto-generated />
#nullable enable

using Microsoft.AspNetCore.Mvc;
using PetStore;
using System;
using System.Net;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace PetStore.Controllers;

[ApiController]
public partial class DogsController : ControllerBase
{
    internal virtual IDogs DogsImpl { get; }
    public DogsController(IDogs operations)
    {
        DogsImpl = operations;
    }

    /// <summary>
    /// List all dogs
    /// </summary>
    [HttpGet]
    [Route("/dogs")]
    [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(Dog[]))]
    public virtual async Task<IActionResult> List()
    {
        var result = await DogsImpl.ListAsync();
        return Ok(result);
    }

    /// <summary>
    /// Get a dog by ID
    /// </summary>
    [HttpGet]
    [Route("/dogs/{id}")]
    [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(Dog))]
    public virtual async Task<IActionResult> Read(long id)
    {
        var result = await DogsImpl.ReadAsync(id);
        return Ok(result);
    }
}
