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

feat(api): OpenAPI spec update via Stainless API #1631

Merged
merged 1 commit into from
Mar 28, 2024
Merged
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
7 changes: 4 additions & 3 deletions accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/apiquery"
"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"
Expand Down Expand Up @@ -54,7 +55,7 @@ func (r *AccountService) Update(ctx context.Context, params AccountUpdateParams,
}

// List all accounts you have ownership or verified access to.
func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[AccountListResponse], err error) {
func (r *AccountService) List(ctx context.Context, query AccountListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[AccountListResponse], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -72,8 +73,8 @@ func (r *AccountService) List(ctx context.Context, query AccountListParams, opts
}

// List all accounts you have ownership or verified access to.
func (r *AccountService) ListAutoPaging(ctx context.Context, query AccountListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[AccountListResponse] {
return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...))
func (r *AccountService) ListAutoPaging(ctx context.Context, query AccountListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[AccountListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, query, opts...))
}

// Get information about a specific account that you are a member of.
Expand Down
8 changes: 4 additions & 4 deletions accounts/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/apiquery"
"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"
)

Expand Down Expand Up @@ -60,7 +60,7 @@ func (r *MemberService) Update(ctx context.Context, memberID string, params Memb
}

// List all members of an account.
func (r *MemberService) List(ctx context.Context, params MemberListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[MemberListResponse], err error) {
func (r *MemberService) List(ctx context.Context, params MemberListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[MemberListResponse], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -78,8 +78,8 @@ func (r *MemberService) List(ctx context.Context, params MemberListParams, opts
}

// List all members of an account.
func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[MemberListResponse] {
return shared.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[MemberListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}

// Remove a member from an account.
Expand Down
7 changes: 4 additions & 3 deletions accounts/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"reflect"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
Expand All @@ -34,7 +35,7 @@ func NewRoleService(opts ...option.RequestOption) (r *RoleService) {
}

// Get all available roles for an account.
func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...option.RequestOption) (res *shared.SinglePage[Role], err error) {
func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Role], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -52,8 +53,8 @@ func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...op
}

// Get all available roles for an account.
func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[Role] {
return shared.NewSinglePageAutoPager(r.List(ctx, query, opts...))
func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Role] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

// Get information about a specific role for an account.
Expand Down
7 changes: 4 additions & 3 deletions addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
Expand Down Expand Up @@ -54,7 +55,7 @@ func (r *AddressMapService) New(ctx context.Context, params AddressMapNewParams,
}

// List all address maps owned by the account.
func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams, opts ...option.RequestOption) (res *shared.SinglePage[AddressingAddressMaps], err error) {
func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AddressingAddressMaps], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -72,8 +73,8 @@ func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams
}

// List all address maps owned by the account.
func (r *AddressMapService) ListAutoPaging(ctx context.Context, query AddressMapListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AddressingAddressMaps] {
return shared.NewSinglePageAutoPager(r.List(ctx, query, opts...))
func (r *AddressMapService) ListAutoPaging(ctx context.Context, query AddressMapListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AddressingAddressMaps] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

// Delete a particular address map owned by the account. An Address Map must be
Expand Down
7 changes: 4 additions & 3 deletions addressing/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
Expand Down Expand Up @@ -52,7 +53,7 @@ func (r *PrefixService) New(ctx context.Context, params PrefixNewParams, opts ..
}

// List all prefixes owned by the account.
func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts ...option.RequestOption) (res *shared.SinglePage[AddressingIpamPrefixes], err error) {
func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AddressingIpamPrefixes], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -70,8 +71,8 @@ func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts .
}

