Beispiel #1
0
 /// <summary>
 /// Save selected record
 /// </summary>
 /// <returns></returns>
 public async Task <bool> RemoveRecord()
 {
     return(await Task.Factory.StartNew(() =>
     {
         if (SelectedDataModel == null)
         {
             return false;
         }
         bool cmd_res = new RemoveDataCommand(dataAPI, SelectedDataModel.Id).Execute();
         if (cmd_res)
         {
             GetRecordList();
             EnableUpdateMode = false;
         }
         return cmd_res;
     }));
 }
Beispiel #2
0
        public override List <QueryResponse> Validate(ExecutionContext context, RemoveDataCommand command, IDictionary <string, object> config, string id, MeshQuery query)
        {
            var hubSpotCrawlJobData = new HubSpotCrawlJobData(config);

            var client  = new RestClient("https://api.hubapi.com");
            var request = new RestRequest(string.Format(DeleteUrl + "{0}", id), Method.GET);

            request.AddQueryParameter("hapikey", hubSpotCrawlJobData.ApiToken); // adds to POST or URL querystring based on Method

            var result = client.ExecuteTaskAsync(request).Result;

            return(new List <QueryResponse>()
            {
                new QueryResponse()
                {
                    Content = result.Content, StatusCode = result.StatusCode
                }
            });
        }
Beispiel #3
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, RemoveDataCommand command)
        {
            var query = JsonConvert.DeserializeObject <MeshQuery>(command.HttpPostData);

            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);
            }
        }
Beispiel #4
0
 public override void NotifyReceipients(ExecutionContext context, RemoveDataCommand command)
 {
 }
Beispiel #5
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, RemoveDataCommand command, IDictionary <string, object> jobData, MeshQuery query)
 {
     return;
 }
Beispiel #6
0
 public override bool Accept(RemoveDataCommand command, MeshQuery query, IEntity entity)
 {
     return(command.ProviderId == this.GetProviderId() && query.Action == ActionType.REMOVE && EntityType.Contains(entity.EntityType));
 }