示例#1
0
        public override List <QueryResponse> Validate(ExecutionContext context, RemoveFromProcessingDataCommand command, IDictionary <string, object> config, string id, MeshQuery query)
        {
            var hubSpotCrawlJobData = new HubSpotCrawlJobData(config);
            var quereis             = new List <QueryResponse>();
            var client  = new RestClient("https://api.hubapi.com");
            var request = new RestRequest(string.Format("/automation/v2/workflows/enrollments/contacts/{0}", id), Method.GET);

            request.AddQueryParameter("hapikey", hubSpotCrawlJobData.ApiToken); // adds to POST or URL querystring based on Method
            var result = client.ExecuteTaskAsync <List <Workflow> >(request).Result;

            return(new List <QueryResponse>()
            {
                new QueryResponse()
                {
                    Content = result.Content, StatusCode = result.StatusCode
                }
            });
        }
示例#2
0
 /// <summary>Does the process.</summary>
 /// <param name="context">The context.</param>
 /// <param name="command">The command.</param>
 /// <returns></returns>
 public override void DoProcess(CluedIn.Core.ExecutionContext context, RemoveFromProcessingDataCommand command)
 {
     try
     {
         var configurationDataStore = context.ApplicationContext.Container.Resolve <IConfigurationRepository>();
         if (command.ProviderDefinitionId != null)
         {
             var providerDefinition = context.Organization.Providers.GetProviderDefinition(context, command.ProviderDefinitionId);
             var jobDataCheck       = context.ApplicationContext.Container.ResolveAll <IProvider>().FirstOrDefault(providerInstance => providerDefinition != null && providerInstance.Id == providerDefinition.ProviderId);
             var configStoreData    = configurationDataStore.GetConfigurationById(context, command.ProviderDefinitionId);
         }
     }
     catch (Exception exception)
     {
         context.Log.Error(new
         {
             command.HttpHeaders,
             command.HttpQueryString,
             command.HttpPostData
         }, () => "Could not process web hook message", exception);
     }
 }
示例#3
0
 // TODO: MeshQUery should be handed in
 //All of the stores should be in a base class and only the client parts are passed in.
 /// <summary>Does the process.</summary>
 /// <param name="context">The context.</param>
 /// <param name="command">The command.</param>
 /// <returns></returns>
 public override void DoProcess(CluedIn.Core.ExecutionContext context, RemoveFromProcessingDataCommand command, IDictionary <string, object> jobData, MeshQuery query)
 {
     return;
 }
示例#4
0
 public override bool Accept(RemoveFromProcessingDataCommand command, MeshQuery query, IEntity entity)
 {
     return(command.ProviderId == this.GetProviderId() && query.Action == ActionType.DISASSOCIATE && EntityType.Contains(entity.EntityType));
 }