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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 2.2.0 #1841

Merged
merged 127 commits into from May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
70fd793
feat(api): OpenAPI spec update via Stainless API (#1840)
stainless-app[bot] Apr 24, 2024
09c26b2
feat(api): OpenAPI spec update via Stainless API (#1842)
stainless-app[bot] Apr 24, 2024
7b8a09a
feat(api): OpenAPI spec update via Stainless API (#1843)
stainless-app[bot] Apr 24, 2024
e1ec709
feat(api): update via SDK Studio (#1844)
stainless-app[bot] Apr 25, 2024
b8d823d
feat(api): OpenAPI spec update via Stainless API (#1846)
stainless-app[bot] Apr 26, 2024
80de1e4
feat(api): OpenAPI spec update via Stainless API (#1847)
stainless-app[bot] Apr 26, 2024
5639725
feat(api): OpenAPI spec update via Stainless API (#1848)
stainless-app[bot] Apr 26, 2024
c2df704
feat(api): OpenAPI spec update via Stainless API (#1849)
stainless-app[bot] Apr 26, 2024
df733af
feat(api): OpenAPI spec update via Stainless API (#1850)
stainless-app[bot] Apr 27, 2024
edc969b
feat(api): OpenAPI spec update via Stainless API (#1851)
stainless-app[bot] Apr 27, 2024
f7060f8
feat(api): update via SDK Studio (#1852)
stainless-app[bot] Apr 29, 2024
996eeec
feat(api): OpenAPI spec update via Stainless API (#1853)
stainless-app[bot] Apr 29, 2024
aa70500
feat(api): OpenAPI spec update via Stainless API (#1854)
stainless-app[bot] Apr 29, 2024
1fa8a1c
feat(api): OpenAPI spec update via Stainless API (#1855)
stainless-app[bot] Apr 29, 2024
e1b6ec9
feat(api): OpenAPI spec update via Stainless API (#1856)
stainless-app[bot] Apr 29, 2024
a7d2733
feat(api): OpenAPI spec update via Stainless API (#1857)
stainless-app[bot] Apr 29, 2024
ee3b21e
feat(api): OpenAPI spec update via Stainless API (#1858)
stainless-app[bot] Apr 29, 2024
1fb5075
feat(api): OpenAPI spec update via Stainless API (#1859)
stainless-app[bot] Apr 29, 2024
1f57de4
feat(api): OpenAPI spec update via Stainless API (#1860)
stainless-app[bot] Apr 29, 2024
de62d6c
feat(api): OpenAPI spec update via Stainless API (#1862)
stainless-app[bot] Apr 29, 2024
eea4b41
feat(api): OpenAPI spec update via Stainless API (#1863)
stainless-app[bot] Apr 29, 2024
8baf2a6
feat(api): OpenAPI spec update via Stainless API (#1864)
stainless-app[bot] Apr 29, 2024
202f084
feat(api): update via SDK Studio (#1865)
stainless-app[bot] Apr 29, 2024
692ea51
feat(api): OpenAPI spec update via Stainless API (#1866)
stainless-app[bot] Apr 30, 2024
a31112e
feat(api): OpenAPI spec update via Stainless API (#1867)
stainless-app[bot] Apr 30, 2024
f41dd89
feat(api): OpenAPI spec update via Stainless API (#1868)
stainless-app[bot] Apr 30, 2024
c89613a
feat(api): OpenAPI spec update via Stainless API (#1869)
stainless-app[bot] Apr 30, 2024
2d5e060
feat(api): OpenAPI spec update via Stainless API (#1870)
stainless-app[bot] Apr 30, 2024
fd8fd26
feat(api): OpenAPI spec update via Stainless API (#1871)
stainless-app[bot] Apr 30, 2024
3fb734c
feat(api): OpenAPI spec update via Stainless API (#1872)
stainless-app[bot] Apr 30, 2024
daca4b8
feat(api): OpenAPI spec update via Stainless API (#1873)
stainless-app[bot] Apr 30, 2024
fcf413b
feat(api): OpenAPI spec update via Stainless API (#1874)
stainless-app[bot] Apr 30, 2024
6e45fb6
feat(api): OpenAPI spec update via Stainless API (#1875)
stainless-app[bot] Apr 30, 2024
b66804f
feat(api): OpenAPI spec update via Stainless API (#1876)
stainless-app[bot] Apr 30, 2024
e1bbcc9
feat(api): OpenAPI spec update via Stainless API (#1877)
stainless-app[bot] Apr 30, 2024
a6cc625
feat(api): OpenAPI spec update via Stainless API (#1878)
stainless-app[bot] Apr 30, 2024
0d8323b
feat(api): OpenAPI spec update via Stainless API (#1879)
stainless-app[bot] Apr 30, 2024
826316c
feat(api): OpenAPI spec update via Stainless API (#1880)
stainless-app[bot] Apr 30, 2024
26a4ef1
feat(api): OpenAPI spec update via Stainless API (#1881)
stainless-app[bot] Apr 30, 2024
213386a
feat(api): OpenAPI spec update via Stainless API (#1882)
stainless-app[bot] Apr 30, 2024
af2c259
feat(api): OpenAPI spec update via Stainless API (#1883)
stainless-app[bot] Apr 30, 2024
59cd9f9
chore: rebuild project due to oas spec rename (#1884)
stainless-app[bot] Apr 30, 2024
a436f5e
feat(api): OpenAPI spec update via Stainless API (#1885)
stainless-app[bot] Apr 30, 2024
b04a64c
feat(api): update via SDK Studio (#1886)
stainless-app[bot] May 1, 2024
57e8e6d
feat(api): OpenAPI spec update via Stainless API (#1888)
stainless-app[bot] May 1, 2024
c0be306
feat(api): OpenAPI spec update via Stainless API (#1889)
stainless-app[bot] May 1, 2024
278feb2
feat(api): OpenAPI spec update via Stainless API (#1890)
stainless-app[bot] May 1, 2024
2cff27f
feat(api): OpenAPI spec update via Stainless API (#1891)
stainless-app[bot] May 1, 2024
fa7b98a
feat(api): OpenAPI spec update via Stainless API (#1892)
stainless-app[bot] May 1, 2024
fb652db
feat(api): update via SDK Studio (#1893)
stainless-app[bot] May 1, 2024
3cc9b87
feat(api): OpenAPI spec update via Stainless API (#1894)
stainless-app[bot] May 1, 2024
2941913
feat(api): OpenAPI spec update via Stainless API (#1895)
stainless-app[bot] May 1, 2024
1cce5eb
feat(api): OpenAPI spec update via Stainless API (#1896)
stainless-app[bot] May 1, 2024
8d66bd0
feat(api): OpenAPI spec update via Stainless API (#1897)
stainless-app[bot] May 1, 2024
9ce240b
feat(api): OpenAPI spec update via Stainless API (#1898)
stainless-app[bot] May 1, 2024
0afd266
feat(api): OpenAPI spec update via Stainless API (#1899)
stainless-app[bot] May 2, 2024
ed983c5
feat(api): OpenAPI spec update via Stainless API (#1900)
stainless-app[bot] May 2, 2024
febb26e
feat(api): update via SDK Studio (#1901)
stainless-app[bot] May 2, 2024
7fa905b
feat(api): OpenAPI spec update via Stainless API (#1902)
stainless-app[bot] May 2, 2024
94fd2fa
feat(api): update via SDK Studio (#1903)
stainless-app[bot] May 2, 2024
ba91f41
feat(api): OpenAPI spec update via Stainless API (#1904)
stainless-app[bot] May 2, 2024
685462c
feat(api): OpenAPI spec update via Stainless API (#1905)
stainless-app[bot] May 2, 2024
22b6349
feat(api): OpenAPI spec update via Stainless API (#1906)
stainless-app[bot] May 2, 2024
1d233d2
feat(api): OpenAPI spec update via Stainless API (#1907)
stainless-app[bot] May 2, 2024
2a88d76
feat(api): OpenAPI spec update via Stainless API (#1908)
stainless-app[bot] May 2, 2024
11023d8
feat(api): OpenAPI spec update via Stainless API (#1909)
stainless-app[bot] May 2, 2024
7a42345
feat(api): OpenAPI spec update via Stainless API (#1910)
stainless-app[bot] May 2, 2024
b51a8e2
feat(api): OpenAPI spec update via Stainless API (#1911)
stainless-app[bot] May 2, 2024
1ca418c
feat(api): OpenAPI spec update via Stainless API (#1912)
stainless-app[bot] May 2, 2024
fa9e05d
feat(api): OpenAPI spec update via Stainless API (#1913)
stainless-app[bot] May 2, 2024
7c54539
feat(api): OpenAPI spec update via Stainless API (#1914)
stainless-app[bot] May 2, 2024
23742c3
feat(api): OpenAPI spec update via Stainless API (#1915)
stainless-app[bot] May 2, 2024
45a7df6
feat(api): OpenAPI spec update via Stainless API (#1916)
stainless-app[bot] May 2, 2024
13723cb
feat(api): OpenAPI spec update via Stainless API (#1917)
stainless-app[bot] May 2, 2024
d2945a8
feat(api): OpenAPI spec update via Stainless API (#1918)
stainless-app[bot] May 2, 2024
ce25fff
feat(api): OpenAPI spec update via Stainless API (#1919)
stainless-app[bot] May 2, 2024
faa8286
feat(api): OpenAPI spec update via Stainless API (#1920)
stainless-app[bot] May 2, 2024
27e33d6
feat(api): OpenAPI spec update via Stainless API (#1922)
stainless-app[bot] May 2, 2024
f3f59a8
feat(api): OpenAPI spec update via Stainless API (#1923)
stainless-app[bot] May 2, 2024
ae81799
feat(api): OpenAPI spec update via Stainless API (#1924)
stainless-app[bot] May 2, 2024
14af5b2
feat(api): OpenAPI spec update via Stainless API (#1925)
stainless-app[bot] May 2, 2024
c54229e
feat(api): OpenAPI spec update via Stainless API (#1926)
stainless-app[bot] May 2, 2024
8a91755
feat(api): OpenAPI spec update via Stainless API (#1927)
stainless-app[bot] May 2, 2024
5d85f84
feat(api): OpenAPI spec update via Stainless API (#1928)
stainless-app[bot] May 2, 2024
702d17d
feat(api): OpenAPI spec update via Stainless API (#1929)
stainless-app[bot] May 2, 2024
4ffb758
feat(api): OpenAPI spec update via Stainless API (#1930)
stainless-app[bot] May 2, 2024
1b28fd4
feat(api): OpenAPI spec update via Stainless API (#1931)
stainless-app[bot] May 2, 2024
438210c
feat(api): OpenAPI spec update via Stainless API (#1932)
stainless-app[bot] May 2, 2024
9b5abc3
feat(api): OpenAPI spec update via Stainless API (#1933)
stainless-app[bot] May 2, 2024
3f43810
feat(api): OpenAPI spec update via Stainless API (#1934)
stainless-app[bot] May 2, 2024
97ce462
feat(api): OpenAPI spec update via Stainless API (#1935)
stainless-app[bot] May 3, 2024
6bf1a33
feat(api): OpenAPI spec update via Stainless API (#1936)
stainless-app[bot] May 3, 2024
b36f46d
feat(api): OpenAPI spec update via Stainless API (#1937)
stainless-app[bot] May 3, 2024
48003b3
feat(api): OpenAPI spec update via Stainless API (#1940)
stainless-app[bot] May 3, 2024
b911f69
feat(api): OpenAPI spec update via Stainless API (#1941)
stainless-app[bot] May 3, 2024
24ed50d
feat(api): OpenAPI spec update via Stainless API (#1942)
stainless-app[bot] May 4, 2024
dc821a6
feat(api): OpenAPI spec update via Stainless API (#1943)
stainless-app[bot] May 4, 2024
9f18a22
feat(api): update via SDK Studio (#1945)
stainless-app[bot] May 6, 2024
036568e
feat(api): update via SDK Studio (#1946)
stainless-app[bot] May 6, 2024
b96b046
feat(api): OpenAPI spec update via Stainless API (#1947)
stainless-app[bot] May 6, 2024
cda1d98
feat(api): OpenAPI spec update via Stainless API (#1948)
stainless-app[bot] May 6, 2024
08c17df
feat(api): update via SDK Studio (#1949)
stainless-app[bot] May 6, 2024
fb2ff25
feat(api): OpenAPI spec update via Stainless API (#1950)
stainless-app[bot] May 6, 2024
6a198de
feat(api): OpenAPI spec update via Stainless API (#1951)
stainless-app[bot] May 6, 2024
77ff8dc
feat(api): OpenAPI spec update via Stainless API (#1952)
stainless-app[bot] May 6, 2024
9bbf92c
feat(api): OpenAPI spec update via Stainless API (#1953)
stainless-app[bot] May 6, 2024
ef1504c
feat(api): OpenAPI spec update via Stainless API (#1954)
stainless-app[bot] May 6, 2024
ecbc2ad
feat(api): OpenAPI spec update via Stainless API (#1955)
stainless-app[bot] May 6, 2024
324465c
feat(api): OpenAPI spec update via Stainless API (#1957)
stainless-app[bot] May 6, 2024
539d2ee
feat(api): update via SDK Studio (#1958)
stainless-app[bot] May 6, 2024
4298c46
feat(api): update via SDK Studio (#1960)
stainless-app[bot] May 7, 2024
493200d
feat(api): update via SDK Studio (#1961)
stainless-app[bot] May 7, 2024
a70e598
feat(api): update via SDK Studio (#1962)
stainless-app[bot] May 7, 2024
515ec56
feat(api): update via SDK Studio (#1963)
stainless-app[bot] May 7, 2024
7a0993d
feat(api): update via SDK Studio (#1964)
stainless-app[bot] May 7, 2024
e1341b8
feat(api): update via SDK Studio (#1965)
stainless-app[bot] May 7, 2024
069c7fe
feat(api): update via SDK Studio (#1966)
stainless-app[bot] May 7, 2024
04a6457
feat(api): update via SDK Studio (#1967)
stainless-app[bot] May 7, 2024
3c5fbcb
feat(api): update via SDK Studio (#1968)
stainless-app[bot] May 7, 2024
3c696e7
feat(api): update via SDK Studio (#1969)
stainless-app[bot] May 7, 2024
c4160d3
feat(api): update via SDK Studio (#1970)
stainless-app[bot] May 7, 2024
d0005c2
feat(api): update via SDK Studio (#1971)
stainless-app[bot] May 7, 2024
abb726f
feat(api): update via SDK Studio (#1972)
stainless-app[bot] May 7, 2024
3789b4c
feat(api): update via SDK Studio (#1973)
stainless-app[bot] May 7, 2024
95f5df8
feat(api): update via SDK Studio (#1976)
stainless-app[bot] May 8, 2024
3943c86
feat(api): update via SDK Studio (#1977)
stainless-app[bot] May 8, 2024
97ed11d
release: 2.2.0
stainless-app[bot] May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -21,5 +21,19 @@ jobs:

- run: |
go build ./...
test:
name: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test


2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.repository == 'cloudflare/cloudflare-go' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check release environment
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
codegen.log
Brewfile.lock.json
.idea/
2 changes: 1 addition & 1 deletion .release-please-manifest.json
@@ -1,3 +1,3 @@
{
".": "2.1.0"
".": "2.2.0"
}
3 changes: 2 additions & 1 deletion .stats.yml
@@ -1 +1,2 @@
configured_endpoints: 1266
configured_endpoints: 1274
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-07ec76fab00de3d6227209faf0af1ed586cde9e2f243c13d3db555da20f13d99.yml
137 changes: 137 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/cloudflare/cloudflare-go/v2@v2.1.0'
go get -u 'github.com/cloudflare/cloudflare-go/v2@v2.2.0'
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -57,7 +57,7 @@ func main() {
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
}),
Name: cloudflare.F("example.com"),
Type: cloudflare.F(zones.ZoneNewParamsTypeFull),
Type: cloudflare.F(zones.TypeFull),
})
if err != nil {
panic(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion accounts/account.go
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/cloudflare/cloudflare-go/v2/internal/pagination"
"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/cloudflare/cloudflare-go/v2/shared"
"github.com/tidwall/gjson"
)

Expand Down
3 changes: 0 additions & 3 deletions accounts/account_test.go
Expand Up @@ -15,7 +15,6 @@ import (
)

func TestAccountUpdateWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -49,7 +48,6 @@ func TestAccountUpdateWithOptionalParams(t *testing.T) {
}

func TestAccountListWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down Expand Up @@ -78,7 +76,6 @@ func TestAccountListWithOptionalParams(t *testing.T) {
}

func TestAccountGet(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand Down
42 changes: 41 additions & 1 deletion accounts/aliases.go
Expand Up @@ -4,7 +4,7 @@ package accounts

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

type Error = apierror.Error
Expand Down Expand Up @@ -44,6 +44,35 @@ type AuditLogOwner = shared.AuditLogOwner
// This is an alias to an internal type.
type AuditLogResource = shared.AuditLogResource

// The Certificate Authority that will issue the certificate
//
// This is an alias to an internal type.
type CertificateCA = shared.CertificateCA

// This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert

// This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle

// This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

// Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa),
// or "keyless-certificate" (for Keyless SSL servers).
//
// This is an alias to an internal type.
type CertificateRequestType = shared.CertificateRequestType

// This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

// This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

// This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

// A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
//
// This is an alias to an internal type.
Expand Down Expand Up @@ -113,3 +142,14 @@ type ResponseInfo = shared.ResponseInfo

// This is an alias to an internal type.
type Role = shared.Role

// Direction to order DNS records in.
//
// This is an alias to an internal type.
type SortDirection = shared.SortDirection

// This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc

// This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
47 changes: 29 additions & 18 deletions accounts/member.go
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/cloudflare/cloudflare-go/v2/internal/pagination"
"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/cloudflare/cloudflare-go/v2/shared"
)

// MemberService contains methods and other services that help with interacting
Expand All @@ -38,7 +38,7 @@ func NewMemberService(opts ...option.RequestOption) (r *MemberService) {
func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ...option.RequestOption) (res *UserWithInviteCode, err error) {
opts = append(r.Options[:], opts...)
var env MemberNewResponseEnvelope
path := fmt.Sprintf("accounts/%v/members", params.AccountID)
path := fmt.Sprintf("accounts/%s/members", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
Expand All @@ -51,7 +51,7 @@ func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ..
func (r *MemberService) Update(ctx context.Context, memberID string, params MemberUpdateParams, opts ...option.RequestOption) (res *shared.Member, err error) {
opts = append(r.Options[:], opts...)
var env MemberUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", params.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
Expand All @@ -65,7 +65,7 @@ func (r *MemberService) List(ctx context.Context, params MemberListParams, opts
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%v/members", params.AccountID)
path := fmt.Sprintf("accounts/%s/members", params.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
if err != nil {
return nil, err
Expand All @@ -84,10 +84,10 @@ func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListPar
}

// Remove a member from an account.
func (r *MemberService) Delete(ctx context.Context, memberID string, params MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
func (r *MemberService) Delete(ctx context.Context, memberID string, body MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env MemberDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", body.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -100,7 +100,7 @@ func (r *MemberService) Delete(ctx context.Context, memberID string, params Memb
func (r *MemberService) Get(ctx context.Context, memberID string, query MemberGetParams, opts ...option.RequestOption) (res *shared.Member, err error) {
opts = append(r.Options[:], opts...)
var env MemberGetResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", query.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", query.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -109,6 +109,22 @@ func (r *MemberService) Get(ctx context.Context, memberID string, query MemberGe
return
}

// Whether the user is a member of the organization or has an inivitation pending.
type Status string

const (
StatusMember Status = "member"
StatusInvited Status = "invited"
)

func (r Status) IsKnown() bool {
switch r {
case StatusMember, StatusInvited:
return true
}
return false
}

type UserWithInviteCode struct {
// Membership identifier tag.
ID string `json:"id,required"`
Expand Down Expand Up @@ -322,7 +338,7 @@ func (r memberDeleteResponseJSON) RawJSON() string {
}

type MemberNewParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
// The contact email address of the user.
Email param.Field[string] `json:"email,required"`
// Array of roles associated with this member.
Expand Down Expand Up @@ -393,8 +409,8 @@ func (r MemberNewResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberUpdateParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
Member shared.MemberParam `json:"member,required"`
AccountID param.Field[string] `path:"account_id,required"`
Member shared.MemberParam `json:"member,required"`
}

func (r MemberUpdateParams) MarshalJSON() (data []byte, err error) {
Expand Down Expand Up @@ -445,7 +461,7 @@ func (r MemberUpdateResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberListParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
// Direction to order results.
Direction param.Field[MemberListParamsDirection] `query:"direction"`
// Field to order results by.
Expand Down Expand Up @@ -518,12 +534,7 @@ func (r MemberListParamsStatus) IsKnown() bool {
}

type MemberDeleteParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r MemberDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
AccountID param.Field[string] `path:"account_id,required"`
}

type MemberDeleteResponseEnvelope struct {
Expand Down Expand Up @@ -570,7 +581,7 @@ func (r MemberDeleteResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberGetParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
}

type MemberGetResponseEnvelope struct {
Expand Down
19 changes: 7 additions & 12 deletions accounts/member_test.go
Expand Up @@ -10,13 +10,12 @@ import (

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

func TestMemberNewWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -30,7 +29,7 @@ func TestMemberNewWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Accounts.Members.New(context.TODO(), accounts.MemberNewParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Email: cloudflare.F("user@example.com"),
Roles: cloudflare.F([]string{"3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb"}),
Status: cloudflare.F(accounts.MemberNewParamsStatusAccepted),
Expand All @@ -45,7 +44,7 @@ func TestMemberNewWithOptionalParams(t *testing.T) {
}

func TestMemberUpdate(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
t.Skip("TODO: investigate broken test")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -62,7 +61,7 @@ func TestMemberUpdate(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberUpdateParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Member: shared.MemberParam{
Roles: cloudflare.F([]shared.MemberRoleParam{{
ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
Expand All @@ -84,7 +83,6 @@ func TestMemberUpdate(t *testing.T) {
}

func TestMemberListWithOptionalParams(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -98,7 +96,7 @@ func TestMemberListWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Accounts.Members.List(context.TODO(), accounts.MemberListParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Direction: cloudflare.F(accounts.MemberListParamsDirectionDesc),
Order: cloudflare.F(accounts.MemberListParamsOrderStatus),
Page: cloudflare.F(1.000000),
Expand All @@ -115,7 +113,6 @@ func TestMemberListWithOptionalParams(t *testing.T) {
}

func TestMemberDelete(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -132,8 +129,7 @@ func TestMemberDelete(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberDeleteParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
Body: map[string]interface{}{},
AccountID: cloudflare.F("string"),
},
)
if err != nil {
Expand All @@ -146,7 +142,6 @@ func TestMemberDelete(t *testing.T) {
}

func TestMemberGet(t *testing.T) {
t.Skip("skipped: tests are disabled for the time being")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -163,7 +158,7 @@ func TestMemberGet(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberGetParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
},
)
if err != nil {
Expand Down