Skip to content

Commit

Permalink
feat: update via SDK Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 22, 2024
1 parent af8e373 commit 5d77a31
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 87 deletions.
16 changes: 8 additions & 8 deletions acm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import (
"github.com/cloudflare/cloudflare-sdk-go/option"
)

// AcmService contains methods and other services that help with interacting with
// ACMService contains methods and other services that help with interacting with
// the cloudflare API. Note, unlike clients, this service does not read variables
// from the environment automatically. You should not instantiate this service
// directly, and instead use the [NewAcmService] method instead.
type AcmService struct {
// directly, and instead use the [NewACMService] method instead.
type ACMService struct {
Options []option.RequestOption
TotalTLS *AcmTotalTLSService
TotalTLS *ACMTotalTLSService
}

// NewAcmService generates a new service that applies the given options to each
// NewACMService generates a new service that applies the given options to each
// request. These options are applied after the parent client's options (if there
// is one), and before any request-specific options.
func NewAcmService(opts ...option.RequestOption) (r *AcmService) {
r = &AcmService{}
func NewACMService(opts ...option.RequestOption) (r *ACMService) {
r = &ACMService{}
r.Options = opts
r.TotalTLS = NewAcmTotalTLSService(opts...)
r.TotalTLS = NewACMTotalTLSService(opts...)
return
}
132 changes: 66 additions & 66 deletions acmtotaltls.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ import (
"github.com/cloudflare/cloudflare-sdk-go/option"
)

// AcmTotalTLSService contains methods and other services that help with
// ACMTotalTLSService contains methods and other services that help with
// interacting with the cloudflare API. Note, unlike clients, this service does not
// read variables from the environment automatically. You should not instantiate
// this service directly, and instead use the [NewAcmTotalTLSService] method
// this service directly, and instead use the [NewACMTotalTLSService] method
// instead.
type AcmTotalTLSService struct {
type ACMTotalTLSService struct {
Options []option.RequestOption
}

// NewAcmTotalTLSService generates a new service that applies the given options to
// NewACMTotalTLSService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewAcmTotalTLSService(opts ...option.RequestOption) (r *AcmTotalTLSService) {
r = &AcmTotalTLSService{}
func NewACMTotalTLSService(opts ...option.RequestOption) (r *ACMTotalTLSService) {
r = &ACMTotalTLSService{}
r.Options = opts
return
}

// Set Total TLS Settings or disable the feature for a Zone.
func (r *AcmTotalTLSService) New(ctx context.Context, zoneID string, body AcmTotalTLSNewParams, opts ...option.RequestOption) (res *AcmTotalTLSNewResponse, err error) {
func (r *ACMTotalTLSService) New(ctx context.Context, zoneID string, body ACMTotalTLSNewParams, opts ...option.RequestOption) (res *ACMTotalTLSNewResponse, err error) {
opts = append(r.Options[:], opts...)
var env AcmTotalTLSNewResponseEnvelope
var env ACMTotalTLSNewResponseEnvelope
path := fmt.Sprintf("zones/%s/acm/total_tls", zoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
if err != nil {
Expand All @@ -45,9 +45,9 @@ func (r *AcmTotalTLSService) New(ctx context.Context, zoneID string, body AcmTot
}

// Get Total TLS Settings for a Zone.
func (r *AcmTotalTLSService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *AcmTotalTLSGetResponse, err error) {
func (r *ACMTotalTLSService) Get(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *ACMTotalTLSGetResponse, err error) {
opts = append(r.Options[:], opts...)
var env AcmTotalTLSGetResponseEnvelope
var env ACMTotalTLSGetResponseEnvelope
path := fmt.Sprintf("zones/%s/acm/total_tls", zoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
Expand All @@ -57,19 +57,19 @@ func (r *AcmTotalTLSService) Get(ctx context.Context, zoneID string, opts ...opt
return
}

type AcmTotalTLSNewResponse struct {
type ACMTotalTLSNewResponse struct {
// The Certificate Authority that Total TLS certificates will be issued through.
CertificateAuthority AcmTotalTLSNewResponseCertificateAuthority `json:"certificate_authority"`
CertificateAuthority ACMTotalTLSNewResponseCertificateAuthority `json:"certificate_authority"`
// If enabled, Total TLS will order a hostname specific TLS certificate for any
// proxied A, AAAA, or CNAME record in your zone.
Enabled bool `json:"enabled"`
// The validity period in days for the certificates ordered via Total TLS.
ValidityDays AcmTotalTLSNewResponseValidityDays `json:"validity_days"`
ValidityDays ACMTotalTLSNewResponseValidityDays `json:"validity_days"`
JSON acmTotalTLSNewResponseJSON `json:"-"`
}

// acmTotalTLSNewResponseJSON contains the JSON metadata for the struct
// [AcmTotalTLSNewResponse]
// [ACMTotalTLSNewResponse]
type acmTotalTLSNewResponseJSON struct {
CertificateAuthority apijson.Field
Enabled apijson.Field
Expand All @@ -78,38 +78,38 @@ type acmTotalTLSNewResponseJSON struct {
ExtraFields map[string]apijson.Field
}

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

// The Certificate Authority that Total TLS certificates will be issued through.
type AcmTotalTLSNewResponseCertificateAuthority string
type ACMTotalTLSNewResponseCertificateAuthority string

const (
AcmTotalTLSNewResponseCertificateAuthorityGoogle AcmTotalTLSNewResponseCertificateAuthority = "google"
AcmTotalTLSNewResponseCertificateAuthorityLetsEncrypt AcmTotalTLSNewResponseCertificateAuthority = "lets_encrypt"
ACMTotalTLSNewResponseCertificateAuthorityGoogle ACMTotalTLSNewResponseCertificateAuthority = "google"
ACMTotalTLSNewResponseCertificateAuthorityLetsEncrypt ACMTotalTLSNewResponseCertificateAuthority = "lets_encrypt"
)

// The validity period in days for the certificates ordered via Total TLS.
type AcmTotalTLSNewResponseValidityDays int64
type ACMTotalTLSNewResponseValidityDays int64

const (
AcmTotalTLSNewResponseValidityDays90 AcmTotalTLSNewResponseValidityDays = 90
ACMTotalTLSNewResponseValidityDays90 ACMTotalTLSNewResponseValidityDays = 90
)

type AcmTotalTLSGetResponse struct {
type ACMTotalTLSGetResponse struct {
// The Certificate Authority that Total TLS certificates will be issued through.
CertificateAuthority AcmTotalTLSGetResponseCertificateAuthority `json:"certificate_authority"`
CertificateAuthority ACMTotalTLSGetResponseCertificateAuthority `json:"certificate_authority"`
// If enabled, Total TLS will order a hostname specific TLS certificate for any
// proxied A, AAAA, or CNAME record in your zone.
Enabled bool `json:"enabled"`
// The validity period in days for the certificates ordered via Total TLS.
ValidityDays AcmTotalTLSGetResponseValidityDays `json:"validity_days"`
ValidityDays ACMTotalTLSGetResponseValidityDays `json:"validity_days"`
JSON acmTotalTLSGetResponseJSON `json:"-"`
}

// acmTotalTLSGetResponseJSON contains the JSON metadata for the struct
// [AcmTotalTLSGetResponse]
// [ACMTotalTLSGetResponse]
type acmTotalTLSGetResponseJSON struct {
CertificateAuthority apijson.Field
Enabled apijson.Field
Expand All @@ -118,56 +118,56 @@ type acmTotalTLSGetResponseJSON struct {
ExtraFields map[string]apijson.Field
}

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

// The Certificate Authority that Total TLS certificates will be issued through.
type AcmTotalTLSGetResponseCertificateAuthority string
type ACMTotalTLSGetResponseCertificateAuthority string

const (
AcmTotalTLSGetResponseCertificateAuthorityGoogle AcmTotalTLSGetResponseCertificateAuthority = "google"
AcmTotalTLSGetResponseCertificateAuthorityLetsEncrypt AcmTotalTLSGetResponseCertificateAuthority = "lets_encrypt"
ACMTotalTLSGetResponseCertificateAuthorityGoogle ACMTotalTLSGetResponseCertificateAuthority = "google"
ACMTotalTLSGetResponseCertificateAuthorityLetsEncrypt ACMTotalTLSGetResponseCertificateAuthority = "lets_encrypt"
)

// The validity period in days for the certificates ordered via Total TLS.
type AcmTotalTLSGetResponseValidityDays int64
type ACMTotalTLSGetResponseValidityDays int64

const (
AcmTotalTLSGetResponseValidityDays90 AcmTotalTLSGetResponseValidityDays = 90
ACMTotalTLSGetResponseValidityDays90 ACMTotalTLSGetResponseValidityDays = 90
)

type AcmTotalTLSNewParams struct {
type ACMTotalTLSNewParams struct {
// If enabled, Total TLS will order a hostname specific TLS certificate for any
// proxied A, AAAA, or CNAME record in your zone.
Enabled param.Field[bool] `json:"enabled,required"`
// The Certificate Authority that Total TLS certificates will be issued through.
CertificateAuthority param.Field[AcmTotalTLSNewParamsCertificateAuthority] `json:"certificate_authority"`
CertificateAuthority param.Field[ACMTotalTLSNewParamsCertificateAuthority] `json:"certificate_authority"`
}

func (r AcmTotalTLSNewParams) MarshalJSON() (data []byte, err error) {
func (r ACMTotalTLSNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// The Certificate Authority that Total TLS certificates will be issued through.
type AcmTotalTLSNewParamsCertificateAuthority string
type ACMTotalTLSNewParamsCertificateAuthority string

const (
AcmTotalTLSNewParamsCertificateAuthorityGoogle AcmTotalTLSNewParamsCertificateAuthority = "google"
AcmTotalTLSNewParamsCertificateAuthorityLetsEncrypt AcmTotalTLSNewParamsCertificateAuthority = "lets_encrypt"
ACMTotalTLSNewParamsCertificateAuthorityGoogle ACMTotalTLSNewParamsCertificateAuthority = "google"
ACMTotalTLSNewParamsCertificateAuthorityLetsEncrypt ACMTotalTLSNewParamsCertificateAuthority = "lets_encrypt"
)

type AcmTotalTLSNewResponseEnvelope struct {
Errors []AcmTotalTLSNewResponseEnvelopeErrors `json:"errors,required"`
Messages []AcmTotalTLSNewResponseEnvelopeMessages `json:"messages,required"`
Result AcmTotalTLSNewResponse `json:"result,required"`
type ACMTotalTLSNewResponseEnvelope struct {
Errors []ACMTotalTLSNewResponseEnvelopeErrors `json:"errors,required"`
Messages []ACMTotalTLSNewResponseEnvelopeMessages `json:"messages,required"`
Result ACMTotalTLSNewResponse `json:"result,required"`
// Whether the API call was successful
Success AcmTotalTLSNewResponseEnvelopeSuccess `json:"success,required"`
Success ACMTotalTLSNewResponseEnvelopeSuccess `json:"success,required"`
JSON acmTotalTLSNewResponseEnvelopeJSON `json:"-"`
}

// acmTotalTLSNewResponseEnvelopeJSON contains the JSON metadata for the struct
// [AcmTotalTLSNewResponseEnvelope]
// [ACMTotalTLSNewResponseEnvelope]
type acmTotalTLSNewResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Expand All @@ -177,66 +177,66 @@ type acmTotalTLSNewResponseEnvelopeJSON struct {
ExtraFields map[string]apijson.Field
}

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

type AcmTotalTLSNewResponseEnvelopeErrors struct {
type ACMTotalTLSNewResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON acmTotalTLSNewResponseEnvelopeErrorsJSON `json:"-"`
}

// acmTotalTLSNewResponseEnvelopeErrorsJSON contains the JSON metadata for the
// struct [AcmTotalTLSNewResponseEnvelopeErrors]
// struct [ACMTotalTLSNewResponseEnvelopeErrors]
type acmTotalTLSNewResponseEnvelopeErrorsJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type AcmTotalTLSNewResponseEnvelopeMessages struct {
type ACMTotalTLSNewResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON acmTotalTLSNewResponseEnvelopeMessagesJSON `json:"-"`
}

// acmTotalTLSNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
// struct [AcmTotalTLSNewResponseEnvelopeMessages]
// struct [ACMTotalTLSNewResponseEnvelopeMessages]
type acmTotalTLSNewResponseEnvelopeMessagesJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

// Whether the API call was successful
type AcmTotalTLSNewResponseEnvelopeSuccess bool
type ACMTotalTLSNewResponseEnvelopeSuccess bool

const (
AcmTotalTLSNewResponseEnvelopeSuccessTrue AcmTotalTLSNewResponseEnvelopeSuccess = true
ACMTotalTLSNewResponseEnvelopeSuccessTrue ACMTotalTLSNewResponseEnvelopeSuccess = true
)

type AcmTotalTLSGetResponseEnvelope struct {
Errors []AcmTotalTLSGetResponseEnvelopeErrors `json:"errors,required"`
Messages []AcmTotalTLSGetResponseEnvelopeMessages `json:"messages,required"`
Result AcmTotalTLSGetResponse `json:"result,required"`
type ACMTotalTLSGetResponseEnvelope struct {
Errors []ACMTotalTLSGetResponseEnvelopeErrors `json:"errors,required"`
Messages []ACMTotalTLSGetResponseEnvelopeMessages `json:"messages,required"`
Result ACMTotalTLSGetResponse `json:"result,required"`
// Whether the API call was successful
Success AcmTotalTLSGetResponseEnvelopeSuccess `json:"success,required"`
Success ACMTotalTLSGetResponseEnvelopeSuccess `json:"success,required"`
JSON acmTotalTLSGetResponseEnvelopeJSON `json:"-"`
}

// acmTotalTLSGetResponseEnvelopeJSON contains the JSON metadata for the struct
// [AcmTotalTLSGetResponseEnvelope]
// [ACMTotalTLSGetResponseEnvelope]
type acmTotalTLSGetResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Expand All @@ -246,51 +246,51 @@ type acmTotalTLSGetResponseEnvelopeJSON struct {
ExtraFields map[string]apijson.Field
}

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

type AcmTotalTLSGetResponseEnvelopeErrors struct {
type ACMTotalTLSGetResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON acmTotalTLSGetResponseEnvelopeErrorsJSON `json:"-"`
}

// acmTotalTLSGetResponseEnvelopeErrorsJSON contains the JSON metadata for the
// struct [AcmTotalTLSGetResponseEnvelopeErrors]
// struct [ACMTotalTLSGetResponseEnvelopeErrors]
type acmTotalTLSGetResponseEnvelopeErrorsJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type AcmTotalTLSGetResponseEnvelopeMessages struct {
type ACMTotalTLSGetResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON acmTotalTLSGetResponseEnvelopeMessagesJSON `json:"-"`
}

// acmTotalTLSGetResponseEnvelopeMessagesJSON contains the JSON metadata for the
// struct [AcmTotalTLSGetResponseEnvelopeMessages]
// struct [ACMTotalTLSGetResponseEnvelopeMessages]
type acmTotalTLSGetResponseEnvelopeMessagesJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

// Whether the API call was successful
type AcmTotalTLSGetResponseEnvelopeSuccess bool
type ACMTotalTLSGetResponseEnvelopeSuccess bool

const (
AcmTotalTLSGetResponseEnvelopeSuccessTrue AcmTotalTLSGetResponseEnvelopeSuccess = true
ACMTotalTLSGetResponseEnvelopeSuccessTrue ACMTotalTLSGetResponseEnvelopeSuccess = true
)
Loading

0 comments on commit 5d77a31

Please sign in to comment.