Skip to content

Commit

Permalink
Merge pull request #1526 from cloudflare/release-please--branches--v2…
Browse files Browse the repository at this point in the history
…--changes--next

release: 2.0.0-beta.2
  • Loading branch information
jacobbednarz authored Mar 11, 2024
2 parents 9b665e0 + 313696d commit 9d547bb
Show file tree
Hide file tree
Showing 1,138 changed files with 18,156 additions and 8,949 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.0.0-beta.1"
".": "2.0.0-beta.2"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1256
configured_endpoints: 1288
294 changes: 294 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To use a local version of this library from source in another project, edit the
directive. This can be done through the CLI with the following:

```bash
go mod edit -replace github.com/cloudflare/cloudflare-go=/path/to/cloudflare-go
go mod edit -replace github.com/cloudflare/cloudflare-go/v2=/path/to/cloudflare-go
```

## Running tests
Expand Down
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cloudflare Go API Library

<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go"><img src="https://pkg.go.dev/badge/github.com/cloudflare/cloudflare-go.svg" alt="Go Reference"></a>
<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2"><img src="https://pkg.go.dev/badge/github.com/cloudflare/cloudflare-go/v2.svg" alt="Go Reference"></a>

The Cloudflare Go library provides convenient access to [the Cloudflare REST
API](https://developers.cloudflare.com/api) from applications written in Go. The full API of this library can be found in [api.md](api.md).
Expand All @@ -11,7 +11,7 @@ API](https://developers.cloudflare.com/api) from applications written in Go. The

```go
import (
"github.com/cloudflare/cloudflare-go" // imported as cloudflare
"github.com/cloudflare/cloudflare-go/v2" // imported as cloudflare
)
```

Expand All @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/cloudflare/cloudflare-go@v2.0.0-beta.1'
go get -u 'github.com/cloudflare/cloudflare-go/v2@v2.0.0-beta.2'
```

<!-- x-release-please-end -->
Expand All @@ -42,9 +42,9 @@ import (
"context"
"fmt"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/zones"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/cloudflare/cloudflare-go/v2/zones"
)

func main() {
Expand Down Expand Up @@ -159,7 +159,7 @@ client.Zones.New(context.TODO(), ...,
)
```

See the [full list of request options](https://pkg.go.dev/github.com/cloudflare/cloudflare-go/option).
See the [full list of request options](https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/option).

### Pagination

Expand All @@ -168,14 +168,31 @@ This library provides some conveniences for working with paginated list endpoint
You can use `.ListAutoPaging()` methods to iterate through items across all pages:

```go
// TODO
iter := client.Accounts.ListAutoPaging(context.TODO(), accounts.AccountListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
accountListResponse := iter.Current()
fmt.Printf("%+v\n", accountListResponse)
}
if err := iter.Err(); err != nil {
panic(err.Error())
}
```

Or you can use simple `.List()` methods to fetch a single page and receive a standard response object
with additional helper methods like `.GetNextPage()`, e.g.:

```go
// TODO
page, err := client.Accounts.List(context.TODO(), accounts.AccountListParams{})
for page != nil {
for _, account := range page.Result {
fmt.Printf("%+v\n", account)
}
page, err = page.GetNextPage()
}
if err != nil {
panic(err.Error())
}
```

### Errors
Expand Down
12 changes: 6 additions & 6 deletions accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"reflect"
"time"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/apiquery"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/apiquery"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions accounts/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/accounts"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestAccountUpdateWithOptionalParams(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion accounts/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package accounts

import (
"github.com/cloudflare/cloudflare-go/internal/apierror"
"github.com/cloudflare/cloudflare-go/v2/internal/apierror"
)

type Error = apierror.Error
12 changes: 6 additions & 6 deletions accounts/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"net/http"
"net/url"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/apiquery"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/apiquery"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
)

// MemberService contains methods and other services that help with interacting
Expand Down
8 changes: 4 additions & 4 deletions accounts/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/accounts"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestMemberNewWithOptionalParams(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions accounts/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions accounts/role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/accounts"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestRoleList(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion acm/acm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package acm

import (
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/option"
)

// ACMService contains methods and other services that help with interacting with
Expand Down
2 changes: 1 addition & 1 deletion acm/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package acm

import (
"github.com/cloudflare/cloudflare-go/internal/apierror"
"github.com/cloudflare/cloudflare-go/v2/internal/apierror"
)

type Error = apierror.Error
8 changes: 4 additions & 4 deletions acm/totaltls.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"fmt"
"net/http"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/option"
)

// TotalTLSService contains methods and other services that help with interacting
Expand Down
8 changes: 4 additions & 4 deletions acm/totaltls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/acm"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/acm"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestTotalTLSNewWithOptionalParams(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressing.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package addressing

import (
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/option"
)

// AddressingService contains methods and other services that help with interacting
Expand Down
10 changes: 5 additions & 5 deletions addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"reflect"
"time"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions addressing/addressmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/addressing"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/addressing"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestAddressMapNewWithOptionalParams(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions addressing/addressmapaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions addressing/addressmapaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/addressing"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/addressing"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestAddressMapAccountUpdate(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions addressing/addressmapip.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions addressing/addressmapip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/addressing"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/addressing"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestAddressMapIPUpdate(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions addressing/addressmapzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/internal/apijson"
"github.com/cloudflare/cloudflare-go/internal/param"
"github.com/cloudflare/cloudflare-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/internal/shared"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

Expand Down
8 changes: 4 additions & 4 deletions addressing/addressmapzone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"testing"

"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/addressing"
"github.com/cloudflare/cloudflare-go/internal/testutil"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/v2"
"github.com/cloudflare/cloudflare-go/v2/addressing"
"github.com/cloudflare/cloudflare-go/v2/internal/testutil"
"github.com/cloudflare/cloudflare-go/v2/option"
)

func TestAddressMapZoneUpdate(t *testing.T) {
Expand Down
Loading

0 comments on commit 9d547bb

Please sign in to comment.