From 988ff62f30b2da48e09cc1527b281b7c1dec732c Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Thu, 11 Jun 2020 14:41:08 +0300 Subject: [PATCH] update channel features --- v1/client_test.go | 4 ++++ v1/types.go | 29 ++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/v1/client_test.go b/v1/client_test.go index bb9ac35..54440ed 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -72,6 +72,10 @@ func templateChannel(t *testing.T) uint64 { Quoting: ChannelFeatureBoth, Deleting: ChannelFeatureBoth, }, + CustomerExternalID: ChannelFeatureCustomerExternalIDPhone, + SendingPolicy: SendingPolicy{ + NewCustomer: ChannelFeatureSendingPolicyTemplate, + }, }, }) diff --git a/v1/types.go b/v1/types.go index ae6f9cb..b228bf6 100644 --- a/v1/types.go +++ b/v1/types.go @@ -16,6 +16,14 @@ const ( ChannelFeatureSend string = "send" // ChannelFeatureBoth channel implement feature on both directions ChannelFeatureBoth string = "both" + // ChannelFeatureAny channel implement feature on any + ChannelFeatureAny string = "any" + // ChannelFeatureSendingPolicyNo channel can not implement feature + ChannelFeatureSendingPolicyNo string = "no" + // ChannelFeatureSendingPolicyTemplate channel can implement template + ChannelFeatureSendingPolicyTemplate string = "template" + // ChannelFeatureCustomerExternalIDPhone customer externalId is phone + ChannelFeatureCustomerExternalIDPhone string = "phone" // MsgTypeText text message MsgTypeText string = "text" @@ -77,13 +85,15 @@ type Channel struct { // ChannelSettings struct type ChannelSettings struct { - SpamAllowed bool `json:"spam_allowed"` - Status Status `json:"status"` - Text ChannelSettingsText `json:"text"` - Product Product `json:"product"` - Order Order `json:"order"` - File ChannelSettingsFilesBase `json:"file"` - Image ChannelSettingsFilesBase `json:"image"` + SpamAllowed bool `json:"spam_allowed"` + Status Status `json:"status"` + Text ChannelSettingsText `json:"text"` + Product Product `json:"product"` + Order Order `json:"order"` + File ChannelSettingsFilesBase `json:"file"` + Image ChannelSettingsFilesBase `json:"image"` + CustomerExternalID string `json:"customer_external_id,omitempty"` + SendingPolicy SendingPolicy `json:"sending_policy,omitempty"` } // Product type @@ -126,6 +136,11 @@ type ChannelSettingsFilesBase struct { CommentMaxCharsCount int `json:"comment_max_chars_count,omitempty"` } +type SendingPolicy struct { + NewCustomer string `json:"new_customer,omitempty"` + AfterReplyTimeout string `json:"after_reply_timeout,omitempty"` +} + // FullFileResponse uploaded file data type FullFileResponse struct { ID string `json:"id,omitempty"`