go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/deploy/api/rpcpb/actuations_grpc.pb.go (about)

     1  // Copyright 2022 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v3.21.7
    19  // source: go.chromium.org/luci/deploy/api/rpcpb/actuations.proto
    20  
    21  package rpcpb
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  )
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the grpc package it is being compiled against.
    32  // Requires gRPC-Go v1.32.0 or later.
    33  const _ = grpc.SupportPackageIsVersion7
    34  
    35  const (
    36  	Actuations_BeginActuation_FullMethodName = "/deploy.service.Actuations/BeginActuation"
    37  	Actuations_EndActuation_FullMethodName   = "/deploy.service.Actuations/EndActuation"
    38  )
    39  
    40  // ActuationsClient is the client API for Actuations service.
    41  //
    42  // 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.
    43  type ActuationsClient interface {
    44  	// Called by the actuator before it starts updating a deployment.
    45  	//
    46  	// The request contains the intended and current states of all assets in the
    47  	// deployment. For each asset the backend responds if it should be actuated
    48  	// or skipped.
    49  	BeginActuation(ctx context.Context, in *BeginActuationRequest, opts ...grpc.CallOption) (*BeginActuationResponse, error)
    50  	// Called by the actuator after it updated all assets it was asked to actuate.
    51  	//
    52  	// If there were no assets that needed actuation, this call is skipped.
    53  	EndActuation(ctx context.Context, in *EndActuationRequest, opts ...grpc.CallOption) (*EndActuationResponse, error)
    54  }
    55  
    56  type actuationsClient struct {
    57  	cc grpc.ClientConnInterface
    58  }
    59  
    60  func NewActuationsClient(cc grpc.ClientConnInterface) ActuationsClient {
    61  	return &actuationsClient{cc}
    62  }
    63  
    64  func (c *actuationsClient) BeginActuation(ctx context.Context, in *BeginActuationRequest, opts ...grpc.CallOption) (*BeginActuationResponse, error) {
    65  	out := new(BeginActuationResponse)
    66  	err := c.cc.Invoke(ctx, Actuations_BeginActuation_FullMethodName, in, out, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return out, nil
    71  }
    72  
    73  func (c *actuationsClient) EndActuation(ctx context.Context, in *EndActuationRequest, opts ...grpc.CallOption) (*EndActuationResponse, error) {
    74  	out := new(EndActuationResponse)
    75  	err := c.cc.Invoke(ctx, Actuations_EndActuation_FullMethodName, in, out, opts...)
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	return out, nil
    80  }
    81  
    82  // ActuationsServer is the server API for Actuations service.
    83  // All implementations must embed UnimplementedActuationsServer
    84  // for forward compatibility
    85  type ActuationsServer interface {
    86  	// Called by the actuator before it starts updating a deployment.
    87  	//
    88  	// The request contains the intended and current states of all assets in the
    89  	// deployment. For each asset the backend responds if it should be actuated
    90  	// or skipped.
    91  	BeginActuation(context.Context, *BeginActuationRequest) (*BeginActuationResponse, error)
    92  	// Called by the actuator after it updated all assets it was asked to actuate.
    93  	//
    94  	// If there were no assets that needed actuation, this call is skipped.
    95  	EndActuation(context.Context, *EndActuationRequest) (*EndActuationResponse, error)
    96  	mustEmbedUnimplementedActuationsServer()
    97  }
    98  
    99  // UnimplementedActuationsServer must be embedded to have forward compatible implementations.
   100  type UnimplementedActuationsServer struct {
   101  }
   102  
   103  func (UnimplementedActuationsServer) BeginActuation(context.Context, *BeginActuationRequest) (*BeginActuationResponse, error) {
   104  	return nil, status.Errorf(codes.Unimplemented, "method BeginActuation not implemented")
   105  }
   106  func (UnimplementedActuationsServer) EndActuation(context.Context, *EndActuationRequest) (*EndActuationResponse, error) {
   107  	return nil, status.Errorf(codes.Unimplemented, "method EndActuation not implemented")
   108  }
   109  func (UnimplementedActuationsServer) mustEmbedUnimplementedActuationsServer() {}
   110  
   111  // UnsafeActuationsServer may be embedded to opt out of forward compatibility for this service.
   112  // Use of this interface is not recommended, as added methods to ActuationsServer will
   113  // result in compilation errors.
   114  type UnsafeActuationsServer interface {
   115  	mustEmbedUnimplementedActuationsServer()
   116  }
   117  
   118  func RegisterActuationsServer(s grpc.ServiceRegistrar, srv ActuationsServer) {
   119  	s.RegisterService(&Actuations_ServiceDesc, srv)
   120  }
   121  
   122  func _Actuations_BeginActuation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   123  	in := new(BeginActuationRequest)
   124  	if err := dec(in); err != nil {
   125  		return nil, err
   126  	}
   127  	if interceptor == nil {
   128  		return srv.(ActuationsServer).BeginActuation(ctx, in)
   129  	}
   130  	info := &grpc.UnaryServerInfo{
   131  		Server:     srv,
   132  		FullMethod: Actuations_BeginActuation_FullMethodName,
   133  	}
   134  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   135  		return srv.(ActuationsServer).BeginActuation(ctx, req.(*BeginActuationRequest))
   136  	}
   137  	return interceptor(ctx, in, info, handler)
   138  }
   139  
   140  func _Actuations_EndActuation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   141  	in := new(EndActuationRequest)
   142  	if err := dec(in); err != nil {
   143  		return nil, err
   144  	}
   145  	if interceptor == nil {
   146  		return srv.(ActuationsServer).EndActuation(ctx, in)
   147  	}
   148  	info := &grpc.UnaryServerInfo{
   149  		Server:     srv,
   150  		FullMethod: Actuations_EndActuation_FullMethodName,
   151  	}
   152  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   153  		return srv.(ActuationsServer).EndActuation(ctx, req.(*EndActuationRequest))
   154  	}
   155  	return interceptor(ctx, in, info, handler)
   156  }
   157  
   158  // Actuations_ServiceDesc is the grpc.ServiceDesc for Actuations service.
   159  // It's only intended for direct use with grpc.RegisterService,
   160  // and not to be introspected or modified (even as a copy)
   161  var Actuations_ServiceDesc = grpc.ServiceDesc{
   162  	ServiceName: "deploy.service.Actuations",
   163  	HandlerType: (*ActuationsServer)(nil),
   164  	Methods: []grpc.MethodDesc{
   165  		{
   166  			MethodName: "BeginActuation",
   167  			Handler:    _Actuations_BeginActuation_Handler,
   168  		},
   169  		{
   170  			MethodName: "EndActuation",
   171  			Handler:    _Actuations_EndActuation_Handler,
   172  		},
   173  	},
   174  	Streams:  []grpc.StreamDesc{},
   175  	Metadata: "go.chromium.org/luci/deploy/api/rpcpb/actuations.proto",
   176  }