# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from google.cloud.monitoring_v3.proto import alert_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2
from google.cloud.monitoring_v3.proto import alert_service_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class AlertPolicyServiceStub(object):
  """The AlertPolicyService API is used to manage (list, create, delete,
  edit) alert policies in Stackdriver Monitoring. An alerting policy is
  a description of the conditions under which some aspect of your
  system is considered to be "unhealthy" and the ways to notify
  people or services about this state. In addition to using this API, alert
  policies can also be managed through
  [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/),
  which can be reached by clicking the "Monitoring" tab in
  [Cloud Console](https://console.cloud.google.com/).
  """

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.ListAlertPolicies = channel.unary_unary(
        '/google.monitoring.v3.AlertPolicyService/ListAlertPolicies',
        request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.ListAlertPoliciesRequest.SerializeToString,
        response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.ListAlertPoliciesResponse.FromString,
        )
    self.GetAlertPolicy = channel.unary_unary(
        '/google.monitoring.v3.AlertPolicyService/GetAlertPolicy',
        request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.GetAlertPolicyRequest.SerializeToString,
        response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.FromString,
        )
    self.CreateAlertPolicy = channel.unary_unary(
        '/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy',
        request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.CreateAlertPolicyRequest.SerializeToString,
        response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.FromString,
        )
    self.DeleteAlertPolicy = channel.unary_unary(
        '/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy',
        request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.DeleteAlertPolicyRequest.SerializeToString,
        response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
    self.UpdateAlertPolicy = channel.unary_unary(
        '/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy',
        request_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.UpdateAlertPolicyRequest.SerializeToString,
        response_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.FromString,
        )


class AlertPolicyServiceServicer(object):
  """The AlertPolicyService API is used to manage (list, create, delete,
  edit) alert policies in Stackdriver Monitoring. An alerting policy is
  a description of the conditions under which some aspect of your
  system is considered to be "unhealthy" and the ways to notify
  people or services about this state. In addition to using this API, alert
  policies can also be managed through
  [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/),
  which can be reached by clicking the "Monitoring" tab in
  [Cloud Console](https://console.cloud.google.com/).
  """

  def ListAlertPolicies(self, request, context):
    """Lists the existing alerting policies for the project.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetAlertPolicy(self, request, context):
    """Gets a single alerting policy.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CreateAlertPolicy(self, request, context):
    """Creates a new alerting policy.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DeleteAlertPolicy(self, request, context):
    """Deletes an alerting policy.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def UpdateAlertPolicy(self, request, context):
    """Updates an alerting policy. You can either replace the entire policy with
    a new one or replace only certain fields in the current alerting policy by
    specifying the fields to be updated via `updateMask`. Returns the
    updated alerting policy.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_AlertPolicyServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListAlertPolicies': grpc.unary_unary_rpc_method_handler(
          servicer.ListAlertPolicies,
          request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.ListAlertPoliciesRequest.FromString,
          response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.ListAlertPoliciesResponse.SerializeToString,
      ),
      'GetAlertPolicy': grpc.unary_unary_rpc_method_handler(
          servicer.GetAlertPolicy,
          request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.GetAlertPolicyRequest.FromString,
          response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.SerializeToString,
      ),
      'CreateAlertPolicy': grpc.unary_unary_rpc_method_handler(
          servicer.CreateAlertPolicy,
          request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.CreateAlertPolicyRequest.FromString,
          response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.SerializeToString,
      ),
      'DeleteAlertPolicy': grpc.unary_unary_rpc_method_handler(
          servicer.DeleteAlertPolicy,
          request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.DeleteAlertPolicyRequest.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'UpdateAlertPolicy': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateAlertPolicy,
          request_deserializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__service__pb2.UpdateAlertPolicyRequest.FromString,
          response_serializer=google_dot_cloud_dot_monitoring__v3_dot_proto_dot_alert__pb2.AlertPolicy.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.monitoring.v3.AlertPolicyService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
