# frozen_string_literal: true

# Copyright 2023 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.

# Auto-generated by gapic-generator-ruby. DO NOT EDIT!

require "gapic/rest"

module Google
  module Cloud
    module GkeBackup
      ##
      # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
      #
      #     require "google/cloud/gke_backup/v1/rest"
      #     client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new
      #
      module V1
        ##
        # @private
        # Initialize the mixin bindings configuration
        #
        def self.configure
          @configure ||= begin
            namespace = ["Google", "Cloud", "GkeBackup"]
            parent_config = while namespace.any?
                              parent_name = namespace.join "::"
                              parent_const = const_get parent_name
                              break parent_const.configure if parent_const.respond_to? :configure
                              namespace.pop
                            end

            default_config = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config
            default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{name}",
                matches: [
                  ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
                ],
                body: nil
              )
            ]
            default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [

              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{name}/locations",
                matches: [
                  ["name", %r{^projects/[^/]+/?$}, false]
                ],
                body: nil
              )
            ]
            default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [

              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false]
                ],
                body: nil
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/?$}, false]
                ],
                body: nil
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/volumeBackups/[^/]+/?$}, false]
                ],
                body: nil
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/?$}, false]
                ],
                body: nil
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/?$}, false]
                ],
                body: nil
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :get,
                uri_template: "/v1/{resource}:getIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/volumeRestores/[^/]+/?$}, false]
                ],
                body: nil
              )
            ]
            default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [

              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/volumeBackups/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:setIamPolicy",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/volumeRestores/[^/]+/?$}, false]
                ],
                body: "*"
              )
            ]
            default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [

              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/backupPlans/[^/]+/backups/[^/]+/volumeBackups/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/?$}, false]
                ],
                body: "*"
              ),
              Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
                uri_method: :post,
                uri_template: "/v1/{resource}:testIamPermissions",
                matches: [
                  ["resource", %r{^projects/[^/]+/locations/[^/]+/restorePlans/[^/]+/restores/[^/]+/volumeRestores/[^/]+/?$}, false]
                ],
                body: "*"
              )
            ]
            default_config
          end
          yield @configure if block_given?
          @configure
        end
      end
    end
  end
end
