// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if ImageFamilyViews
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudWkt
  import GoogleCloudGax

  /// Service for the `imageFamilyViews` resource.
  ///
  /// @Snippet(path: "imageFamilyViewsQuickstart")
  public class ImageFamilyViewsClient: Clients.ImageFamilyViewsProtocol {
    let inner: any Clients.ImageFamilyViewsStub

    /// Creates a new `ImageFamilyViewsClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.ImageFamilyViewsStub = try Clients.ImageFamilyViewsTransport(options)
      inner = Clients.ImageFamilyViewsRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.ImageFamilyViewsLogging(inner, logger: logger)
      }
      self.inner = inner
    }

    /// Returns the latest image that is part of an image family, is not
    /// deprecated and is rolled out in the specified zone.
    ///
    /// @Snippet(path: "imageFamilyViews_get")
    public func `get`(
      request: ImageFamilyViewsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.ImageFamilyView {
      try await self.inner.`get`(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `ImageFamilyViewsClient`.
    ///
    /// To mock `ImageFamilyViewsClient` change your functions to receive
    /// `some ImageFamilyViewsProtocol` or `any ImageFamilyViewsProtocol`
    /// and pass a mock implementation in your tests.
    public protocol ImageFamilyViewsProtocol {
      /// See `ImageFamilyViewsClient.`get``.
      func `get`(request: ImageFamilyViewsClient.GetRequest) async throws
        -> GoogleCloudComputeV1.ImageFamilyView

      /// See `ImageFamilyViewsClient.`get``.
      func `get`(
        project: Swift.String,
        zone: Swift.String,
        family: Swift.String,
      ) async throws -> GoogleCloudComputeV1.ImageFamilyView

      /// See `ImageFamilyViewsClient.`get``.
      func `get`(
        request: ImageFamilyViewsClient.GetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudComputeV1.ImageFamilyView
    }
  }

  // Default implementations
  extension Clients.ImageFamilyViewsProtocol {
    public func `get`(request: ImageFamilyViewsClient.GetRequest) async throws
      -> GoogleCloudComputeV1.ImageFamilyView
    {
      try await self.`get`(request: request, options: .init())
    }

    public func `get`(
      request: ImageFamilyViewsClient.GetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudComputeV1.ImageFamilyView {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func `get`(
      project: Swift.String,
      zone: Swift.String,
      family: Swift.String,
    ) async throws -> GoogleCloudComputeV1.ImageFamilyView {
      let request = ImageFamilyViewsClient.GetRequest().with {
        $0.project = project
        $0.zone = zone
        $0.family = family
      }
      return try await self.`get`(request: request)
    }
  }
#endif
