Beispiel #1
0
        /// <summary>
        /// Delete a campaign feedback message
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="feedback_id">Unique id for the feedback message.</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteFeedbackAsync(string campaignId, string feedback_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.feedback,
                                                    SubTargetType.not_applicable, campaignId, feedback_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
        /// <summary>
        /// Get information about a specific workflow email
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// <param name="workflow_email_id">Unique id for the Automation workflow email</param>
        /// </summary>
        internal async Task <AutomationsEmail> GetAutomationEmailInfoAsync(string workflow_id, string workflow_email_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.emails,
                                                    SubTargetType.not_applicable, workflow_id, workflow_email_id);

            return(await BaseOperation.GetAsync <AutomationsEmail>(endpoint));
        }
Beispiel #3
0
        /// <summary>
        /// Get feedback about a campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="feedback_id">Unique id for the feedback message.</param>
        /// </summary>
        internal async Task <Feedback> GetFeedbackAsync(string campaignId, string feedback_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.feedback,
                                                    SubTargetType.not_applicable, campaignId, feedback_id);

            return(await BaseOperation.GetAsync <Feedback>(endpoint));
        }
Beispiel #4
0
        /// <summary>
        /// Return statistics for the top-performing domains from a campaign.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <RootUnsubscribe> GetUnsubscriberListAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.unsubscribed,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <RootUnsubscribe>(endpoint));
        }
Beispiel #5
0
        /// <summary>
        /// Get information about a specific Automation workflow
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// </summary>
        internal async Task <MCAutomation> GetAutomationAsync(string workflow_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, workflow_id);

            return(await BaseOperation.GetAsync <MCAutomation>(endpoint));
        }
Beispiel #6
0
        /// <summary>
        /// Delete a campaign folder
        /// <param name="folder_id">Unique id for the campaign folder</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteCampaignFolderAsync(string folder_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaign_folders, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, folder_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
        /// <summary>
        /// Send a campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <dynamic> SendCampaignAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.actionSend, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.PostAsync(endpoint));
        }
        /// <summary>
        /// Return a summary of social activity for the campaign, tracked by EepURL.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <Eepurl> GetEepUrlActivityAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.eepurl, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <Eepurl>(endpoint));
        }
Beispiel #9
0
        /// <summary>
        /// Get a specific campaign folder
        /// <param name="folder_id">Unique id for the campaign folder</param>
        /// </summary>
        internal async Task <CampaignFolder> GetCampaignFolderAsync(string folder_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaign_folders, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, folder_id);

            return(await BaseOperation.GetAsync <CampaignFolder>(endpoint));
        }
Beispiel #10
0
        /// <summary>
        /// Get the status of a batch operation request
        /// <param name="batchId">The unique id for the batch operation</param>
        /// </summary>
        internal async Task <RootBatch> GetBatchReportAsync(string batchId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.batches, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, batchId);

            return(await BaseOperation.GetAsync <RootBatch>(endpoint));
        }
        /// <summary>
        /// Return A list of reports for child campaigns of a specific parent campaign.
        /// <param name="campaignId">Campaign Id</param>
        /// </summary>
        internal async Task <Sub_Reports> GetChildCampaignReportsAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sub_reports,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <Sub_Reports>(endpoint));
        }
