From 125e3ba0b3f316f6d3a355fe5a267ad16b53efa0 Mon Sep 17 00:00:00 2001 From: Alexander Kulinich Date: Tue, 2 Feb 2021 17:38:19 +0300 Subject: [PATCH] remove unused parameter ChannelSettings.SpamAllowed --- README.md | 3 +-- v1/client.go | 2 -- v1/client_test.go | 4 ---- v1/types.go | 14 +++++++------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 46f8b3c..36ee8be 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,8 @@ func main() { var client = v1.New("https://token.url", "cb8ccf05e38a47543ad8477d49bcba99be73bff503ea6") ch := Channel{ Type: "telegram", - Name: "@my_shopping_bot" + Name: "@my_shopping_bot", Settings: ChannelSettings{ - SpamAllowed: false, Status: Status{ Delivered: ChannelFeatureNone, Read: ChannelFeatureReceive, diff --git a/v1/client.go b/v1/client.go index 5d8b945..be8c241 100644 --- a/v1/client.go +++ b/v1/client.go @@ -221,7 +221,6 @@ func (c *MgClient) TransportChannels(request Channels) ([]ChannelListItem, int, // Type: "telegram", // Name: "@my_shopping_bot", // Settings: ChannelSettings{ -// SpamAllowed: false, // Status: Status{ // Delivered: ChannelFeatureNone, // Read: ChannelFeatureReceive, @@ -282,7 +281,6 @@ func (c *MgClient) ActivateTransportChannel(request Channel) (ActivateResponse, // Type: "telegram", // Name: "@my_shopping_bot", // Settings: ChannelSettings{ -// SpamAllowed: false, // Status: Status{ // Delivered: ChannelFeatureNone, // Read: ChannelFeatureReceive, diff --git a/v1/client_test.go b/v1/client_test.go index 54440ed..2909da8 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -36,7 +36,6 @@ func templateChannel(t *testing.T) uint64 { Type: "telegram", Name: "@test_channel_templates", Settings: ChannelSettings{ - SpamAllowed: false, Status: Status{ Delivered: ChannelFeatureBoth, Read: ChannelFeatureBoth, @@ -108,7 +107,6 @@ func TestMgClient_ActivateTransportChannel(t *testing.T) { Type: "telegram", Name: "@my_shopping_bot", Settings: ChannelSettings{ - SpamAllowed: false, Status: Status{ Delivered: ChannelFeatureNone, Read: ChannelFeatureReceive, @@ -152,7 +150,6 @@ func TestMgClient_ActivateNewTransportChannel(t *testing.T) { Type: "telegram", Name: "@my_shopping_bot", Settings: ChannelSettings{ - SpamAllowed: false, Status: Status{ Delivered: ChannelFeatureNone, Read: ChannelFeatureBoth, @@ -207,7 +204,6 @@ func TestMgClient_UpdateTransportChannel(t *testing.T) { ID: channelID, Name: "@my_shopping_bot_2", Settings: ChannelSettings{ - SpamAllowed: false, Status: Status{ Delivered: ChannelFeatureNone, Read: ChannelFeatureBoth, diff --git a/v1/types.go b/v1/types.go index 16710b3..7551cc8 100644 --- a/v1/types.go +++ b/v1/types.go @@ -67,12 +67,13 @@ const ( ) type ErrorType string + const ( - GeneralError ErrorType = "general" - CustomerNotExistsError = "customer_not_exists" - ReplyTimedOutError = "reply_timed_out" - SpamSuspicionError = "spam_suspicion" - AccessRestrictedError = "access_restricted" + GeneralError ErrorType = "general" + CustomerNotExistsError = "customer_not_exists" + ReplyTimedOutError = "reply_timed_out" + SpamSuspicionError = "spam_suspicion" + AccessRestrictedError = "access_restricted" ) // MgClient type @@ -95,7 +96,6 @@ 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"` @@ -551,7 +551,7 @@ func NewSentMessageResponse(externalMessageID string) TransportResponse { return TransportResponse{ExternalMessageID: externalMessageID} } -func NewTransportErrorResponse(code TransportErrorCode, message string) TransportResponse { +func NewTransportErrorResponse(code TransportErrorCode, message string) TransportResponse { return TransportResponse{ Error: &TransportError{ Code: code,