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

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.24.4
// source: google/chromeos/moblab/v1beta1/build_service.proto

package moblab

import (
	context "context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

const (
	BuildService_ListBuildTargets_FullMethodName      = "/google.chromeos.moblab.v1beta1.BuildService/ListBuildTargets"
	BuildService_ListModels_FullMethodName            = "/google.chromeos.moblab.v1beta1.BuildService/ListModels"
	BuildService_ListBuilds_FullMethodName            = "/google.chromeos.moblab.v1beta1.BuildService/ListBuilds"
	BuildService_CheckBuildStageStatus_FullMethodName = "/google.chromeos.moblab.v1beta1.BuildService/CheckBuildStageStatus"
	BuildService_StageBuild_FullMethodName            = "/google.chromeos.moblab.v1beta1.BuildService/StageBuild"
	BuildService_FindMostStableBuild_FullMethodName   = "/google.chromeos.moblab.v1beta1.BuildService/FindMostStableBuild"
)

// BuildServiceClient is the client API for BuildService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BuildServiceClient interface {
	// Lists all build targets that a user has access to.
	ListBuildTargets(ctx context.Context, in *ListBuildTargetsRequest, opts ...grpc.CallOption) (*ListBuildTargetsResponse, error)
	// Lists all models for the given build target.
	ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error)
	// Lists all builds for the given build target and model in descending order
	// for the milestones and build versions.
	ListBuilds(ctx context.Context, in *ListBuildsRequest, opts ...grpc.CallOption) (*ListBuildsResponse, error)
	// Checks the stage status for a given build artifact in a partner Google
	// Cloud Storage bucket.
	CheckBuildStageStatus(ctx context.Context, in *CheckBuildStageStatusRequest, opts ...grpc.CallOption) (*CheckBuildStageStatusResponse, error)
	// Stages a given build artifact from a internal Google Cloud Storage bucket
	// to a partner Google Cloud Storage bucket. The stage will be skipped if all
	// the objects in the partner bucket are the same as in the internal bucket.
	// Operation
	// <response:[StageBuildResponse][google.chromeos.moblab.v1beta1.StageBuildResponse],
	//
	//	 metadata:
	//	[StageBuildMetadata][google.chromeos.moblab.v1beta1.StageBuildMetadata]>
	StageBuild(ctx context.Context, in *StageBuildRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
	// Finds the most stable build for the given build target. The definition of
	// the most stable build is determined by evaluating the following rule in
	// order until one is true. If none are true, then there is no stable build
	// and it will return an empty response.
	//
	// Evaluation rules:
	//  1. Stable channel build with label “Live”
	//  2. Beta channel build with label “Live”
	//  3. Dev channel build with label “Live”
	//  4. Most recent stable channel build with build status Pass
	//  5. Most recent beta channel build with build status Pass
	//  6. Most recent dev channel build with build status Pass
	FindMostStableBuild(ctx context.Context, in *FindMostStableBuildRequest, opts ...grpc.CallOption) (*FindMostStableBuildResponse, error)
}

type buildServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBuildServiceClient(cc grpc.ClientConnInterface) BuildServiceClient {
	return &buildServiceClient{cc}
}

