// 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.

import Foundation
#if canImport(FoundationNetworking)
  import FoundationNetworking
#endif
import GoogleCloudLocation
import GoogleCloudWkt
import GoogleLongRunning
import GoogleCloudGax

/// This service provides all methods related to the 1p Linter.
///
/// @Snippet(path: "LintingServiceQuickstart")
public class LintingServiceClient: Clients.LintingServiceProtocol {
  let inner: any Clients.LintingServiceStub

  /// Creates a new `LintingServiceClient` instance.
  public init(_ options: GoogleCloudGax.ClientOptions = .init()) throws {
    var inner: any Clients.LintingServiceStub = try Clients.LintingServiceTransport(options)
    inner = Clients.LintingServiceRetry(inner, options: options)
    if let logger = options.logger {
      inner = Clients.LintingServiceLogging(inner, logger: logger)
    }
    self.inner = inner
  }

  /// Get the style guide being used for linting.
  ///
  /// @Snippet(path: "LintingService_GetStyleGuide")
  public func getStyleGuide(
    request: GetStyleGuideRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    try await self.inner.getStyleGuide(request: request, options: options)
  }

  /// Update the styleGuide to be used for liniting in by API hub.
  ///
  /// @Snippet(path: "LintingService_UpdateStyleGuide")
  public func updateStyleGuide(
    request: UpdateStyleGuideRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    try await self.inner.updateStyleGuide(request: request, options: options)
  }

  /// Get the contents of the style guide.
  ///
  /// @Snippet(path: "LintingService_GetStyleGuideContents")
  public func getStyleGuideContents(
    request: GetStyleGuideContentsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuideContents {
    try await self.inner.getStyleGuideContents(request: request, options: options)
  }

  /// Lints the requested spec and updates the corresponding API Spec with the
  /// lint response. This lint response will be available in all subsequent
  /// Get and List Spec calls to Core service.
  ///
  /// @Snippet(path: "LintingService_LintSpec")
  public func lintSpec(
    request: LintSpecRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.lintSpec(request: request, options: options)
  }

  /// Lists information about the supported locations for this service.
  ///
  /// @Snippet(path: "LintingService_ListLocations")
  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    try await self.inner.listLocations(request: request, options: options)
  }

  /// Lists information about the supported locations for this service.
  ///
  /// @Snippet(path: "LintingService_ListLocations")
  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listLocations(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Gets information about a location.
  ///
  /// @Snippet(path: "LintingService_GetLocation")
  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    try await self.inner.getLocation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "LintingService_ListOperations")
  public func listOperations(
    request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.ListOperationsResponse {
    try await self.inner.listOperations(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "LintingService_ListOperations")
  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleLongRunning.ListOperationsResponse in
      var request = byItem
      request.pageToken = token
      return try await self.listOperations(request: request, options: options)
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "LintingService_GetOperation")
  func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    try await self.inner.getOperation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "LintingService_DeleteOperation")
  public func deleteOperation(
    request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.deleteOperation(request: request, options: options)
  }

  /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
  ///
  /// [google.longrunning.Operations]: https://www.google.com/search?q=Swift+google.longrunning+Operations
  ///
  /// @Snippet(path: "LintingService_CancelOperation")
  public func cancelOperation(
    request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    try await self.inner.cancelOperation(request: request, options: options)
  }
}

extension Clients {
  /// A Swift protocol to mock `LintingServiceClient`.
  ///
  /// To mock `LintingServiceClient` change your functions to receive
  /// `some LintingServiceProtocol` or `any LintingServiceProtocol`
  /// and pass a mock implementation in your tests.
  public protocol LintingServiceProtocol {
    /// See `LintingServiceClient.getStyleGuide`.
    func getStyleGuide(request: GetStyleGuideRequest) async throws -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.getStyleGuide`.
    func getStyleGuide(
      name: Swift.String,
    ) async throws -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.updateStyleGuide`.
    func updateStyleGuide(request: UpdateStyleGuideRequest) async throws
      -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.updateStyleGuide`.
    func updateStyleGuide(
      styleGuide: StyleGuide?,
      updateMask: GoogleCloudWkt.FieldMask?,
    ) async throws -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.getStyleGuideContents`.
    func getStyleGuideContents(request: GetStyleGuideContentsRequest) async throws
      -> GoogleCloudApiHubV1.StyleGuideContents

