-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05765b7
commit 1f0ad9d
Showing
74 changed files
with
23,196 additions
and
844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
configured_endpoints: 1096 | ||
configured_endpoints: 1170 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
// File generated from our OpenAPI spec by Stainless. | ||
|
||
package cloudflare_test | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
"os" | ||
"testing" | ||
|
||
"github.com/cloudflare/cloudflare-sdk-go" | ||
"github.com/cloudflare/cloudflare-sdk-go/internal/testutil" | ||
"github.com/cloudflare/cloudflare-sdk-go/option" | ||
) | ||
|
||
func TestAddressAddressMapNewWithOptionalParams(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 | ||
} | ||
if !testutil.CheckTestServer(t, baseURL) { | ||
return | ||
} | ||
client := cloudflare.NewClient( | ||
option.WithBaseURL(baseURL), | ||
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), | ||
option.WithAPIEmail("dev@cloudflare.com"), | ||
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), | ||
option.WithUserServiceKey("My User Service Key"), | ||
) | ||
_, err := client.Addresses.AddressMaps.New( | ||
context.TODO(), | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
cloudflare.AddressAddressMapNewParams{ | ||
Description: cloudflare.F("My Ecommerce zones"), | ||
Enabled: cloudflare.F(true), | ||
}, | ||
) | ||
if err != nil { | ||
var apierr *cloudflare.Error | ||
if errors.As(err, &apierr) { | ||
t.Log(string(apierr.DumpRequest(true))) | ||
} | ||
t.Fatalf("err should be nil: %s", err.Error()) | ||
} | ||
} | ||
|
||
func TestAddressAddressMapUpdateWithOptionalParams(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 | ||
} | ||
if !testutil.CheckTestServer(t, baseURL) { | ||
return | ||
} | ||
client := cloudflare.NewClient( | ||
option.WithBaseURL(baseURL), | ||
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), | ||
option.WithAPIEmail("dev@cloudflare.com"), | ||
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), | ||
option.WithUserServiceKey("My User Service Key"), | ||
) | ||
_, err := client.Addresses.AddressMaps.Update( | ||
context.TODO(), | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
cloudflare.AddressAddressMapUpdateParams{ | ||
DefaultSni: cloudflare.F("*.example.com"), | ||
Description: cloudflare.F("My Ecommerce zones"), | ||
Enabled: cloudflare.F(true), | ||
}, | ||
) | ||
if err != nil { | ||
var apierr *cloudflare.Error | ||
if errors.As(err, &apierr) { | ||
t.Log(string(apierr.DumpRequest(true))) | ||
} | ||
t.Fatalf("err should be nil: %s", err.Error()) | ||
} | ||
} | ||
|
||
func TestAddressAddressMapList(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 | ||
} | ||
if !testutil.CheckTestServer(t, baseURL) { | ||
return | ||
} | ||
client := cloudflare.NewClient( | ||
option.WithBaseURL(baseURL), | ||
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), | ||
option.WithAPIEmail("dev@cloudflare.com"), | ||
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), | ||
option.WithUserServiceKey("My User Service Key"), | ||
) | ||
_, err := client.Addresses.AddressMaps.List(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") | ||
if err != nil { | ||
var apierr *cloudflare.Error | ||
if errors.As(err, &apierr) { | ||
t.Log(string(apierr.DumpRequest(true))) | ||
} | ||
t.Fatalf("err should be nil: %s", err.Error()) | ||
} | ||
} | ||
|
||
func TestAddressAddressMapDelete(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 | ||
} | ||
if !testutil.CheckTestServer(t, baseURL) { | ||
return | ||
} | ||
client := cloudflare.NewClient( | ||
option.WithBaseURL(baseURL), | ||
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), | ||
option.WithAPIEmail("dev@cloudflare.com"), | ||
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), | ||
option.WithUserServiceKey("My User Service Key"), | ||
) | ||
_, err := client.Addresses.AddressMaps.Delete( | ||
context.TODO(), | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
) | ||
if err != nil { | ||
var apierr *cloudflare.Error | ||
if errors.As(err, &apierr) { | ||
t.Log(string(apierr.DumpRequest(true))) | ||
} | ||
t.Fatalf("err should be nil: %s", err.Error()) | ||
} | ||
} | ||
|
||
func TestAddressAddressMapGet(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 | ||
} | ||
if !testutil.CheckTestServer(t, baseURL) { | ||
return | ||
} | ||
client := cloudflare.NewClient( | ||
option.WithBaseURL(baseURL), | ||
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), | ||
option.WithAPIEmail("dev@cloudflare.com"), | ||
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), | ||
option.WithUserServiceKey("My User Service Key"), | ||
) | ||
_, err := client.Addresses.AddressMaps.Get( | ||
context.TODO(), | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
"023e105f4ecef8ad9ca31a8372d0c353", | ||
) | ||
if err != nil { | ||
var apierr *cloudflare.Error | ||
if errors.As(err, &apierr) { | ||
t.Log(string(apierr.DumpRequest(true))) | ||
} | ||
t.Fatalf("err should be nil: %s", err.Error()) | ||
} | ||
} |
Oops, something went wrong.