Beispiel #12
0
        /// <summary>
        /// Start a batch operation
        /// <param name="bundle"></param>
        /// </summary>
        internal async Task <dynamic> PostBatchOperationAsync(RootBatch bundle)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.batches, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable);

            return(await BaseOperation.PostAsync <RootBatch>(endpoint, bundle));
        }
        public void AddStep_NewOperation_CorrectAddingOfSteps(
            Dictionary <string, List <BaseStep> > addingStates,
            Dictionary <string, List <BaseStep> > expectedStates,
            BaseOperation customizableOper)
        {
            foreach (var state in addingStates.Keys)
            {
                foreach (var step in addingStates[state])
                {
                    customizableOper.AddStep(state, step.LuaName, step.Name,
                                             step.DefaultPosition);
                }
            }

            Assert.Multiple(() =>
            {
                foreach (var state in customizableOper.States.Keys)
                {
                    Assert.True(expectedStates.ContainsKey(state));
                    foreach (var step in customizableOper.States[state])
                    {
                        Assert.True(expectedStates[state]
                                    .Where(x => x.Name == step.Name &&
                                           x.LuaName == step.LuaName &&
                                           x.DefaultPosition == step.DefaultPosition &&
                                           x.Owner == step.Owner)
                                    .Count() == 1);
                    }
                }
            });
        }
        public void GetStateBaseSteps_StateFromSource_ReturnsStepsOrEmptyList(
            Dictionary <string, List <BaseStep> > addingStates,
            State.StateType selectedState, List <BaseStep> expectedSteps,
            BaseOperation customizableOper)
        {
            FillBaseOperationStatesWithReset(customizableOper, addingStates);

            List <BaseStep> actualSteps = customizableOper
                                          .GetStateBaseSteps(selectedState);

            Assert.Multiple(() =>
            {
                for (int stepId = 0; stepId < actualSteps.Count; stepId++)
                {
                    BaseStep expectedStep = expectedSteps[stepId];
                    BaseStep actualStep   = actualSteps[stepId];

                    bool areEqual =
                        expectedStep.DefaultPosition ==
                        actualStep.DefaultPosition &&
                        expectedStep.LuaName == actualStep.LuaName &&
                        expectedStep.Name == actualStep.Name &&
                        expectedStep.Owner == actualStep.Owner;

                    Assert.IsTrue(areEqual);
                }
            });
        }
        /// <summary>
        /// Return statistics for the top-performing domains from a campaign.
        /// <param name="campaignId">Unique id for campaign</param>
        /// </summary>
        internal async Task <DomainPerformance> GetDomainPerformanceAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.domain_performance,
                                                    SubTargetType.not_applicable, campaignId);

            return(await BaseOperation.GetAsync <DomainPerformance>(endpoint));
        }
Beispiel #16
0
        /// <summary>
        /// Get the send checklist for a campaign
        /// <param name="campaign_id">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootCheckList> GetCheckListAsync(string campaign_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.campaigns, SubTargetType.send_checklist,
                                                    SubTargetType.not_applicable, campaign_id);

            return(await BaseOperation.GetAsync <RootCheckList>(endpoint));
        }
Beispiel #17
0
        /// <summary>
        /// Delete a specific template
        /// <param name="template_id">The unique id for the template</param>
        /// </summary>
        internal async Task <HttpResponseMessage> DeleteTemplateAsync(string template_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.templates, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable, template_id);

            return(await BaseOperation.DeleteAsync(endpoint));
        }
Beispiel #18
0
        /// <summary>
        /// Return recent feedback based on a campaign’s statistics
        /// <param name="campaignId">Campaign Id</param>
        /// </summary>
        internal async Task <CampaignAdvice> GetAdviceAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.advice, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <CampaignAdvice>(endpoint));
        }
Beispiel #19
0
            public async Task <double> Handle(Query request, CancellationToken cancellationToken)
            {
                BaseOperation oper   = request.factory.CreateOperation();
                double        result = await _calculator.GetResult(request.Num1, request.Num2, oper);

                return(result);
            }
Beispiel #20
0
        public async Task <IActionResult> TestDouble()
        {
            var e = new BaseOperation()
            {
                Id = null,
                B  = new B()
                {
                    Id = "B-1"
                }
            };

            var e2 = new BaseOperation()
            {
                Id = null,
                B  = new B()
                {
                    Id = "B-2"
                }
            };

            //** Store ***********************//
            await _session.StoreAsync(e);

            await _session.StoreAsync(e2);

            await _session.SaveChangesAsync();

            //** Delete ***********************//
            _session.Delete(e);
            await _session.SaveChangesAsync();

            return(Ok());
        }
Beispiel #21
0
        public async Task <IActionResult> TestUpdate([FromRoute] string id)
        {
            var e = new BaseOperation()
            {
                Id = null,
                B  = new B()
                {
                    Id = "B-single"
                }
            };

            //** Store ***********************//
            await _session.StoreAsync(e);

            await _session.SaveChangesAsync();

            //** Update ***********************//

            e.B.Id = "BUpdate";
            await _session.StoreAsync(e);

            await _session.SaveChangesAsync();

            //** Delete ***********************//
            _session.Delete(e);
            await _session.SaveChangesAsync();

            return(Ok());
        }
