github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/client/v4/alerting_policy/alerting_policy_service.pb.client.go (about)

     1  // Code generated by protoc-gen-goten-client
     2  // API: AlertingPolicyService
     3  // DO NOT EDIT!!!
     4  
     5  package alerting_policy_client
     6  
     7  import (
     8  	"context"
     9  
    10  	"google.golang.org/grpc"
    11  	"google.golang.org/protobuf/runtime/protoimpl"
    12  )
    13  
    14  // proto imports
    15  import (
    16  	alerting_policy "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_policy"
    17  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    18  )
    19  
    20  // Reference imports to suppress errors if they are not otherwise used.
    21  var (
    22  	_ = protoimpl.DescBuilder{}
    23  	_ = new(context.Context)
    24  	_ = grpc.ClientConn{}
    25  )
    26  
    27  // make sure we're using proto imports
    28  var (
    29  	_ = &alerting_policy.AlertingPolicy{}
    30  	_ = &emptypb.Empty{}
    31  )
    32  
    33  // This is a compile-time assertion to ensure that this generated file
    34  // is compatible with the proto package it is being compiled against.
    35  // A compilation error at this line likely means your copy of the
    36  // proto package needs to be updated.
    37  const (
    38  	// Verify that this generated code is sufficiently up-to-date.
    39  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    40  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    41  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    42  )
    43  
    44  // This is a compile-time assertion to ensure that this generated file
    45  // is compatible with the grpc package it is being compiled against.
    46  const _ = grpc.SupportPackageIsVersion6
    47  
    48  // AlertingPolicyServiceClient is the client API for AlertingPolicyService.
    49  //
    50  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
    51  type AlertingPolicyServiceClient interface {
    52  	GetAlertingPolicy(ctx context.Context, in *GetAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error)
    53  	BatchGetAlertingPolicies(ctx context.Context, in *BatchGetAlertingPoliciesRequest, opts ...grpc.CallOption) (*BatchGetAlertingPoliciesResponse, error)
    54  	ListAlertingPolicies(ctx context.Context, in *ListAlertingPoliciesRequest, opts ...grpc.CallOption) (*ListAlertingPoliciesResponse, error)
    55  	WatchAlertingPolicy(ctx context.Context, in *WatchAlertingPolicyRequest, opts ...grpc.CallOption) (WatchAlertingPolicyClientStream, error)
    56  	WatchAlertingPolicies(ctx context.Context, in *WatchAlertingPoliciesRequest, opts ...grpc.CallOption) (WatchAlertingPoliciesClientStream, error)
    57  	CreateAlertingPolicy(ctx context.Context, in *CreateAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error)
    58  	UpdateAlertingPolicy(ctx context.Context, in *UpdateAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error)
    59  	DeleteAlertingPolicy(ctx context.Context, in *DeleteAlertingPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    60  	SearchAlertingPolicies(ctx context.Context, in *SearchAlertingPoliciesRequest, opts ...grpc.CallOption) (*SearchAlertingPoliciesResponse, error)
    61  }
    62  
    63  type client struct {
    64  	cc grpc.ClientConnInterface
    65  }
    66  
    67  func NewAlertingPolicyServiceClient(cc grpc.ClientConnInterface) AlertingPolicyServiceClient {
    68  	return &client{cc}
    69  }
    70  
    71  func (c *client) GetAlertingPolicy(ctx context.Context, in *GetAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error) {
    72  	out := new(alerting_policy.AlertingPolicy)
    73  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/GetAlertingPolicy", in, out, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return out, nil
    78  }
    79  
    80  func (c *client) BatchGetAlertingPolicies(ctx context.Context, in *BatchGetAlertingPoliciesRequest, opts ...grpc.CallOption) (*BatchGetAlertingPoliciesResponse, error) {
    81  	out := new(BatchGetAlertingPoliciesResponse)
    82  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/BatchGetAlertingPolicies", in, out, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return out, nil
    87  }
    88  
    89  func (c *client) ListAlertingPolicies(ctx context.Context, in *ListAlertingPoliciesRequest, opts ...grpc.CallOption) (*ListAlertingPoliciesResponse, error) {
    90  	out := new(ListAlertingPoliciesResponse)
    91  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/ListAlertingPolicies", in, out, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return out, nil
    96  }
    97  
    98  func (c *client) WatchAlertingPolicy(ctx context.Context, in *WatchAlertingPolicyRequest, opts ...grpc.CallOption) (WatchAlertingPolicyClientStream, error) {
    99  	stream, err := c.cc.NewStream(ctx,
   100  		&grpc.StreamDesc{
   101  			StreamName:    "WatchAlertingPolicy",
   102  			ServerStreams: true,
   103  		},
   104  		"/ntt.monitoring.v4.AlertingPolicyService/WatchAlertingPolicy", opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	x := &watchAlertingPolicyWatchAlertingPolicyClient{stream}
   109  	if err := x.ClientStream.SendMsg(in); err != nil {
   110  		return nil, err
   111  	}
   112  	if err := x.ClientStream.CloseSend(); err != nil {
   113  		return nil, err
   114  	}
   115  	return x, nil
   116  }
   117  
   118  type WatchAlertingPolicyClientStream interface {
   119  	Recv() (*WatchAlertingPolicyResponse, error)
   120  	grpc.ClientStream
   121  }
   122  
   123  type watchAlertingPolicyWatchAlertingPolicyClient struct {
   124  	grpc.ClientStream
   125  }
   126  
   127  func (x *watchAlertingPolicyWatchAlertingPolicyClient) Recv() (*WatchAlertingPolicyResponse, error) {
   128  	m := new(WatchAlertingPolicyResponse)
   129  	if err := x.ClientStream.RecvMsg(m); err != nil {
   130  		return nil, err
   131  	}
   132  	return m, nil
   133  }
   134  
   135  func (c *client) WatchAlertingPolicies(ctx context.Context, in *WatchAlertingPoliciesRequest, opts ...grpc.CallOption) (WatchAlertingPoliciesClientStream, error) {
   136  	stream, err := c.cc.NewStream(ctx,
   137  		&grpc.StreamDesc{
   138  			StreamName:    "WatchAlertingPolicies",
   139  			ServerStreams: true,
   140  		},
   141  		"/ntt.monitoring.v4.AlertingPolicyService/WatchAlertingPolicies", opts...)
   142  	if err != nil {
   143  		return nil, err
   144  	}
   145  	x := &watchAlertingPoliciesWatchAlertingPoliciesClient{stream}
   146  	if err := x.ClientStream.SendMsg(in); err != nil {
   147  		return nil, err
   148  	}
   149  	if err := x.ClientStream.CloseSend(); err != nil {
   150  		return nil, err
   151  	}
   152  	return x, nil
   153  }
   154  
   155  type WatchAlertingPoliciesClientStream interface {
   156  	Recv() (*WatchAlertingPoliciesResponse, error)
   157  	grpc.ClientStream
   158  }
   159  
   160  type watchAlertingPoliciesWatchAlertingPoliciesClient struct {
   161  	grpc.ClientStream
   162  }
   163  
   164  func (x *watchAlertingPoliciesWatchAlertingPoliciesClient) Recv() (*WatchAlertingPoliciesResponse, error) {
   165  	m := new(WatchAlertingPoliciesResponse)
   166  	if err := x.ClientStream.RecvMsg(m); err != nil {
   167  		return nil, err
   168  	}
   169  	return m, nil
   170  }
   171  
   172  func (c *client) CreateAlertingPolicy(ctx context.Context, in *CreateAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error) {
   173  	out := new(alerting_policy.AlertingPolicy)
   174  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/CreateAlertingPolicy", in, out, opts...)
   175  	if err != nil {
   176  		return nil, err
   177  	}
   178  	return out, nil
   179  }
   180  
   181  func (c *client) UpdateAlertingPolicy(ctx context.Context, in *UpdateAlertingPolicyRequest, opts ...grpc.CallOption) (*alerting_policy.AlertingPolicy, error) {
   182  	out := new(alerting_policy.AlertingPolicy)
   183  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/UpdateAlertingPolicy", in, out, opts...)
   184  	if err != nil {
   185  		return nil, err
   186  	}
   187  	return out, nil
   188  }
   189  
   190  func (c *client) DeleteAlertingPolicy(ctx context.Context, in *DeleteAlertingPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
   191  	out := new(emptypb.Empty)
   192  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/DeleteAlertingPolicy", in, out, opts...)
   193  	if err != nil {
   194  		return nil, err
   195  	}
   196  	return out, nil
   197  }
   198  
   199  func (c *client) SearchAlertingPolicies(ctx context.Context, in *SearchAlertingPoliciesRequest, opts ...grpc.CallOption) (*SearchAlertingPoliciesResponse, error) {
   200  	out := new(SearchAlertingPoliciesResponse)
   201  	err := c.cc.Invoke(ctx, "/ntt.monitoring.v4.AlertingPolicyService/SearchAlertingPolicies", in, out, opts...)
   202  	if err != nil {
   203  		return nil, err
   204  	}
   205  	return out, nil
   206  }