    /// See `LintingServiceClient.getStyleGuideContents`.
    func getStyleGuideContents(
      name: Swift.String,
    ) async throws -> GoogleCloudApiHubV1.StyleGuideContents

    /// See `LintingServiceClient.lintSpec`.
    func lintSpec(request: LintSpecRequest) async throws

    /// See `LintingServiceClient.listLocations`.
    func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
      -> GoogleCloudLocation.ListLocationsResponse

    /// See `LintingServiceClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `LintingServiceClient.getLocation`.
    func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
      -> GoogleCloudLocation.Location

    /// See `LintingServiceClient.listOperations`.
    func listOperations(request: GoogleLongRunning.ListOperationsRequest) async throws
      -> GoogleLongRunning.ListOperationsResponse

    /// See `LintingServiceClient.listOperations`.
    func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `LintingServiceClient.listOperations`.
    func listOperations(
      name: Swift.String,
      filter: Swift.String,
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `LintingServiceClient.deleteOperation`.
    func deleteOperation(request: GoogleLongRunning.DeleteOperationRequest) async throws

    /// See `LintingServiceClient.deleteOperation`.
    func deleteOperation(
      name: Swift.String,
    ) async throws

    /// See `LintingServiceClient.cancelOperation`.
    func cancelOperation(request: GoogleLongRunning.CancelOperationRequest) async throws

    /// See `LintingServiceClient.cancelOperation`.
    func cancelOperation(
      name: Swift.String,
    ) async throws

    /// See `LintingServiceClient.getStyleGuide`.
    func getStyleGuide(
      request: GetStyleGuideRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.updateStyleGuide`.
    func updateStyleGuide(
      request: UpdateStyleGuideRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudApiHubV1.StyleGuide

    /// See `LintingServiceClient.getStyleGuideContents`.
    func getStyleGuideContents(
      request: GetStyleGuideContentsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudApiHubV1.StyleGuideContents

    /// See `LintingServiceClient.lintSpec`.
    func lintSpec(
      request: LintSpecRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `LintingServiceClient.listLocations`.
    func listLocations(
      request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.ListLocationsResponse

    /// See `LintingServiceClient.listLocations`.
    func listLocations(
      byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error>

    /// See `LintingServiceClient.getLocation`.
    func getLocation(
      request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleCloudLocation.Location

    /// See `LintingServiceClient.listOperations`.
    func listOperations(
      request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) async throws -> GoogleLongRunning.ListOperationsResponse

    /// See `LintingServiceClient.listOperations`.
    func listOperations(
      byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
    ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error>

    /// See `LintingServiceClient.deleteOperation`.
    func deleteOperation(
      request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws

    /// See `LintingServiceClient.cancelOperation`.
    func cancelOperation(
      request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
    ) async throws
  }
}

// Default implementations
extension Clients.LintingServiceProtocol {
  public func getStyleGuide(request: GetStyleGuideRequest) async throws
    -> GoogleCloudApiHubV1.StyleGuide
  {
    try await self.getStyleGuide(request: request, options: .init())
  }

  public func getStyleGuide(
    request: GetStyleGuideRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getStyleGuide(
    name: Swift.String,
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    let request = GetStyleGuideRequest().with {
      $0.name = name
    }
    return try await self.getStyleGuide(request: request)
  }

  public func updateStyleGuide(request: UpdateStyleGuideRequest) async throws
    -> GoogleCloudApiHubV1.StyleGuide
  {
    try await self.updateStyleGuide(request: request, options: .init())
  }

  public func updateStyleGuide(
    request: UpdateStyleGuideRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func updateStyleGuide(
    styleGuide: StyleGuide?,
    updateMask: GoogleCloudWkt.FieldMask?,
  ) async throws -> GoogleCloudApiHubV1.StyleGuide {
    let request = UpdateStyleGuideRequest().with {
      $0.styleGuide = styleGuide
      $0.updateMask = updateMask
    }
    return try await self.updateStyleGuide(request: request)
  }

  public func getStyleGuideContents(request: GetStyleGuideContentsRequest) async throws
    -> GoogleCloudApiHubV1.StyleGuideContents
  {
    try await self.getStyleGuideContents(request: request, options: .init())
  }

  public func getStyleGuideContents(
    request: GetStyleGuideContentsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudApiHubV1.StyleGuideContents {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getStyleGuideContents(
    name: Swift.String,
  ) async throws -> GoogleCloudApiHubV1.StyleGuideContents {
    let request = GetStyleGuideContentsRequest().with {
      $0.name = name
    }
    return try await self.getStyleGuideContents(request: request)
  }

  public func lintSpec(request: LintSpecRequest) async throws {
    try await self.lintSpec(request: request, options: .init())
  }

  public func lintSpec(
    request: LintSpecRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listLocations(request: GoogleCloudLocation.ListLocationsRequest) async throws
    -> GoogleCloudLocation.ListLocationsResponse
  {
    try await self.listLocations(request: request, options: .init())
  }

  public func listLocations(
    request: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.ListLocationsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    try self.listLocations(byItem: byItem, options: .init())
  }

  public func listLocations(
    byItem: GoogleCloudLocation.ListLocationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleCloudLocation.Location, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleCloudLocation.ListLocationsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func getLocation(request: GoogleCloudLocation.GetLocationRequest) async throws
    -> GoogleCloudLocation.Location
  {
    try await self.getLocation(request: request, options: .init())
  }

  public func getLocation(
    request: GoogleCloudLocation.GetLocationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleCloudLocation.Location {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listOperations(request: GoogleLongRunning.ListOperationsRequest) async throws
    -> GoogleLongRunning.ListOperationsResponse
  {
    try await self.listOperations(request: request, options: .init())
  }

  public func listOperations(
    request: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.ListOperationsResponse {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    try self.listOperations(byItem: byItem, options: .init())
  }

  public func listOperations(
    byItem: GoogleLongRunning.ListOperationsRequest, options: GoogleCloudGax.RequestOptions
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let listRpc = {
      (token: Swift.String) async throws -> GoogleLongRunning.ListOperationsResponse in
      throw GoogleCloudGax.RequestError.unimplemented
    }
    return GoogleCloudGax.PaginatedResponseSequence(listRpc: listRpc)
  }

  public func listOperations(
    name: Swift.String,
    filter: Swift.String,
  ) throws -> any AsyncSequence<GoogleLongRunning.Operation, Swift.Error> {
    let request = GoogleLongRunning.ListOperationsRequest().with {
      $0.name = name
      $0.filter = filter
    }
    return try self.listOperations(byItem: request)
  }

  public func getOperation(request: GoogleLongRunning.GetOperationRequest) async throws
    -> GoogleLongRunning.Operation
  {
    try await self.getOperation(request: request, options: .init())
  }

  public func getOperation(
    request: GoogleLongRunning.GetOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws -> GoogleLongRunning.Operation {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func getOperation(
    name: Swift.String,
  ) async throws -> GoogleLongRunning.Operation {
    let request = GoogleLongRunning.GetOperationRequest().with {
      $0.name = name
    }
    return try await self.getOperation(request: request)
  }

  public func deleteOperation(request: GoogleLongRunning.DeleteOperationRequest) async throws {
    try await self.deleteOperation(request: request, options: .init())
  }

  public func deleteOperation(
    request: GoogleLongRunning.DeleteOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func deleteOperation(
    name: Swift.String,
  ) async throws {
    let request = GoogleLongRunning.DeleteOperationRequest().with {
      $0.name = name
    }
    try await self.deleteOperation(request: request)
  }

  public func cancelOperation(request: GoogleLongRunning.CancelOperationRequest) async throws {
    try await self.cancelOperation(request: request, options: .init())
  }

  public func cancelOperation(
    request: GoogleLongRunning.CancelOperationRequest, options: GoogleCloudGax.RequestOptions
  ) async throws {
    throw GoogleCloudGax.RequestError.unimplemented
  }

  public func cancelOperation(
    name: Swift.String,
  ) async throws {
    let request = GoogleLongRunning.CancelOperationRequest().with {
      $0.name = name
    }
    try await self.cancelOperation(request: request)
  }
}