Beispiel #22
0
        /// <summary>
        /// Return list member activity for a specific campaign
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="subscriber_hash">The MD5 hash of the lowercase version of the list member’s email address</param>
        /// </summary>
        internal async Task <EmailActivity> GetSubscriberEmailActivityAsync(string campaignId, string subscriber_hash)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.email_activity,
                                                    SubTargetType.not_applicable, campaignId, subscriber_hash);

            return(await BaseOperation.GetAsync <EmailActivity>(endpoint));
        }
Beispiel #23
0
        /// <summary>
        /// View all subscribers removed from a workflow
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// </summary>
        internal async Task <RemovedSubscriber> GetRemovedSubscriberListAsync(string workflow_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.removed_subscribers,
                                                    SubTargetType.not_applicable, workflow_id);

            return(await BaseOperation.GetAsync <RemovedSubscriber>(endpoint));
        }
        /// <summary>
        /// View queued subscribers for an automated email
        /// <param name="workflow_id">Unique id for the Automation workflow</param>
        /// <param name="workflow_email_id">Unique id for the Automation workflow email</param>
        /// </summary>
        internal async Task <RootAutomationsEmailQueue> GetQueuedSubscriberListAsync(string workflow_id, string workflow_email_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.automations, SubTargetType.emails, SubTargetType.queue,
                                                    workflow_id, workflow_email_id);

            return(await BaseOperation.GetAsync <RootAutomationsEmailQueue>(endpoint));
        }
        /// <summary>
        /// Get conversation messages
        /// <param name="conversation_id">Unique id for the campaign</param>
        /// <param name="message_id">The unique id for the conversation message</param>
        /// </summary>
        internal async Task <ConversationMessage> GetMessageAsync(string conversation_id, string message_id)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.conversations, SubTargetType.messages,
                                                    SubTargetType.not_applicable, conversation_id, message_id);

            return(await BaseOperation.GetAsync <ConversationMessage>(endpoint));
        }
        /// <summary>
        /// Get screenshot
        /// <param name="jobId">Get generate screenshot by job id</param>
        /// </summary>
        public RootScreenshot GetGeneratedScreenshot(string jobId)
        {
            var request = new RestRequest();

            request.Resource = string.Format("/{0}.json", jobId);
            return(BaseOperation.ExecuteGet <RootScreenshot>(request, baseUrl, UserName, AccessKey));
        }
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootLocation> GetTopLocationAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.locations, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <RootLocation>(endpoint));
        }
Beispiel #28
0
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// <param name="subscriber_hash">The MD5 hash of the lowercase version of the list member’s email address</param>
        /// </summary>
        internal async Task <SentTo> GetCampaignRecipientAsync(string campaignId, string subscriber_hash)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sent_to, SubTargetType.not_applicable,
                                                    campaignId, subscriber_hash);

            return(await BaseOperation.GetAsync <SentTo>(endpoint));
        }
Beispiel #29
0
        /// <summary>
        /// Return top open locations for a specific campaign.
        /// <param name="campaignId">Unique id for the campaign</param>
        /// </summary>
        internal async Task <RootSentTo> GetRecipientsInfoAsync(string campaignId)
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.reports, SubTargetType.sent_to, SubTargetType.not_applicable,
                                                    campaignId);

            return(await BaseOperation.GetAsync <RootSentTo>(endpoint));
        }
Beispiel #30
0
        /// <summary>
        /// Get a list of conversations
        /// </summary>
        internal async Task <RootConversation> GetConversationsAsync()
        {
            string endpoint = Authenticate.EndPoint(TargetTypes.conversations, SubTargetType.not_applicable,
                                                    SubTargetType.not_applicable);

            return(await BaseOperation.GetAsync <RootConversation>(endpoint));
        }
 public BlockingOperationScreen(String message, BaseOperation op)
     : base(message)
 {
     m_operation = op;
 }
 public void OnOperationStarted(BaseOperation op)
 {
 }
 public void OnOperationFinished(BaseOperation op)
 {
     Finish();
 }