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

from google.ads.google_ads.v2.proto.resources import campaign_experiment_pb2 as google_dot_ads_dot_googleads__v2_dot_proto_dot_resources_dot_campaign__experiment__pb2
from google.ads.google_ads.v2.proto.services import campaign_experiment_service_pb2 as google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2
from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class CampaignExperimentServiceStub(object):
  """Proto file describing the Campaign Experiment service.

  CampaignExperimentService manages the life cycle of campaign experiments.
  It is used to create new experiments from drafts, modify experiment
  properties, promote changes in an experiment back to its base campaign,
  graduate experiments into new stand-alone campaigns, and to remove an
  experiment.

  An experiment consists of two variants or arms - the base campaign and the
  experiment campaign, directing a fixed share of traffic to each arm.
  A campaign experiment is created from a draft of changes to the base campaign
  and will be a snapshot of changes in the draft at the time of creation.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.GetCampaignExperiment = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/GetCampaignExperiment',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GetCampaignExperimentRequest.SerializeToString,
        response_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_resources_dot_campaign__experiment__pb2.CampaignExperiment.FromString,
        )
    self.CreateCampaignExperiment = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/CreateCampaignExperiment',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.CreateCampaignExperimentRequest.SerializeToString,
        response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
    self.MutateCampaignExperiments = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/MutateCampaignExperiments',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.MutateCampaignExperimentsRequest.SerializeToString,
        response_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.MutateCampaignExperimentsResponse.FromString,
        )
    self.GraduateCampaignExperiment = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/GraduateCampaignExperiment',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GraduateCampaignExperimentRequest.SerializeToString,
        response_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GraduateCampaignExperimentResponse.FromString,
        )
    self.PromoteCampaignExperiment = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/PromoteCampaignExperiment',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.PromoteCampaignExperimentRequest.SerializeToString,
        response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
    self.EndCampaignExperiment = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/EndCampaignExperiment',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.EndCampaignExperimentRequest.SerializeToString,
        response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
    self.ListCampaignExperimentAsyncErrors = channel.unary_unary(
        '/google.ads.googleads.v2.services.CampaignExperimentService/ListCampaignExperimentAsyncErrors',
        request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.ListCampaignExperimentAsyncErrorsRequest.SerializeToString,
        response_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.ListCampaignExperimentAsyncErrorsResponse.FromString,
        )


class CampaignExperimentServiceServicer(object):
  """Proto file describing the Campaign Experiment service.

  CampaignExperimentService manages the life cycle of campaign experiments.
  It is used to create new experiments from drafts, modify experiment
  properties, promote changes in an experiment back to its base campaign,
  graduate experiments into new stand-alone campaigns, and to remove an
  experiment.

  An experiment consists of two variants or arms - the base campaign and the
  experiment campaign, directing a fixed share of traffic to each arm.
  A campaign experiment is created from a draft of changes to the base campaign
  and will be a snapshot of changes in the draft at the time of creation.
  """

  def GetCampaignExperiment(self, request, context):
    """Returns the requested campaign experiment in full detail.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CreateCampaignExperiment(self, request, context):
    """Creates a campaign experiment based on a campaign draft. The draft campaign
    will be forked into a real campaign (called the experiment campaign) that
    will begin serving ads if successfully created.

    The campaign experiment is created immediately with status INITIALIZING.
    This method return a long running operation that tracks the forking of the
    draft campaign. If the forking fails, a list of errors can be retrieved
    using the ListCampaignExperimentAsyncErrors method. The operation's
    metadata will be a StringValue containing the resource name of the created
    campaign experiment.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def MutateCampaignExperiments(self, request, context):
    """Updates campaign experiments. Operation statuses are returned.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GraduateCampaignExperiment(self, request, context):
    """Graduates a campaign experiment to a full campaign. The base and experiment
    campaigns will start running independently with their own budgets.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def PromoteCampaignExperiment(self, request, context):
    """Promotes the changes in a experiment campaign back to the base campaign.

    The campaign experiment is updated immediately with status PROMOTING.
    This method return a long running operation that tracks the promoting of
    the experiment campaign. If the promoting fails, a list of errors can be
    retrieved using the ListCampaignExperimentAsyncErrors method.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def EndCampaignExperiment(self, request, context):
    """Immediately ends a campaign experiment, changing the experiment's scheduled
    end date and without waiting for end of day. End date is updated to be the
    time of the request.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListCampaignExperimentAsyncErrors(self, request, context):
    """Returns all errors that occurred during CampaignExperiment create or
    promote (whichever occurred last).
    Supports standard list paging.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_CampaignExperimentServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetCampaignExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.GetCampaignExperiment,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GetCampaignExperimentRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_resources_dot_campaign__experiment__pb2.CampaignExperiment.SerializeToString,
      ),
      'CreateCampaignExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.CreateCampaignExperiment,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.CreateCampaignExperimentRequest.FromString,
          response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
      ),
      'MutateCampaignExperiments': grpc.unary_unary_rpc_method_handler(
          servicer.MutateCampaignExperiments,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.MutateCampaignExperimentsRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.MutateCampaignExperimentsResponse.SerializeToString,
      ),
      'GraduateCampaignExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.GraduateCampaignExperiment,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GraduateCampaignExperimentRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.GraduateCampaignExperimentResponse.SerializeToString,
      ),
      'PromoteCampaignExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.PromoteCampaignExperiment,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.PromoteCampaignExperimentRequest.FromString,
          response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
      ),
      'EndCampaignExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.EndCampaignExperiment,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.EndCampaignExperimentRequest.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'ListCampaignExperimentAsyncErrors': grpc.unary_unary_rpc_method_handler(
          servicer.ListCampaignExperimentAsyncErrors,
          request_deserializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.ListCampaignExperimentAsyncErrorsRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_services_dot_campaign__experiment__service__pb2.ListCampaignExperimentAsyncErrorsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.ads.googleads.v2.services.CampaignExperimentService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
