Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

member has memberactivity, not activity #61

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Golang client for [MailChimp API 3.0](http://developer.mailchimp.com/documentati
Install with `go get`:

```bash
$ go get github.com/hanzoai/gochimp3
$ go get github.com/Elandiro/gochimp3
```

## Usage
Expand All @@ -19,7 +19,7 @@ import (
"fmt"
"os"

"github.com/hanzoai/gochimp3"
"github.com/Elandiro/gochimp3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/hanzoai/gochimp3
module github.com/Elandiro/gochimp3

go 1.13

Expand Down
17 changes: 15 additions & 2 deletions lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gochimp3
import (
"errors"
"fmt"
"strconv"
)

const (
Expand Down Expand Up @@ -499,6 +500,18 @@ func (interestCategory *InterestCategory) CreateInterest(body *InterestRequest)
// ------------------------------------------------------------------------------------------------
// Batch subscribe list members
// ------------------------------------------------------------------------------------------------
type BatchSubscribeMembersParams struct {
SkipMergeValidation bool `json:"skip_merge_validation"`
SkipDuplicateCheck bool `json:"skip_duplicate_check"`
}

func (b *BatchSubscribeMembersParams) Params() map[string]string {
params := make(map[string]string)
params["skip_merge_validation"] = strconv.FormatBool(b.SkipMergeValidation)
params["skip_duplicate_check"] = strconv.FormatBool(b.SkipDuplicateCheck)
return params
}

type BatchSubscribeMembersError struct {
EmailAddress string `json:"email_address"`
ErrorMessage string `json:"error"`
Expand All @@ -523,15 +536,15 @@ type BatchSubscribeMembersRequest struct {
UpdateExisting bool `json:"update_existing"`
}

func (list *ListResponse) BatchSubscribeMembers(body *BatchSubscribeMembersRequest) (*BatchSubscribeMembersResponse, error) {
func (list *ListResponse) BatchSubscribeMembers(body *BatchSubscribeMembersRequest, params *BatchSubscribeMembersParams) (*BatchSubscribeMembersResponse, error) {
if err := list.CanMakeRequest(); err != nil {
return nil, err
}

endpoint := fmt.Sprintf(lists_batch_subscribe_members, list.ID)
response := new(BatchSubscribeMembersResponse)

return response, list.api.Request("POST", endpoint, nil, body, response)
return response, list.api.Request("POST", endpoint, params, body, response)
}

// ------------------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions members.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ func (list *ListResponse) DeleteMemberPermanent(id string) (bool, error) {
type ListOfMemberActivity struct {
baseList

EmailID string `json:"email_id"`
ListID string `json:"list_id"`
Activity []Activity `json:"activity"`
EmailID string `json:"email_id"`
ListID string `json:"list_id"`
Activity []MemberActivity `json:"activity"`
}

type MemberActivity struct {
Expand Down
2 changes: 1 addition & 1 deletion segments.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type SegmentRequest struct {
type Segment struct {
SegmentRequest

ID string `json:"id"`
ID int `json:"id"`
MemberCount int `json:"member_count"`
Type string `json:"type"`
CreatedAt string `json:"created_at"`
Expand Down