Exemplo n.º 1
0
        private static void ContactKeywordSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ContactKeyword>()
            .UriFormat("account/{accountId}/contact/{contactId}/keyword/{keywordId}")
            ;


            modelBuilder.Entity <ContactKeyword>()
            .Property(c => c.KeywordId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("keywordId")
            ;

            modelBuilder.Entity <ContactKeyword>()
            .Property(c => c.ContactId)
            .OptionalUrlSegment()
            .MapTo("contactId")
            ;

            modelBuilder.Entity <ContactKeyword>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 2
0
        private static void CampaignQuestionAnswerDefinitionSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <CampaignQuestionAnswerDefinition>()
            .UriFormat("/account/{accountId}/campaign/{campaignId}/question/answer/{answerId}")
            ;

            modelBuilder.Entity <CampaignQuestionAnswerDefinition>()
            .Property(c => c.CampaignId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("campaignId")
            ;

            modelBuilder.Entity <CampaignQuestionAnswerDefinition>()
            .Property(c => c.AnswerId)
            .OptionalUrlSegment()
            .MapTo("answerId")
            ;


            modelBuilder.Entity <CampaignQuestionAnswerDefinition>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 3
0
        private static void ContactAttributeSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ContactAttribute>()
            .UriFormat("/account/{accountId}/contact/{contactId}/attribute/{name}")
            ;

            modelBuilder.Entity <ContactAttribute>()
            .Property(c => c.Name)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("name")
            ;

            modelBuilder.Entity <ContactAttribute>()
            .Property(c => c.ContactId)
            .OptionalUrlSegment()
            .MapTo("contactId")
            ;

            modelBuilder.Entity <ContactAttribute>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 4
0
        private static void KeywordSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Keyword>()
            .UriFormat("/account/{accountId}/channel/{channelId}/keyword/{keywordId}")
            ;

            modelBuilder.Entity <Keyword>()
            .Property(k => k.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("keywordId")
            ;

            modelBuilder.Entity <Keyword>()
            .Property(k => k.ChannelId)
            .UrlSegment()
            .MapTo("channelId")
            ;

            modelBuilder.Entity <Keyword>()
            .Property(k => k.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 5
0
        private static void ActionExecuteSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ActionExecute>()
            .UriFormat("/account/{accountId}/action/{actionId}/execute/{executeId}")
            ;

            modelBuilder.Entity <ActionExecute>()
            .Property(e => e.ActionId)
            .UrlSegment()
            .MapTo("actionId")
            ;

            modelBuilder.Entity <ActionExecute>()
            .Property(e => e.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("executeId")
            ;

            modelBuilder.Entity <ActionExecute>()
            .Property(e => e.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 6
0
        private static void ContactSubscriptionSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ContactSubscription>()
            .UriFormat("/account/{accountId}/contact/{contactId}/subscription/{subscriptionId}")
            ;

            modelBuilder.Entity <ContactSubscription>()
            .Property(c => c.ContactId)
            .OptionalUrlSegment()
            .MapTo("contactId")
            ;

            modelBuilder.Entity <ContactSubscription>()
            .Property(c => c.SubscriptionId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("subscriptionId")
            ;

            modelBuilder.Entity <ContactSubscription>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 7
0
        private static void ContactAttributeCategorySetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ContactAttributeCategory>()
            .UriFormat("/reference/contact-attribute-category/{categoryId}")
            ;

            modelBuilder.Entity <ContactAttributeCategory>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("categoryId")
            ;
        }
Exemplo n.º 8
0
        private static void AccountSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Account>()
            .UriFormat("/account/{accountId}")
            ;

            modelBuilder.Entity <Account>()
            .Property(a => a.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 9
0
        private void CreateModels()
        {
            if (m_modelBuilder != null)
            {
                return;
            }

            m_modelBuilder = new RestModelBuilder();
            OnModelCreating(m_modelBuilder);

            // Make sure the registered models are valid.
            m_modelBuilder.CheckEntries();
        }
Exemplo n.º 10
0
        private static void UserChatTokenSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <UserChatToken>()
            .UriFormat("/chattoken/{accountId}")
            ;

            modelBuilder.Entity <UserChatToken>()
            .Property(a => a.AccountId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 11
0
        private static void CallHistorySetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <CallHistory>()
            .UriFormat("/account/{accountId}/chat/history")
            ;


            modelBuilder.Entity <CallHistory>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .PrimaryKey()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 12
0
        private static void CallForwardVerificationSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <CallForwardVerification>()
            .UriFormat("/account/{accountId}/long-code/{longCode}/callforwardingverification")
            ;

            modelBuilder.Entity <CallForwardVerification>()
            .Property(c => c.Code)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("longCode")
            ;

            modelBuilder.Entity <CallForwardVerification>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 13
0
        private static void ExternalCouponListSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ExternalCouponList>()
            .UriFormat("/account/{accountId}/external-couponlist/{externalCouponListId}")
            ;

            modelBuilder.Entity <ExternalCouponList>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("externalCouponListId")
            ;

            modelBuilder.Entity <ExternalCouponList>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 14
0
        private static void SearchTnSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <SearchTn>()
            .UriFormat("/account/{accountId}/search-for-tn/{searchId}")
            ;

            modelBuilder.Entity <SearchTn>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("searchId")
            ;

            modelBuilder.Entity <SearchTn>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 15
0
        private static void ActionKeywordSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ActionAttachKeyword>()
            .UriFormat("/account/{accountId}/action-attachKeyword/{actionId}")
            ;

            modelBuilder.Entity <ActionAttachKeyword>()
            .Property(e => e.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("actionId")
            ;

            modelBuilder.Entity <ActionAttachKeyword>()
            .Property(e => e.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 16
0
        private static void RequestTnSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <RequestTn>()
            .UriFormat("/account/{accountId}/request-tn/{requestId}")
            ;

            modelBuilder.Entity <RequestTn>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("requestId")
            ;

            modelBuilder.Entity <RequestTn>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 17
0
        private static void ChannelSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Channel>()
            .UriFormat("/account/{accountId}/channel/{channel}")
            ;

            modelBuilder.Entity <Channel>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("channel")
            ;

            modelBuilder.Entity <Channel>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 18
0
        private static void UserPasswordSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <UserPassword>()
            .UriFormat("/account/{accountId}/user/{userName}/password")
            ;

            modelBuilder.Entity <UserPassword>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;

            modelBuilder.Entity <UserPassword>()
            .Property(c => c.UserName)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("username")
            ;
        }
Exemplo n.º 19
0
        private static void CampaignDialogSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <CampaignDialog>()
            .UriFormat("/account/{accountId}/campaign/{campaignId}/dialog")
            ;

            modelBuilder.Entity <CampaignDialog>()
            .Property(c => c.CampaignId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("campaignId")
            ;

            modelBuilder.Entity <CampaignDialog>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 20
0
        private static void ContactAttributeDefinitionSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ContactAttributeDefinition>()
            .UriFormat("/account/{accountId}/contact-attributeDef/{attribDefId}")
            ;

            modelBuilder.Entity <ContactAttributeDefinition>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("attribDefId")
            ;

            modelBuilder.Entity <ContactAttributeDefinition>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 21
0
        private static void ActionSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ThreeSeventy.Vector.Client.Models.Action>()
            .UriFormat("/account/{accountId}/action/{actionId}")
            ;

            modelBuilder.Entity <ThreeSeventy.Vector.Client.Models.Action>()
            .Property(e => e.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("actionId")
            ;

            modelBuilder.Entity <ThreeSeventy.Vector.Client.Models.Action>()
            .Property(e => e.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 22
0
        private static void EventSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <EventPushCampaign>()
            .UriFormat("/account/{accountId}/event-pushcampaign/{eventId}")
            ;

            modelBuilder.Entity <EventPushCampaign>()
            .Property(e => e.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("eventId")
            ;

            modelBuilder.Entity <EventPushCampaign>()
            .Property(e => e.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 23
0
        private static void CallbackSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Callback>()
            .UriFormat("/account/{accountId}/callback/{callbackId}")
            ;

            modelBuilder.Entity <Callback>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("callbackId")
            ;

            modelBuilder.Entity <Callback>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 24
0
        private static void ApiKeySetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ApiKey>()
            .UriFormat("/account/{accountId}/api-key/{keyId}")
            ;

            modelBuilder.Entity <ApiKey>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("keyId")
            ;

            modelBuilder.Entity <ApiKey>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 25
0
        private static void SubscriptionSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Subscription>()
            .UriFormat("/account/{accountId}/subscription/{subscriptionId}")
            ;

            modelBuilder.Entity <Subscription>()
            .Property(s => s.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("subscriptionId")
            ;

            modelBuilder.Entity <Subscription>()
            .Property(s => s.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 26
0
        private static void ContentSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Content>()
            .UriFormat("/account/{accountId}/content/{contentId}")
            ;

            modelBuilder.Entity <Content>()
            .Property(a => a.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("contentId")
            ;

            modelBuilder.Entity <Content>()
            .Property(a => a.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;

            modelBuilder.Entity <ContentTemplate>()
            .UriFormat("/account/{accountId}/content/{contentId}/template/{templateId}")
            ;

            modelBuilder.Entity <ContentTemplate>()
            .Property(a => a.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("templateId")
            ;

            modelBuilder.Entity <ContentTemplate>()
            .Property(a => a.ContentId)
            .UrlSegment()
            .MapTo("contentId")
            ;

            modelBuilder.Entity <ContentTemplate>()
            .Property(a => a.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 27
0
        private static void ChatMessageLogSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ChatMessageLog>()
            .UriFormat("/account/{accountId}/chat/conversation/{conversationId}")
            ;


            modelBuilder.Entity <ChatMessageLog>()
            .Property(c => c.ConversationId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("conversationId")
            ;

            modelBuilder.Entity <ChatMessageLog>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 28
0
        /// <summary>
        /// Sets up the model for the 3Seventy REST clients.
        /// </summary>
        /// <param name="modelBuilder">The model building configuration object.</param>
        override protected void OnModelCreating(RestModelBuilder modelBuilder)
        {
            AccountSetup(modelBuilder);

            ContactSetup(modelBuilder);

            ContentSetup(modelBuilder);

            SubscriptionSetup(modelBuilder);

            CampaignSetup(modelBuilder);

            KeywordSetup(modelBuilder);

            EventSetup(modelBuilder);

            CallbackSetup(modelBuilder);

            m_log.Trace("Model setup");
        }
Exemplo n.º 29
0
        private static void KeywordContactSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <KeywordContact>()
            .UriFormat("/account/{accountId}/keyword/{keywordId}/contact")
            ;

            modelBuilder.Entity <KeywordContact>()
            .Property(k => k.KeywordId)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("keywordId")
            ;


            modelBuilder.Entity <KeywordContact>()
            .Property(k => k.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }
Exemplo n.º 30
0
        private static void ActionImportContactsSetup(RestModelBuilder modelBuilder)
        {
            modelBuilder.Entity <ActionImportContacts>()
            .UriFormat("/account/{accountId}/action-importContacts/{actionId}")
            ;


            modelBuilder.Entity <ActionImportContacts>()
            .Property(c => c.Id)
            .OptionalUrlSegment()
            .PrimaryKey()
            .MapTo("actionId")
            ;

            modelBuilder.Entity <ActionImportContacts>()
            .Property(c => c.AccountId)
            .UrlSegment()
            .MapTo("accountId")
            ;
        }