// 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 SqlSslCertsService
  import Foundation
  #if canImport(FoundationNetworking)
    import FoundationNetworking
  #endif
  import GoogleCloudWkt
  import GoogleCloudGax

  /// Service to manage SSL certs for Cloud SQL instances.
  ///
  /// @Snippet(path: "SqlSslCertsServiceQuickstart")
  public class SqlSslCertsServiceClient: Clients.SqlSslCertsServiceProtocol {
    let inner: any Clients.SqlSslCertsServiceStub

    /// Creates a new `SqlSslCertsServiceClient` instance.
    public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
      var inner: any Clients.SqlSslCertsServiceStub = try Clients.SqlSslCertsServiceTransport(
        options)
      inner = Clients.SqlSslCertsServiceRetry(inner, options: options)
      if let logger = options.logger {
        inner = Clients.SqlSslCertsServiceLogging(inner, logger: logger)
      }
      self.inner = inner
    }

    /// Deletes the SSL certificate. For First Generation instances, the
    /// certificate remains valid until the instance is restarted.
    ///
    /// @Snippet(path: "SqlSslCertsService_Delete")
    public func delete(
      request: SqlSslCertsDeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.Operation {
      try await self.inner.delete(request: request, options: options)
    }

    /// Retrieves a particular SSL certificate.  Does not include the private key
    /// (required for usage).  The private key must be saved from the response to
    /// initial creation.
    ///
    /// @Snippet(path: "SqlSslCertsService_Get")
    public func `get`(
      request: SqlSslCertsGetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCert {
      try await self.inner.`get`(request: request, options: options)
    }

    /// Creates an SSL certificate and returns it along with the private key and
    /// server certificate authority.  The new certificate will not be usable until
    /// the instance is restarted.
    ///
    /// @Snippet(path: "SqlSslCertsService_Insert")
    public func insert(
      request: SqlSslCertsInsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCertsInsertResponse {
      try await self.inner.insert(request: request, options: options)
    }

    /// Lists all of the current SSL certificates for the instance.
    ///
    /// @Snippet(path: "SqlSslCertsService_List")
    public func list(
      request: SqlSslCertsListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCertsListResponse {
      try await self.inner.list(request: request, options: options)
    }
  }

  extension Clients {
    /// A Swift protocol to mock `SqlSslCertsServiceClient`.
    ///
    /// To mock `SqlSslCertsServiceClient` change your functions to receive
    /// `some SqlSslCertsServiceProtocol` or `any SqlSslCertsServiceProtocol`
    /// and pass a mock implementation in your tests.
    public protocol SqlSslCertsServiceProtocol {
      /// See `SqlSslCertsServiceClient.delete`.
      func delete(request: SqlSslCertsDeleteRequest) async throws -> GoogleCloudSqlV1.Operation

      /// See `SqlSslCertsServiceClient.`get``.
      func `get`(request: SqlSslCertsGetRequest) async throws -> GoogleCloudSqlV1.SslCert

      /// See `SqlSslCertsServiceClient.insert`.
      func insert(request: SqlSslCertsInsertRequest) async throws
        -> GoogleCloudSqlV1.SslCertsInsertResponse

      /// See `SqlSslCertsServiceClient.list`.
      func list(request: SqlSslCertsListRequest) async throws
        -> GoogleCloudSqlV1.SslCertsListResponse

      /// See `SqlSslCertsServiceClient.delete`.
      func delete(
        request: SqlSslCertsDeleteRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudSqlV1.Operation

      /// See `SqlSslCertsServiceClient.`get``.
      func `get`(
        request: SqlSslCertsGetRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudSqlV1.SslCert

      /// See `SqlSslCertsServiceClient.insert`.
      func insert(
        request: SqlSslCertsInsertRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudSqlV1.SslCertsInsertResponse

      /// See `SqlSslCertsServiceClient.list`.
      func list(
        request: SqlSslCertsListRequest, options: GoogleCloudGax.RequestOptions
      ) async throws -> GoogleCloudSqlV1.SslCertsListResponse
    }
  }

  // Default implementations
  extension Clients.SqlSslCertsServiceProtocol {
    public func delete(request: SqlSslCertsDeleteRequest) async throws -> GoogleCloudSqlV1.Operation
    {
      try await self.delete(request: request, options: .init())
    }

    public func delete(
      request: SqlSslCertsDeleteRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.Operation {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func `get`(request: SqlSslCertsGetRequest) async throws -> GoogleCloudSqlV1.SslCert {
      try await self.`get`(request: request, options: .init())
    }

    public func `get`(
      request: SqlSslCertsGetRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCert {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func insert(request: SqlSslCertsInsertRequest) async throws
      -> GoogleCloudSqlV1.SslCertsInsertResponse
    {
      try await self.insert(request: request, options: .init())
    }

    public func insert(
      request: SqlSslCertsInsertRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCertsInsertResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }

    public func list(request: SqlSslCertsListRequest) async throws
      -> GoogleCloudSqlV1.SslCertsListResponse
    {
      try await self.list(request: request, options: .init())
    }

    public func list(
      request: SqlSslCertsListRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudSqlV1.SslCertsListResponse {
      throw GoogleCloudGax.RequestError.unimplemented
    }
  }
#endif