// List all prefixes owned by the account.
func (r *PrefixService) ListAutoPaging(ctx context.Context, query PrefixListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AddressingIpamPrefixes] {
return shared.NewSinglePageAutoPager(r.List(ctx, query, opts...))
func (r *PrefixService) ListAutoPaging(ctx context.Context, query PrefixListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AddressingIpamPrefixes] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

// Delete an unapproved prefix owned by the account.
Expand Down
7 changes: 4 additions & 3 deletions addressing/prefixbgpbinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"reflect"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
Expand Down Expand Up @@ -56,7 +57,7 @@ func (r *PrefixBGPBindingService) New(ctx context.Context, prefixID string, para
// `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
// CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
// IPs in the prefix to Cloudflare Magic Transit.
func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, query PrefixBGPBindingListParams, opts ...option.RequestOption) (res *shared.SinglePage[AddressingServiceBinding], err error) {
func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, query PrefixBGPBindingListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AddressingServiceBinding], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -79,8 +80,8 @@ func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, que
// `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare
// CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other
// IPs in the prefix to Cloudflare Magic Transit.
func (r *PrefixBGPBindingService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixBGPBindingListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AddressingServiceBinding] {
return shared.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
func (r *PrefixBGPBindingService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixBGPBindingListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AddressingServiceBinding] {
return pagination.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
}

// Delete a Service Binding
Expand Down
8 changes: 4 additions & 4 deletions addressing/prefixbgpprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
)

Expand All @@ -37,7 +37,7 @@ func NewPrefixBGPPrefixService(opts ...option.RequestOption) (r *PrefixBGPPrefix
// control which specific subnets are advertised to the Internet. It is possible to
// advertise subnets more specific than an IP Prefix by creating more specific BGP
// Prefixes.
func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, query PrefixBGPPrefixListParams, opts ...option.RequestOption) (res *shared.SinglePage[AddressingIpamBGPPrefixes], err error) {
func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, query PrefixBGPPrefixListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AddressingIpamBGPPrefixes], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -58,8 +58,8 @@ func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, quer
// control which specific subnets are advertised to the Internet. It is possible to
// advertise subnets more specific than an IP Prefix by creating more specific BGP
// Prefixes.
func (r *PrefixBGPPrefixService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixBGPPrefixListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AddressingIpamBGPPrefixes] {
return shared.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
func (r *PrefixBGPPrefixService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixBGPPrefixListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AddressingIpamBGPPrefixes] {
return pagination.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
}

// Update the properties of a BGP Prefix, such as the on demand advertisement
Expand Down
8 changes: 4 additions & 4 deletions addressing/prefixdelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
)

Expand Down Expand Up @@ -47,7 +47,7 @@ func (r *PrefixDelegationService) New(ctx context.Context, prefixID string, para
}

// List all delegations for a given account IP prefix.
func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, query PrefixDelegationListParams, opts ...option.RequestOption) (res *shared.SinglePage[AddressingIpamDelegations], err error) {
func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, query PrefixDelegationListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AddressingIpamDelegations], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -65,8 +65,8 @@ func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, que
}

// List all delegations for a given account IP prefix.
func (r *PrefixDelegationService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixDelegationListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AddressingIpamDelegations] {
return shared.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
func (r *PrefixDelegationService) ListAutoPaging(ctx context.Context, prefixID string, query PrefixDelegationListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AddressingIpamDelegations] {
return pagination.NewSinglePageAutoPager(r.List(ctx, prefixID, query, opts...))
}

// Delete an account delegation for a given IP prefix.
Expand Down
8 changes: 4 additions & 4 deletions addressing/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net/http"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
)

Expand All @@ -35,7 +35,7 @@ func NewServiceService(opts ...option.RequestOption) (r *ServiceService) {
// service running on the Cloudflare network to enable a Cloudflare product on the
// IP addresses. This endpoint can be used as a reference of available services on
// the Cloudflare network, and their service IDs.
func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts ...option.RequestOption) (res *shared.SinglePage[ServiceListResponse], err error) {
func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts ...option.RequestOption) (res *pagination.SinglePage[ServiceListResponse], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -56,8 +56,8 @@ func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts
// service running on the Cloudflare network to enable a Cloudflare product on the
// IP addresses. This endpoint can be used as a reference of available services on
// the Cloudflare network, and their service IDs.
func (r *ServiceService) ListAutoPaging(ctx context.Context, query ServiceListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[ServiceListResponse] {
return shared.NewSinglePageAutoPager(r.List(ctx, query, opts...))
func (r *ServiceService) ListAutoPaging(ctx context.Context, query ServiceListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[ServiceListResponse] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

type ServiceListResponse struct {
Expand Down
7 changes: 4 additions & 3 deletions alerting/destinationwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"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"
Expand Down Expand Up @@ -62,7 +63,7 @@ func (r *DestinationWebhookService) Update(ctx context.Context, webhookID string
}

// Gets a list of all configured webhook destinations.
func (r *DestinationWebhookService) List(ctx context.Context, query DestinationWebhookListParams, opts ...option.RequestOption) (res *shared.SinglePage[AlertingWebhooks], err error) {
func (r *DestinationWebhookService) List(ctx context.Context, query DestinationWebhookListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AlertingWebhooks], err error) {
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -80,8 +81,8 @@ func (r *DestinationWebhookService) List(ctx context.Context, query DestinationW
}

// Gets a list of all configured webhook destinations.
func (r *DestinationWebhookService) ListAutoPaging(ctx context.Context, query DestinationWebhookListParams, opts ...option.RequestOption) *shared.SinglePageAutoPager[AlertingWebhooks] {
return shared.NewSinglePageAutoPager(r.List(ctx, query, opts...))
func (r *DestinationWebhookService) ListAutoPaging(ctx context.Context, query DestinationWebhookListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AlertingWebhooks] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}

// Delete a configured webhook destination.
Expand Down
Loading