Skip to content

Commit

Permalink
Update go module to v7. (#106)
Browse files Browse the repository at this point in the history
As v7 introduces support for using the Verify API with email recipients,
the `Verify.Recipient` field has been changed from to a string type.
  • Loading branch information
epels authored Jun 25, 2021
1 parent 82e6ea4 commit 6ca8749
Show file tree
Hide file tree
Showing 44 changed files with 56 additions and 53 deletions.
6 changes: 4 additions & 2 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Although those are all breaking changes, it's worth mentioning this new version
### Version suffix
To preserve import compatibility, the go command requires that modules with major version v2 or later use a module path with that major version as the final element.

So all imports of `go-rest-api` are replaced as `go-rest-api/v6`.

So all imports of `go-rest-api` are replaced as `go-rest-api/v6`.

## `v6.1.0` -> `v7.0.0`
### Verify Recipient type
As v7 introduces support for using the Verify API with email recipients, the `Verify.Recipient` field has been changed from to a string type.
2 changes: 1 addition & 1 deletion balance/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package balance
import (
"net/http"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// Balance describes your balance information.
Expand Down
4 changes: 2 additions & 2 deletions balance/balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"testing"

messagebird "github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
messagebird "github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

const (
// ClientVersion is used in User-Agent request header to provide server with API level.
ClientVersion = "6.0.0"
ClientVersion = "7.0.0"

// Endpoint points you to MessageBird REST API.
Endpoint = "https://rest.messagebird.com"
Expand Down
2 changes: 1 addition & 1 deletion contact/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// Contact gets returned by the API.
Expand Down
2 changes: 1 addition & 1 deletion contact/contact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
)

func TestMain(m *testing.M) {
Expand Down
2 changes: 1 addition & 1 deletion conversation/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion conversation/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// ListOptions can be used to set pagination options in List().
Expand Down
2 changes: 1 addition & 1 deletion conversation/conversation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion conversation/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

type MessageCreateRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion conversation/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion conversation/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conversation
import (
"net/http"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

type WebhookCreateRequest struct {
Expand Down
2 changes: 1 addition & 1 deletion conversation/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/messagebird/go-rest-api/v6
module github.com/messagebird/go-rest-api/v7

go 1.14

require github.com/stretchr/testify v1.7.0 // indirect
require github.com/stretchr/testify v1.7.0
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
4 changes: 2 additions & 2 deletions group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/contact"
messagebird "github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/contact"
)

// Group gets returned by the API.
Expand Down
2 changes: 1 addition & 1 deletion group/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion hlr/hlr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// HLR stands for Home Location Register. Contains information about the
Expand Down
4 changes: 2 additions & 2 deletions hlr/hlr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

"github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/mbtest/test_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"testing"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// testWriter can be used to have the client write to the tests's error log.
Expand Down
4 changes: 2 additions & 2 deletions lookup/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"net/url"

messagebird "github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/hlr"
messagebird "github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/hlr"
)

// Formats represents phone number in multiple formats.
Expand Down
4 changes: 2 additions & 2 deletions lookup/lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"testing"

"github.com/messagebird/go-rest-api/v6/hlr"
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/hlr"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion mms/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// Message represents a MMS Message.
Expand Down
4 changes: 2 additions & 2 deletions mms/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
messagebird "github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion number/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"strconv"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion number/number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion sms/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// TypeDetails is a hash with extra information.
Expand Down
4 changes: 2 additions & 2 deletions sms/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
messagebird "github.com/messagebird/go-rest-api/v7"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// Verify object represents MessageBird server response.
Expand Down
2 changes: 1 addition & 1 deletion verify/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion voice/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// CallStatus enumerates all valid values for a call status.
Expand Down
2 changes: 1 addition & 1 deletion voice/callflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"time"

"github.com/messagebird/go-rest-api/v6"
"github.com/messagebird/go-rest-api/v7"
)

// A CallFlow describes the flow of operations (steps) to be executed when
Expand Down
2 changes: 1 addition & 1 deletion voice/leg.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// LegStatus enumerates all valid values for a leg status.
Expand Down
2 changes: 1 addition & 1 deletion voice/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"testing"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

func testRequest(status int, body []byte) (*messagebird.Client, func()) {
Expand Down
2 changes: 1 addition & 1 deletion voice/paginator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"reflect"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// A Paginator is used to stream the contents of a collection of some type from
Expand Down
2 changes: 1 addition & 1 deletion voice/recording.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"runtime"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// RecordingStatus enumerates all valid values for the status of a recording.
Expand Down
2 changes: 1 addition & 1 deletion voice/recording_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion voice/transcription.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"runtime"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// A Transcription is a textual representation of a recording as text.
Expand Down
2 changes: 1 addition & 1 deletion voice/transcription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion voice/voice.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

const apiRoot = "https://voice.messagebird.com/v1"
Expand Down
2 changes: 1 addition & 1 deletion voice/voice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package voice
import (
"testing"

"github.com/messagebird/go-rest-api/v6/internal/mbtest"
"github.com/messagebird/go-rest-api/v7/internal/mbtest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion voice/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"time"

messagebird "github.com/messagebird/go-rest-api/v6"
messagebird "github.com/messagebird/go-rest-api/v7"
)

// A Webhook is an HTTP callback to your platform. They are sent when calls are
Expand Down
Loading

0 comments on commit 6ca8749

Please sign in to comment.