Skip to content

Commit

Permalink
feat: generated
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Nov 16, 2023
1 parent 23f0861 commit 86e4c82
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Params Types:

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#APIResponseSingleID">APIResponseSingleID</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#SessionAffinity">SessionAffinity</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneAPIResponseSingleID">ZoneAPIResponseSingleID</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneNewResponse">ZoneNewResponse</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneGetResponse">ZoneGetResponse</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneUpdateResponse">ZoneUpdateResponse</a>
Expand All @@ -19,7 +19,7 @@ Methods:
- <code title="get /zones/{identifier}">client.Zones.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneGetResponse">ZoneGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="patch /zones/{identifier}">client.Zones.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneUpdateParams">ZoneUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneUpdateResponse">ZoneUpdateResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /zones">client.Zones.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneListParams">ZoneListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneListResponse">ZoneListResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="delete /zones/{identifier}">client.Zones.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#APIResponseSingleID">APIResponseSingleID</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="delete /zones/{identifier}">client.Zones.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneAPIResponseSingleID">ZoneAPIResponseSingleID</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## LoadBalancers

Expand Down
106 changes: 53 additions & 53 deletions zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,44 @@ func (r *ZoneService) List(ctx context.Context, query ZoneListParams, opts ...op
}

// Deletes an existing zone.
func (r *ZoneService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *APIResponseSingleID, err error) {
func (r *ZoneService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *ZoneAPIResponseSingleID, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("zones/%s", identifier)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return
}

type APIResponseSingleID struct {
Errors []APIResponseSingleIDError `json:"errors"`
Messages []APIResponseSingleIDMessage `json:"messages"`
Result APIResponseSingleIDResult `json:"result,nullable"`
// The session_affinity specifies the type of session affinity the load balancer
// should use unless specified as "none" or ""(default). The supported types are
// "cookie" and "ip_cookie". "cookie" - On the first request to a proxied load
// balancer, a cookie is generated, encoding information of which origin the
// request will be forwarded to. Subsequent requests, by the same client to the
// same load balancer, will be sent to the origin server the cookie encodes, for
// the duration of the cookie and as long as the origin server remains healthy. If
// the cookie has expired or the origin server is unhealthy then a new origin
// server is calculated and used. "ip_cookie" behaves the same as "cookie" except
// the initial origin selection is stable and based on the client’s ip address.
type SessionAffinity string

const (
SessionAffinityNone SessionAffinity = "none"
SessionAffinityCookie SessionAffinity = "cookie"
SessionAffinityIPCookie SessionAffinity = "ip_cookie"
SessionAffinityEmpty SessionAffinity = "\"\""
)

type ZoneAPIResponseSingleID struct {
Errors []ZoneAPIResponseSingleIDError `json:"errors"`
Messages []ZoneAPIResponseSingleIDMessage `json:"messages"`
Result ZoneAPIResponseSingleIDResult `json:"result,nullable"`
// Whether the API call was successful
Success bool `json:"success"`
JSON apiResponseSingleIDJSON `json:"-"`
Success bool `json:"success"`
JSON zoneAPIResponseSingleIDJSON `json:"-"`
}

// apiResponseSingleIDJSON contains the JSON metadata for the struct
// [APIResponseSingleID]
type apiResponseSingleIDJSON struct {
// zoneAPIResponseSingleIDJSON contains the JSON metadata for the struct
// [ZoneAPIResponseSingleID]
type zoneAPIResponseSingleIDJSON struct {
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
Expand All @@ -101,85 +120,66 @@ type apiResponseSingleIDJSON struct {
ExtraFields map[string]apijson.Field
}

func (r *APIResponseSingleID) UnmarshalJSON(data []byte) (err error) {
func (r *ZoneAPIResponseSingleID) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

type APIResponseSingleIDError struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON apiResponseSingleIDErrorJSON `json:"-"`
type ZoneAPIResponseSingleIDError struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneAPIResponseSingleIDErrorJSON `json:"-"`
}

// apiResponseSingleIDErrorJSON contains the JSON metadata for the struct
// [APIResponseSingleIDError]
type apiResponseSingleIDErrorJSON struct {
// zoneAPIResponseSingleIDErrorJSON contains the JSON metadata for the struct
// [ZoneAPIResponseSingleIDError]
type zoneAPIResponseSingleIDErrorJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *APIResponseSingleIDError) UnmarshalJSON(data []byte) (err error) {
func (r *ZoneAPIResponseSingleIDError) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

type APIResponseSingleIDMessage struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON apiResponseSingleIDMessageJSON `json:"-"`
type ZoneAPIResponseSingleIDMessage struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneAPIResponseSingleIDMessageJSON `json:"-"`
}

// apiResponseSingleIDMessageJSON contains the JSON metadata for the struct
// [APIResponseSingleIDMessage]
type apiResponseSingleIDMessageJSON struct {
// zoneAPIResponseSingleIDMessageJSON contains the JSON metadata for the struct
// [ZoneAPIResponseSingleIDMessage]
type zoneAPIResponseSingleIDMessageJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *APIResponseSingleIDMessage) UnmarshalJSON(data []byte) (err error) {
func (r *ZoneAPIResponseSingleIDMessage) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

type APIResponseSingleIDResult struct {
type ZoneAPIResponseSingleIDResult struct {
// Identifier
ID string `json:"id,required"`
JSON apiResponseSingleIDResultJSON `json:"-"`
ID string `json:"id,required"`
JSON zoneAPIResponseSingleIDResultJSON `json:"-"`
}

// apiResponseSingleIDResultJSON contains the JSON metadata for the struct
// [APIResponseSingleIDResult]
type apiResponseSingleIDResultJSON struct {
// zoneAPIResponseSingleIDResultJSON contains the JSON metadata for the struct
// [ZoneAPIResponseSingleIDResult]
type zoneAPIResponseSingleIDResultJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *APIResponseSingleIDResult) UnmarshalJSON(data []byte) (err error) {
func (r *ZoneAPIResponseSingleIDResult) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

// The session_affinity specifies the type of session affinity the load balancer
// should use unless specified as "none" or ""(default). The supported types are
// "cookie" and "ip_cookie". "cookie" - On the first request to a proxied load
// balancer, a cookie is generated, encoding information of which origin the
// request will be forwarded to. Subsequent requests, by the same client to the
// same load balancer, will be sent to the origin server the cookie encodes, for
// the duration of the cookie and as long as the origin server remains healthy. If
// the cookie has expired or the origin server is unhealthy then a new origin
// server is calculated and used. "ip_cookie" behaves the same as "cookie" except
// the initial origin selection is stable and based on the client’s ip address.
type SessionAffinity string

const (
SessionAffinityNone SessionAffinity = "none"
SessionAffinityCookie SessionAffinity = "cookie"
SessionAffinityIPCookie SessionAffinity = "ip_cookie"
SessionAffinityEmpty SessionAffinity = "\"\""
)

type ZoneNewResponse struct {
Errors []ZoneNewResponseError `json:"errors"`
Messages []ZoneNewResponseMessage `json:"messages"`
Expand Down

0 comments on commit 86e4c82

Please sign in to comment.