func (c *buildServiceClient) ListBuildTargets(ctx context.Context, in *ListBuildTargetsRequest, opts ...grpc.CallOption) (*ListBuildTargetsResponse, error) {
	out := new(ListBuildTargetsResponse)
	err := c.cc.Invoke(ctx, BuildService_ListBuildTargets_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *buildServiceClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) {
	out := new(ListModelsResponse)
	err := c.cc.Invoke(ctx, BuildService_ListModels_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *buildServiceClient) ListBuilds(ctx context.Context, in *ListBuildsRequest, opts ...grpc.CallOption) (*ListBuildsResponse, error) {
	out := new(ListBuildsResponse)
	err := c.cc.Invoke(ctx, BuildService_ListBuilds_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *buildServiceClient) CheckBuildStageStatus(ctx context.Context, in *CheckBuildStageStatusRequest, opts ...grpc.CallOption) (*CheckBuildStageStatusResponse, error) {
	out := new(CheckBuildStageStatusResponse)
	err := c.cc.Invoke(ctx, BuildService_CheckBuildStageStatus_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *buildServiceClient) StageBuild(ctx context.Context, in *StageBuildRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
	out := new(longrunningpb.Operation)
	err := c.cc.Invoke(ctx, BuildService_StageBuild_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *buildServiceClient) FindMostStableBuild(ctx context.Context, in *FindMostStableBuildRequest, opts ...grpc.CallOption) (*FindMostStableBuildResponse, error) {
	out := new(FindMostStableBuildResponse)
	err := c.cc.Invoke(ctx, BuildService_FindMostStableBuild_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BuildServiceServer is the server API for BuildService service.
// All implementations must embed UnimplementedBuildServiceServer
// for forward compatibility
type BuildServiceServer interface {
	// Lists all build targets that a user has access to.
	ListBuildTargets(context.Context, *ListBuildTargetsRequest) (*ListBuildTargetsResponse, error)
	// Lists all models for the given build target.
	ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error)
	// Lists all builds for the given build target and model in descending order
	// for the milestones and build versions.
	ListBuilds(context.Context, *ListBuildsRequest) (*ListBuildsResponse, error)
	// Checks the stage status for a given build artifact in a partner Google
	// Cloud Storage bucket.
	CheckBuildStageStatus(context.Context, *CheckBuildStageStatusRequest) (*CheckBuildStageStatusResponse, error)
	// Stages a given build artifact from a internal Google Cloud Storage bucket
	// to a partner Google Cloud Storage bucket. The stage will be skipped if all
	// the objects in the partner bucket are the same as in the internal bucket.
	// Operation
	// <response:[StageBuildResponse][google.chromeos.moblab.v1beta1.StageBuildResponse],
	//
	//	 metadata:
	//	[StageBuildMetadata][google.chromeos.moblab.v1beta1.StageBuildMetadata]>
	StageBuild(context.Context, *StageBuildRequest) (*longrunningpb.Operation, error)
	// Finds the most stable build for the given build target. The definition of
	// the most stable build is determined by evaluating the following rule in
	// order until one is true. If none are true, then there is no stable build
	// and it will return an empty response.
	//
	// Evaluation rules:
	//  1. Stable channel build with label “Live”
	//  2. Beta channel build with label “Live”
	//  3. Dev channel build with label “Live”
	//  4. Most recent stable channel build with build status Pass
	//  5. Most recent beta channel build with build status Pass
	//  6. Most recent dev channel build with build status Pass
	FindMostStableBuild(context.Context, *FindMostStableBuildRequest) (*FindMostStableBuildResponse, error)
	mustEmbedUnimplementedBuildServiceServer()
}

// UnimplementedBuildServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBuildServiceServer struct {
}

func (UnimplementedBuildServiceServer) ListBuildTargets(context.Context, *ListBuildTargetsRequest) (*ListBuildTargetsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListBuildTargets not implemented")
}
func (UnimplementedBuildServiceServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented")
}
func (UnimplementedBuildServiceServer) ListBuilds(context.Context, *ListBuildsRequest) (*ListBuildsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListBuilds not implemented")
}
func (UnimplementedBuildServiceServer) CheckBuildStageStatus(context.Context, *CheckBuildStageStatusRequest) (*CheckBuildStageStatusResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CheckBuildStageStatus not implemented")
}
func (UnimplementedBuildServiceServer) StageBuild(context.Context, *StageBuildRequest) (*longrunningpb.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StageBuild not implemented")
}
func (UnimplementedBuildServiceServer) FindMostStableBuild(context.Context, *FindMostStableBuildRequest) (*FindMostStableBuildResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FindMostStableBuild not implemented")
}
func (UnimplementedBuildServiceServer) mustEmbedUnimplementedBuildServiceServer() {}

// UnsafeBuildServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BuildServiceServer will
// result in compilation errors.
type UnsafeBuildServiceServer interface {
	mustEmbedUnimplementedBuildServiceServer()
}

func RegisterBuildServiceServer(s grpc.ServiceRegistrar, srv BuildServiceServer) {
	s.RegisterService(&BuildService_ServiceDesc, srv)
}

func _BuildService_ListBuildTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBuildTargetsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).ListBuildTargets(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_ListBuildTargets_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).ListBuildTargets(ctx, req.(*ListBuildTargetsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BuildService_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListModelsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).ListModels(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_ListModels_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).ListModels(ctx, req.(*ListModelsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BuildService_ListBuilds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBuildsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).ListBuilds(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_ListBuilds_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).ListBuilds(ctx, req.(*ListBuildsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BuildService_CheckBuildStageStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CheckBuildStageStatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).CheckBuildStageStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_CheckBuildStageStatus_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).CheckBuildStageStatus(ctx, req.(*CheckBuildStageStatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BuildService_StageBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StageBuildRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).StageBuild(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_StageBuild_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).StageBuild(ctx, req.(*StageBuildRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BuildService_FindMostStableBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FindMostStableBuildRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BuildServiceServer).FindMostStableBuild(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BuildService_FindMostStableBuild_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BuildServiceServer).FindMostStableBuild(ctx, req.(*FindMostStableBuildRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BuildService_ServiceDesc is the grpc.ServiceDesc for BuildService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BuildService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "google.chromeos.moblab.v1beta1.BuildService",
	HandlerType: (*BuildServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListBuildTargets",
			Handler:    _BuildService_ListBuildTargets_Handler,
		},
		{
			MethodName: "ListModels",
			Handler:    _BuildService_ListModels_Handler,
		},
		{
			MethodName: "ListBuilds",
			Handler:    _BuildService_ListBuilds_Handler,
		},
		{
			MethodName: "CheckBuildStageStatus",
			Handler:    _BuildService_CheckBuildStageStatus_Handler,
		},
		{
			MethodName: "StageBuild",
			Handler:    _BuildService_StageBuild_Handler,
		},
		{
			MethodName: "FindMostStableBuild",
			Handler:    _BuildService_FindMostStableBuild_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/chromeos/moblab/v1beta1/build_service.proto",
}
