images

package
v2.0.0-beta.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error = apierror.Error

type ImageService

type ImageService struct {
	Options []option.RequestOption
	V1      *V1Service
	V2      *V2Service
}

ImageService 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 NewImageService method instead.

func NewImageService

func NewImageService(opts ...option.RequestOption) (r *ImageService)

NewImageService 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.

type ImageVariant

type ImageVariant struct {
	Variant ImageVariantVariant `json:"variant"`
	JSON    imageVariantJSON    `json:"-"`
}

func (*ImageVariant) UnmarshalJSON

func (r *ImageVariant) UnmarshalJSON(data []byte) (err error)

type ImageVariantVariant

type ImageVariantVariant struct {
	ID interface{} `json:"id,required"`
	// Allows you to define image resizing sizes for different use cases.
	Options ImageVariantVariantOptions `json:"options,required"`
	// Indicates whether the variant can access an image without a signature,
	// regardless of image access control.
	NeverRequireSignedURLs bool                    `json:"neverRequireSignedURLs"`
	JSON                   imageVariantVariantJSON `json:"-"`
}

func (*ImageVariantVariant) UnmarshalJSON

func (r *ImageVariantVariant) UnmarshalJSON(data []byte) (err error)

type ImageVariantVariantOptions

type ImageVariantVariantOptions struct {
	// The fit property describes how the width and height dimensions should be
	// interpreted.
	Fit ImageVariantVariantOptionsFit `json:"fit,required"`
	// Maximum height in image pixels.
	Height float64 `json:"height,required"`
	// What EXIF data should be preserved in the output image.
	Metadata ImageVariantVariantOptionsMetadata `json:"metadata,required"`
	// Maximum width in image pixels.
	Width float64                        `json:"width,required"`
	JSON  imageVariantVariantOptionsJSON `json:"-"`
}

Allows you to define image resizing sizes for different use cases.

func (*ImageVariantVariantOptions) UnmarshalJSON

func (r *ImageVariantVariantOptions) UnmarshalJSON(data []byte) (err error)

type ImageVariantVariantOptionsFit

type ImageVariantVariantOptionsFit string

The fit property describes how the width and height dimensions should be interpreted.

const (
	ImageVariantVariantOptionsFitScaleDown ImageVariantVariantOptionsFit = "scale-down"
	ImageVariantVariantOptionsFitContain   ImageVariantVariantOptionsFit = "contain"
	ImageVariantVariantOptionsFitCover     ImageVariantVariantOptionsFit = "cover"
	ImageVariantVariantOptionsFitCrop      ImageVariantVariantOptionsFit = "crop"
	ImageVariantVariantOptionsFitPad       ImageVariantVariantOptionsFit = "pad"
)

type ImageVariantVariantOptionsMetadata

type ImageVariantVariantOptionsMetadata string

What EXIF data should be preserved in the output image.

const (
	ImageVariantVariantOptionsMetadataKeep      ImageVariantVariantOptionsMetadata = "keep"
	ImageVariantVariantOptionsMetadataCopyright ImageVariantVariantOptionsMetadata = "copyright"
	ImageVariantVariantOptionsMetadataNone      ImageVariantVariantOptionsMetadata = "none"
)

type ImageVariants

type ImageVariants struct {
	Variants ImageVariantsVariants `json:"variants"`
	JSON     imageVariantsJSON     `json:"-"`
}

func (*ImageVariants) UnmarshalJSON

func (r *ImageVariants) UnmarshalJSON(data []byte) (err error)

type ImageVariantsVariants

type ImageVariantsVariants struct {
	Hero ImageVariantsVariantsHero `json:"hero"`
	JSON imageVariantsVariantsJSON `json:"-"`
}

func (*ImageVariantsVariants) UnmarshalJSON

func (r *ImageVariantsVariants) UnmarshalJSON(data []byte) (err error)

type ImageVariantsVariantsHero

type ImageVariantsVariantsHero struct {
	ID interface{} `json:"id,required"`
	// Allows you to define image resizing sizes for different use cases.
	Options ImageVariantsVariantsHeroOptions `json:"options,required"`
	// Indicates whether the variant can access an image without a signature,
	// regardless of image access control.
	NeverRequireSignedURLs bool                          `json:"neverRequireSignedURLs"`
	JSON                   imageVariantsVariantsHeroJSON `json:"-"`
}

func (*ImageVariantsVariantsHero) UnmarshalJSON

func (r *ImageVariantsVariantsHero) UnmarshalJSON(data []byte) (err error)

type ImageVariantsVariantsHeroOptions

type ImageVariantsVariantsHeroOptions struct {
	// The fit property describes how the width and height dimensions should be
	// interpreted.
	Fit ImageVariantsVariantsHeroOptionsFit `json:"fit,required"`
	// Maximum height in image pixels.
	Height float64 `json:"height,required"`
	// What EXIF data should be preserved in the output image.
	Metadata ImageVariantsVariantsHeroOptionsMetadata `json:"metadata,required"`
	// Maximum width in image pixels.
	Width float64                              `json:"width,required"`
	JSON  imageVariantsVariantsHeroOptionsJSON `json:"-"`
}

Allows you to define image resizing sizes for different use cases.

func (*ImageVariantsVariantsHeroOptions) UnmarshalJSON

func (r *ImageVariantsVariantsHeroOptions) UnmarshalJSON(data []byte) (err error)

type ImageVariantsVariantsHeroOptionsFit

type ImageVariantsVariantsHeroOptionsFit string

The fit property describes how the width and height dimensions should be interpreted.

const (
	ImageVariantsVariantsHeroOptionsFitScaleDown ImageVariantsVariantsHeroOptionsFit = "scale-down"
	ImageVariantsVariantsHeroOptionsFitContain   ImageVariantsVariantsHeroOptionsFit = "contain"
	ImageVariantsVariantsHeroOptionsFitCover     ImageVariantsVariantsHeroOptionsFit = "cover"
	ImageVariantsVariantsHeroOptionsFitCrop      ImageVariantsVariantsHeroOptionsFit = "crop"
	ImageVariantsVariantsHeroOptionsFitPad       ImageVariantsVariantsHeroOptionsFit = "pad"
)

type ImageVariantsVariantsHeroOptionsMetadata

type ImageVariantsVariantsHeroOptionsMetadata string

What EXIF data should be preserved in the output image.

const (
	ImageVariantsVariantsHeroOptionsMetadataKeep      ImageVariantsVariantsHeroOptionsMetadata = "keep"
	ImageVariantsVariantsHeroOptionsMetadataCopyright ImageVariantsVariantsHeroOptionsMetadata = "copyright"
	ImageVariantsVariantsHeroOptionsMetadataNone      ImageVariantsVariantsHeroOptionsMetadata = "none"
)

type ImagesImage

type ImagesImage struct {
	// Image unique identifier.
	ID string `json:"id"`
	// Image file name.
	Filename string `json:"filename"`
	// User modifiable key-value store. Can be used for keeping references to another
	// system of record for managing images. Metadata must not exceed 1024 bytes.
	Meta interface{} `json:"meta"`
	// Indicates whether the image can be a accessed only using it's UID. If set to
	// true, a signed token needs to be generated with a signing key to view the image.
	RequireSignedURLs bool `json:"requireSignedURLs"`
	// When the media item was uploaded.
	Uploaded time.Time `json:"uploaded" format:"date-time"`
	// Object specifying available variants for an image.
	Variants []ImagesImageVariant `json:"variants" format:"uri"`
	JSON     imagesImageJSON      `json:"-"`
}

func (*ImagesImage) UnmarshalJSON

func (r *ImagesImage) UnmarshalJSON(data []byte) (err error)

type ImagesImageKeys

type ImagesImageKeys struct {
	Keys []ImagesImageKeysKey `json:"keys"`
	JSON imagesImageKeysJSON  `json:"-"`
}

func (*ImagesImageKeys) UnmarshalJSON

func (r *ImagesImageKeys) UnmarshalJSON(data []byte) (err error)

type ImagesImageKeysKey

type ImagesImageKeysKey struct {
	// Key name.
	Name string `json:"name"`
	// Key value.
	Value string                 `json:"value"`
	JSON  imagesImageKeysKeyJSON `json:"-"`
}

func (*ImagesImageKeysKey) UnmarshalJSON

func (r *ImagesImageKeysKey) UnmarshalJSON(data []byte) (err error)

type ImagesImageVariant

type ImagesImageVariant interface {
	ImplementsImagesImagesImageVariant()
}

URI to thumbnail variant for an image.

Union satisfied by shared.UnionString, shared.UnionString or shared.UnionString.

type ImagesImagesStats

type ImagesImagesStats struct {
	Count ImagesImagesStatsCount `json:"count"`
	JSON  imagesImagesStatsJSON  `json:"-"`
}

func (*ImagesImagesStats) UnmarshalJSON

func (r *ImagesImagesStats) UnmarshalJSON(data []byte) (err error)

type ImagesImagesStatsCount

type ImagesImagesStatsCount struct {
	// Cloudflare Images allowed usage.
	Allowed float64 `json:"allowed"`
	// Cloudflare Images current usage.
	Current float64                    `json:"current"`
	JSON    imagesImagesStatsCountJSON `json:"-"`
}

func (*ImagesImagesStatsCount) UnmarshalJSON

func (r *ImagesImagesStatsCount) UnmarshalJSON(data []byte) (err error)

type V1BlobGetParams

type V1BlobGetParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1BlobService

type V1BlobService struct {
	Options []option.RequestOption
}

V1BlobService 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 NewV1BlobService method instead.

func NewV1BlobService

func NewV1BlobService(opts ...option.RequestOption) (r *V1BlobService)

NewV1BlobService 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 (*V1BlobService) Get

func (r *V1BlobService) Get(ctx context.Context, imageID string, query V1BlobGetParams, opts ...option.RequestOption) (res *http.Response, err error)

Fetch base image. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.

type V1DeleteParams

type V1DeleteParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1DeleteResponse

type V1DeleteResponse interface {
	ImplementsImagesV1DeleteResponse()
}

Union satisfied by images.V1DeleteResponseUnknown or shared.UnionString.

type V1DeleteResponseEnvelope

type V1DeleteResponseEnvelope struct {
	Errors   []V1DeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1DeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   V1DeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success V1DeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1DeleteResponseEnvelopeJSON    `json:"-"`
}

func (*V1DeleteResponseEnvelope) UnmarshalJSON

func (r *V1DeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1DeleteResponseEnvelopeErrors

type V1DeleteResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    v1DeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1DeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *V1DeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1DeleteResponseEnvelopeMessages

type V1DeleteResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    v1DeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1DeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *V1DeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1DeleteResponseEnvelopeSuccess

type V1DeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1DeleteResponseEnvelopeSuccessTrue V1DeleteResponseEnvelopeSuccess = true
)

type V1EditParams

type V1EditParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// User modifiable key-value store. Can be used for keeping references to another
	// system of record for managing images. No change if not specified.
	Metadata param.Field[interface{}] `json:"metadata"`
	// Indicates whether the image can be accessed using only its UID. If set to
	// `true`, a signed token needs to be generated with a signing key to view the
	// image. Returns a new UID on a change. No change if not specified.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
}

func (V1EditParams) MarshalJSON

func (r V1EditParams) MarshalJSON() (data []byte, err error)

type V1EditResponseEnvelope

type V1EditResponseEnvelope struct {
	Errors   []V1EditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1EditResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImage                      `json:"result,required"`
	// Whether the API call was successful
	Success V1EditResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1EditResponseEnvelopeJSON    `json:"-"`
}

func (*V1EditResponseEnvelope) UnmarshalJSON

func (r *V1EditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1EditResponseEnvelopeErrors

type V1EditResponseEnvelopeErrors struct {
	Code    int64                            `json:"code,required"`
	Message string                           `json:"message,required"`
	JSON    v1EditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1EditResponseEnvelopeErrors) UnmarshalJSON

func (r *V1EditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1EditResponseEnvelopeMessages

type V1EditResponseEnvelopeMessages struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    v1EditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1EditResponseEnvelopeMessages) UnmarshalJSON

func (r *V1EditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1EditResponseEnvelopeSuccess

type V1EditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1EditResponseEnvelopeSuccessTrue V1EditResponseEnvelopeSuccess = true
)

type V1GetParams

type V1GetParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1GetResponseEnvelope

type V1GetResponseEnvelope struct {
	Errors   []V1GetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1GetResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImage                     `json:"result,required"`
	// Whether the API call was successful
	Success V1GetResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1GetResponseEnvelopeJSON    `json:"-"`
}

func (*V1GetResponseEnvelope) UnmarshalJSON

func (r *V1GetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1GetResponseEnvelopeErrors

type V1GetResponseEnvelopeErrors struct {
	Code    int64                           `json:"code,required"`
	Message string                          `json:"message,required"`
	JSON    v1GetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1GetResponseEnvelopeErrors) UnmarshalJSON

func (r *V1GetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1GetResponseEnvelopeMessages

type V1GetResponseEnvelopeMessages struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    v1GetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1GetResponseEnvelopeMessages) UnmarshalJSON

func (r *V1GetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1GetResponseEnvelopeSuccess

type V1GetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1GetResponseEnvelopeSuccessTrue V1GetResponseEnvelopeSuccess = true
)

type V1KeyDeleteParams

type V1KeyDeleteParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1KeyDeleteResponseEnvelope

type V1KeyDeleteResponseEnvelope struct {
	Errors   []V1KeyDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1KeyDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImageKeys                       `json:"result,required"`
	// Whether the API call was successful
	Success V1KeyDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1KeyDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*V1KeyDeleteResponseEnvelope) UnmarshalJSON

func (r *V1KeyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1KeyDeleteResponseEnvelopeErrors

type V1KeyDeleteResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    v1KeyDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1KeyDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *V1KeyDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1KeyDeleteResponseEnvelopeMessages

type V1KeyDeleteResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    v1KeyDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1KeyDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *V1KeyDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1KeyDeleteResponseEnvelopeSuccess

type V1KeyDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1KeyDeleteResponseEnvelopeSuccessTrue V1KeyDeleteResponseEnvelopeSuccess = true
)

type V1KeyListParams

type V1KeyListParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1KeyListResponseEnvelope

type V1KeyListResponseEnvelope struct {
	Errors   []V1KeyListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1KeyListResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImageKeys                     `json:"result,required"`
	// Whether the API call was successful
	Success V1KeyListResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1KeyListResponseEnvelopeJSON    `json:"-"`
}

func (*V1KeyListResponseEnvelope) UnmarshalJSON

func (r *V1KeyListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1KeyListResponseEnvelopeErrors

type V1KeyListResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    v1KeyListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1KeyListResponseEnvelopeErrors) UnmarshalJSON

func (r *V1KeyListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1KeyListResponseEnvelopeMessages

type V1KeyListResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    v1KeyListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1KeyListResponseEnvelopeMessages) UnmarshalJSON

func (r *V1KeyListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1KeyListResponseEnvelopeSuccess

type V1KeyListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1KeyListResponseEnvelopeSuccessTrue V1KeyListResponseEnvelopeSuccess = true
)

type V1KeyService

type V1KeyService struct {
	Options []option.RequestOption
}

V1KeyService 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 NewV1KeyService method instead.

func NewV1KeyService

func NewV1KeyService(opts ...option.RequestOption) (r *V1KeyService)

NewV1KeyService 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 (*V1KeyService) Delete

func (r *V1KeyService) Delete(ctx context.Context, signingKeyName interface{}, body V1KeyDeleteParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error)

Delete signing key with specified name. Returns all keys available. When last key is removed, a new default signing key will be generated.

func (*V1KeyService) List

func (r *V1KeyService) List(ctx context.Context, query V1KeyListParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error)

Lists your signing keys. These can be found on your Cloudflare Images dashboard.

func (*V1KeyService) Update

func (r *V1KeyService) Update(ctx context.Context, signingKeyName interface{}, body V1KeyUpdateParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error)

Create a new signing key with specified name. Returns all keys available.

type V1KeyUpdateParams

type V1KeyUpdateParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1KeyUpdateResponseEnvelope

type V1KeyUpdateResponseEnvelope struct {
	Errors   []V1KeyUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1KeyUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImageKeys                       `json:"result,required"`
	// Whether the API call was successful
	Success V1KeyUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1KeyUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*V1KeyUpdateResponseEnvelope) UnmarshalJSON

func (r *V1KeyUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1KeyUpdateResponseEnvelopeErrors

type V1KeyUpdateResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    v1KeyUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1KeyUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *V1KeyUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1KeyUpdateResponseEnvelopeMessages

type V1KeyUpdateResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    v1KeyUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1KeyUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *V1KeyUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1KeyUpdateResponseEnvelopeSuccess

type V1KeyUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1KeyUpdateResponseEnvelopeSuccessTrue V1KeyUpdateResponseEnvelopeSuccess = true
)

type V1ListParams

type V1ListParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (V1ListParams) URLQuery

func (r V1ListParams) URLQuery() (v url.Values)

URLQuery serializes V1ListParams's query parameters as `url.Values`.

type V1ListResponse

type V1ListResponse struct {
	Errors   []V1ListResponseError   `json:"errors,required"`
	Messages []V1ListResponseMessage `json:"messages,required"`
	Result   V1ListResponseResult    `json:"result,required"`
	// Whether the API call was successful
	Success V1ListResponseSuccess `json:"success,required"`
	JSON    v1ListResponseJSON    `json:"-"`
}

func (*V1ListResponse) UnmarshalJSON

func (r *V1ListResponse) UnmarshalJSON(data []byte) (err error)

type V1ListResponseError

type V1ListResponseError struct {
	Code    int64                   `json:"code,required"`
	Message string                  `json:"message,required"`
	JSON    v1ListResponseErrorJSON `json:"-"`
}

func (*V1ListResponseError) UnmarshalJSON

func (r *V1ListResponseError) UnmarshalJSON(data []byte) (err error)

type V1ListResponseMessage

type V1ListResponseMessage struct {
	Code    int64                     `json:"code,required"`
	Message string                    `json:"message,required"`
	JSON    v1ListResponseMessageJSON `json:"-"`
}

func (*V1ListResponseMessage) UnmarshalJSON

func (r *V1ListResponseMessage) UnmarshalJSON(data []byte) (err error)

type V1ListResponseResult

type V1ListResponseResult struct {
	Images []ImagesImage            `json:"images"`
	JSON   v1ListResponseResultJSON `json:"-"`
}

func (*V1ListResponseResult) UnmarshalJSON

func (r *V1ListResponseResult) UnmarshalJSON(data []byte) (err error)

type V1ListResponseSuccess

type V1ListResponseSuccess bool

Whether the API call was successful

const (
	V1ListResponseSuccessTrue V1ListResponseSuccess = true
)

type V1NewParams

type V1NewParams struct {
	// Account identifier tag.
	AccountID param.Field[string]      `path:"account_id,required"`
	Metadata  param.Field[interface{}] `json:"metadata"`
	// Indicates whether the image requires a signature token for the access.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
}

func (V1NewParams) MarshalJSON

func (r V1NewParams) MarshalJSON() (data []byte, err error)

type V1NewResponseEnvelope

type V1NewResponseEnvelope struct {
	Errors   []V1NewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1NewResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImage                     `json:"result,required"`
	// Whether the API call was successful
	Success V1NewResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1NewResponseEnvelopeJSON    `json:"-"`
}

func (*V1NewResponseEnvelope) UnmarshalJSON

func (r *V1NewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1NewResponseEnvelopeErrors

type V1NewResponseEnvelopeErrors struct {
	Code    int64                           `json:"code,required"`
	Message string                          `json:"message,required"`
	JSON    v1NewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1NewResponseEnvelopeErrors) UnmarshalJSON

func (r *V1NewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1NewResponseEnvelopeMessages

type V1NewResponseEnvelopeMessages struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    v1NewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1NewResponseEnvelopeMessages) UnmarshalJSON

func (r *V1NewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1NewResponseEnvelopeSuccess

type V1NewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1NewResponseEnvelopeSuccessTrue V1NewResponseEnvelopeSuccess = true
)

type V1Service

type V1Service struct {
	Options  []option.RequestOption
	Keys     *V1KeyService
	Stats    *V1StatService
	Variants *V1VariantService
	Blobs    *V1BlobService
}

V1Service 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 NewV1Service method instead.

func NewV1Service

func NewV1Service(opts ...option.RequestOption) (r *V1Service)

NewV1Service 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 (*V1Service) Delete

func (r *V1Service) Delete(ctx context.Context, imageID string, body V1DeleteParams, opts ...option.RequestOption) (res *V1DeleteResponse, err error)

Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.

func (*V1Service) Edit

func (r *V1Service) Edit(ctx context.Context, imageID string, params V1EditParams, opts ...option.RequestOption) (res *ImagesImage, err error)

Update image access control. On access control change, all copies of the image are purged from cache.

func (*V1Service) Get

func (r *V1Service) Get(ctx context.Context, imageID string, query V1GetParams, opts ...option.RequestOption) (res *ImagesImage, err error)

Fetch details for a single image.

func (*V1Service) List

List up to 100 images with one request. Use the optional parameters below to get a specific range of images.

func (*V1Service) ListAutoPaging

List up to 100 images with one request. Use the optional parameters below to get a specific range of images.

func (*V1Service) New

func (r *V1Service) New(ctx context.Context, params V1NewParams, opts ...option.RequestOption) (res *ImagesImage, err error)

Upload an image with up to 10 Megabytes using a single HTTP POST (multipart/form-data) request. An image can be uploaded by sending an image file or passing an accessible to an API url.

type V1StatGetParams

type V1StatGetParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1StatGetResponseEnvelope

type V1StatGetResponseEnvelope struct {
	Errors   []V1StatGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1StatGetResponseEnvelopeMessages `json:"messages,required"`
	Result   ImagesImagesStats                   `json:"result,required"`
	// Whether the API call was successful
	Success V1StatGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1StatGetResponseEnvelopeJSON    `json:"-"`
}

func (*V1StatGetResponseEnvelope) UnmarshalJSON

func (r *V1StatGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1StatGetResponseEnvelopeErrors

type V1StatGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    v1StatGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1StatGetResponseEnvelopeErrors) UnmarshalJSON

func (r *V1StatGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1StatGetResponseEnvelopeMessages

type V1StatGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    v1StatGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1StatGetResponseEnvelopeMessages) UnmarshalJSON

func (r *V1StatGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1StatGetResponseEnvelopeSuccess

type V1StatGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1StatGetResponseEnvelopeSuccessTrue V1StatGetResponseEnvelopeSuccess = true
)

type V1StatService

type V1StatService struct {
	Options []option.RequestOption
}

V1StatService 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 NewV1StatService method instead.

func NewV1StatService

func NewV1StatService(opts ...option.RequestOption) (r *V1StatService)

NewV1StatService 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 (*V1StatService) Get

func (r *V1StatService) Get(ctx context.Context, query V1StatGetParams, opts ...option.RequestOption) (res *ImagesImagesStats, err error)

Fetch usage statistics details for Cloudflare Images.

type V1VariantDeleteParams

type V1VariantDeleteParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1VariantDeleteResponse

type V1VariantDeleteResponse interface {
	ImplementsImagesV1VariantDeleteResponse()
}

Union satisfied by images.V1VariantDeleteResponseUnknown or shared.UnionString.

type V1VariantDeleteResponseEnvelope

type V1VariantDeleteResponseEnvelope struct {
	Errors   []V1VariantDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1VariantDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   V1VariantDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success V1VariantDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1VariantDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*V1VariantDeleteResponseEnvelope) UnmarshalJSON

func (r *V1VariantDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1VariantDeleteResponseEnvelopeErrors

type V1VariantDeleteResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    v1VariantDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *V1VariantDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1VariantDeleteResponseEnvelopeMessages

type V1VariantDeleteResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    v1VariantDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *V1VariantDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1VariantDeleteResponseEnvelopeSuccess

type V1VariantDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1VariantDeleteResponseEnvelopeSuccessTrue V1VariantDeleteResponseEnvelopeSuccess = true
)

type V1VariantEditParams

type V1VariantEditParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Allows you to define image resizing sizes for different use cases.
	Options param.Field[V1VariantEditParamsOptions] `json:"options,required"`
	// Indicates whether the variant can access an image without a signature,
	// regardless of image access control.
	NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
}

func (V1VariantEditParams) MarshalJSON

func (r V1VariantEditParams) MarshalJSON() (data []byte, err error)

type V1VariantEditParamsOptions

type V1VariantEditParamsOptions struct {
	// The fit property describes how the width and height dimensions should be
	// interpreted.
	Fit param.Field[V1VariantEditParamsOptionsFit] `json:"fit,required"`
	// Maximum height in image pixels.
	Height param.Field[float64] `json:"height,required"`
	// What EXIF data should be preserved in the output image.
	Metadata param.Field[V1VariantEditParamsOptionsMetadata] `json:"metadata,required"`
	// Maximum width in image pixels.
	Width param.Field[float64] `json:"width,required"`
}

Allows you to define image resizing sizes for different use cases.

func (V1VariantEditParamsOptions) MarshalJSON

func (r V1VariantEditParamsOptions) MarshalJSON() (data []byte, err error)

type V1VariantEditParamsOptionsFit

type V1VariantEditParamsOptionsFit string

The fit property describes how the width and height dimensions should be interpreted.

const (
	V1VariantEditParamsOptionsFitScaleDown V1VariantEditParamsOptionsFit = "scale-down"
	V1VariantEditParamsOptionsFitContain   V1VariantEditParamsOptionsFit = "contain"
	V1VariantEditParamsOptionsFitCover     V1VariantEditParamsOptionsFit = "cover"
	V1VariantEditParamsOptionsFitCrop      V1VariantEditParamsOptionsFit = "crop"
	V1VariantEditParamsOptionsFitPad       V1VariantEditParamsOptionsFit = "pad"
)

type V1VariantEditParamsOptionsMetadata

type V1VariantEditParamsOptionsMetadata string

What EXIF data should be preserved in the output image.

const (
	V1VariantEditParamsOptionsMetadataKeep      V1VariantEditParamsOptionsMetadata = "keep"
	V1VariantEditParamsOptionsMetadataCopyright V1VariantEditParamsOptionsMetadata = "copyright"
	V1VariantEditParamsOptionsMetadataNone      V1VariantEditParamsOptionsMetadata = "none"
)

type V1VariantEditResponseEnvelope

type V1VariantEditResponseEnvelope struct {
	Errors   []V1VariantEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1VariantEditResponseEnvelopeMessages `json:"messages,required"`
	Result   ImageVariant                            `json:"result,required"`
	// Whether the API call was successful
	Success V1VariantEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1VariantEditResponseEnvelopeJSON    `json:"-"`
}

func (*V1VariantEditResponseEnvelope) UnmarshalJSON

func (r *V1VariantEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1VariantEditResponseEnvelopeErrors

type V1VariantEditResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    v1VariantEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1VariantEditResponseEnvelopeErrors) UnmarshalJSON

func (r *V1VariantEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1VariantEditResponseEnvelopeMessages

type V1VariantEditResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    v1VariantEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1VariantEditResponseEnvelopeMessages) UnmarshalJSON

func (r *V1VariantEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1VariantEditResponseEnvelopeSuccess

type V1VariantEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1VariantEditResponseEnvelopeSuccessTrue V1VariantEditResponseEnvelopeSuccess = true
)

type V1VariantGetParams

type V1VariantGetParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1VariantGetResponseEnvelope

type V1VariantGetResponseEnvelope struct {
	Errors   []V1VariantGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1VariantGetResponseEnvelopeMessages `json:"messages,required"`
	Result   ImageVariant                           `json:"result,required"`
	// Whether the API call was successful
	Success V1VariantGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1VariantGetResponseEnvelopeJSON    `json:"-"`
}

func (*V1VariantGetResponseEnvelope) UnmarshalJSON

func (r *V1VariantGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1VariantGetResponseEnvelopeErrors

type V1VariantGetResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    v1VariantGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1VariantGetResponseEnvelopeErrors) UnmarshalJSON

func (r *V1VariantGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1VariantGetResponseEnvelopeMessages

type V1VariantGetResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    v1VariantGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1VariantGetResponseEnvelopeMessages) UnmarshalJSON

func (r *V1VariantGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1VariantGetResponseEnvelopeSuccess

type V1VariantGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1VariantGetResponseEnvelopeSuccessTrue V1VariantGetResponseEnvelopeSuccess = true
)

type V1VariantListParams

type V1VariantListParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type V1VariantListResponseEnvelope

type V1VariantListResponseEnvelope struct {
	Errors   []V1VariantListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1VariantListResponseEnvelopeMessages `json:"messages,required"`
	Result   ImageVariants                           `json:"result,required"`
	// Whether the API call was successful
	Success V1VariantListResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1VariantListResponseEnvelopeJSON    `json:"-"`
}

func (*V1VariantListResponseEnvelope) UnmarshalJSON

func (r *V1VariantListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1VariantListResponseEnvelopeErrors

type V1VariantListResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    v1VariantListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1VariantListResponseEnvelopeErrors) UnmarshalJSON

func (r *V1VariantListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1VariantListResponseEnvelopeMessages

type V1VariantListResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    v1VariantListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1VariantListResponseEnvelopeMessages) UnmarshalJSON

func (r *V1VariantListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1VariantListResponseEnvelopeSuccess

type V1VariantListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1VariantListResponseEnvelopeSuccessTrue V1VariantListResponseEnvelopeSuccess = true
)

type V1VariantNewParams

type V1VariantNewParams struct {
	// Account identifier tag.
	AccountID param.Field[string]      `path:"account_id,required"`
	ID        param.Field[interface{}] `json:"id,required"`
	// Allows you to define image resizing sizes for different use cases.
	Options param.Field[V1VariantNewParamsOptions] `json:"options,required"`
	// Indicates whether the variant can access an image without a signature,
	// regardless of image access control.
	NeverRequireSignedURLs param.Field[bool] `json:"neverRequireSignedURLs"`
}

func (V1VariantNewParams) MarshalJSON

func (r V1VariantNewParams) MarshalJSON() (data []byte, err error)

type V1VariantNewParamsOptions

type V1VariantNewParamsOptions struct {
	// The fit property describes how the width and height dimensions should be
	// interpreted.
	Fit param.Field[V1VariantNewParamsOptionsFit] `json:"fit,required"`
	// Maximum height in image pixels.
	Height param.Field[float64] `json:"height,required"`
	// What EXIF data should be preserved in the output image.
	Metadata param.Field[V1VariantNewParamsOptionsMetadata] `json:"metadata,required"`
	// Maximum width in image pixels.
	Width param.Field[float64] `json:"width,required"`
}

Allows you to define image resizing sizes for different use cases.

func (V1VariantNewParamsOptions) MarshalJSON

func (r V1VariantNewParamsOptions) MarshalJSON() (data []byte, err error)

type V1VariantNewParamsOptionsFit

type V1VariantNewParamsOptionsFit string

The fit property describes how the width and height dimensions should be interpreted.

const (
	V1VariantNewParamsOptionsFitScaleDown V1VariantNewParamsOptionsFit = "scale-down"
	V1VariantNewParamsOptionsFitContain   V1VariantNewParamsOptionsFit = "contain"
	V1VariantNewParamsOptionsFitCover     V1VariantNewParamsOptionsFit = "cover"
	V1VariantNewParamsOptionsFitCrop      V1VariantNewParamsOptionsFit = "crop"
	V1VariantNewParamsOptionsFitPad       V1VariantNewParamsOptionsFit = "pad"
)

type V1VariantNewParamsOptionsMetadata

type V1VariantNewParamsOptionsMetadata string

What EXIF data should be preserved in the output image.

const (
	V1VariantNewParamsOptionsMetadataKeep      V1VariantNewParamsOptionsMetadata = "keep"
	V1VariantNewParamsOptionsMetadataCopyright V1VariantNewParamsOptionsMetadata = "copyright"
	V1VariantNewParamsOptionsMetadataNone      V1VariantNewParamsOptionsMetadata = "none"
)

type V1VariantNewResponseEnvelope

type V1VariantNewResponseEnvelope struct {
	Errors   []V1VariantNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V1VariantNewResponseEnvelopeMessages `json:"messages,required"`
	Result   ImageVariant                           `json:"result,required"`
	// Whether the API call was successful
	Success V1VariantNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    v1VariantNewResponseEnvelopeJSON    `json:"-"`
}

func (*V1VariantNewResponseEnvelope) UnmarshalJSON

func (r *V1VariantNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V1VariantNewResponseEnvelopeErrors

type V1VariantNewResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    v1VariantNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V1VariantNewResponseEnvelopeErrors) UnmarshalJSON

func (r *V1VariantNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V1VariantNewResponseEnvelopeMessages

type V1VariantNewResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    v1VariantNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V1VariantNewResponseEnvelopeMessages) UnmarshalJSON

func (r *V1VariantNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V1VariantNewResponseEnvelopeSuccess

type V1VariantNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V1VariantNewResponseEnvelopeSuccessTrue V1VariantNewResponseEnvelopeSuccess = true
)

type V1VariantService

type V1VariantService struct {
	Options []option.RequestOption
}

V1VariantService 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 NewV1VariantService method instead.

func NewV1VariantService

func NewV1VariantService(opts ...option.RequestOption) (r *V1VariantService)

NewV1VariantService 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 (*V1VariantService) Delete

func (r *V1VariantService) Delete(ctx context.Context, variantID interface{}, body V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error)

Deleting a variant purges the cache for all images associated with the variant.

func (*V1VariantService) Edit

func (r *V1VariantService) Edit(ctx context.Context, variantID interface{}, params V1VariantEditParams, opts ...option.RequestOption) (res *ImageVariant, err error)

Updating a variant purges the cache for all images associated with the variant.

func (*V1VariantService) Get

func (r *V1VariantService) Get(ctx context.Context, variantID interface{}, query V1VariantGetParams, opts ...option.RequestOption) (res *ImageVariant, err error)

Fetch details for a single variant.

func (*V1VariantService) List

Lists existing variants.

func (*V1VariantService) New

func (r *V1VariantService) New(ctx context.Context, params V1VariantNewParams, opts ...option.RequestOption) (res *ImageVariant, err error)

Specify variants that allow you to resize images for different use cases.

type V2DirectUploadNewParams

type V2DirectUploadNewParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The date after which the upload will not be accepted. Minimum: Now + 2 minutes.
	// Maximum: Now + 6 hours.
	Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
	// User modifiable key-value store. Can be used for keeping references to another
	// system of record, for managing images.
	Metadata param.Field[interface{}] `json:"metadata"`
	// Indicates whether the image requires a signature token to be accessed.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
}

func (V2DirectUploadNewParams) MarshalJSON

func (r V2DirectUploadNewParams) MarshalJSON() (data []byte, err error)

type V2DirectUploadNewResponse

type V2DirectUploadNewResponse struct {
	// Image unique identifier.
	ID string `json:"id"`
	// The URL the unauthenticated upload can be performed to using a single HTTP POST
	// (multipart/form-data) request.
	UploadURL string                        `json:"uploadURL"`
	JSON      v2DirectUploadNewResponseJSON `json:"-"`
}

func (*V2DirectUploadNewResponse) UnmarshalJSON

func (r *V2DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error)

type V2DirectUploadNewResponseEnvelope

type V2DirectUploadNewResponseEnvelope struct {
	Errors   []V2DirectUploadNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V2DirectUploadNewResponseEnvelopeMessages `json:"messages,required"`
	Result   V2DirectUploadNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success V2DirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    v2DirectUploadNewResponseEnvelopeJSON    `json:"-"`
}

func (*V2DirectUploadNewResponseEnvelope) UnmarshalJSON

func (r *V2DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V2DirectUploadNewResponseEnvelopeErrors

type V2DirectUploadNewResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    v2DirectUploadNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V2DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON

func (r *V2DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V2DirectUploadNewResponseEnvelopeMessages

type V2DirectUploadNewResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    v2DirectUploadNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V2DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON

func (r *V2DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V2DirectUploadNewResponseEnvelopeSuccess

type V2DirectUploadNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V2DirectUploadNewResponseEnvelopeSuccessTrue V2DirectUploadNewResponseEnvelopeSuccess = true
)

type V2DirectUploadService

type V2DirectUploadService struct {
	Options []option.RequestOption
}

V2DirectUploadService 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 NewV2DirectUploadService method instead.

func NewV2DirectUploadService

func NewV2DirectUploadService(opts ...option.RequestOption) (r *V2DirectUploadService)

NewV2DirectUploadService 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 (*V2DirectUploadService) New

Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.

type V2ListParams

type V2ListParams struct {
	// Account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Continuation token for a next page. List images V2 returns continuation_token
	ContinuationToken param.Field[string] `query:"continuation_token"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Sorting order by upload time.
	SortOrder param.Field[V2ListParamsSortOrder] `query:"sort_order"`
}

func (V2ListParams) URLQuery

func (r V2ListParams) URLQuery() (v url.Values)

URLQuery serializes V2ListParams's query parameters as `url.Values`.

type V2ListParamsSortOrder

type V2ListParamsSortOrder string

Sorting order by upload time.

const (
	V2ListParamsSortOrderAsc  V2ListParamsSortOrder = "asc"
	V2ListParamsSortOrderDesc V2ListParamsSortOrder = "desc"
)

type V2ListResponse

type V2ListResponse struct {
	// Continuation token to fetch next page. Passed as a query param when requesting
	// List V2 api endpoint.
	ContinuationToken string             `json:"continuation_token,nullable"`
	Images            []ImagesImage      `json:"images"`
	JSON              v2ListResponseJSON `json:"-"`
}

func (*V2ListResponse) UnmarshalJSON

func (r *V2ListResponse) UnmarshalJSON(data []byte) (err error)

type V2ListResponseEnvelope

type V2ListResponseEnvelope struct {
	Errors   []V2ListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []V2ListResponseEnvelopeMessages `json:"messages,required"`
	Result   V2ListResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success V2ListResponseEnvelopeSuccess `json:"success,required"`
	JSON    v2ListResponseEnvelopeJSON    `json:"-"`
}

func (*V2ListResponseEnvelope) UnmarshalJSON

func (r *V2ListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type V2ListResponseEnvelopeErrors

type V2ListResponseEnvelopeErrors struct {
	Code    int64                            `json:"code,required"`
	Message string                           `json:"message,required"`
	JSON    v2ListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*V2ListResponseEnvelopeErrors) UnmarshalJSON

func (r *V2ListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type V2ListResponseEnvelopeMessages

type V2ListResponseEnvelopeMessages struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    v2ListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*V2ListResponseEnvelopeMessages) UnmarshalJSON

func (r *V2ListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type V2ListResponseEnvelopeSuccess

type V2ListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	V2ListResponseEnvelopeSuccessTrue V2ListResponseEnvelopeSuccess = true
)

type V2Service

type V2Service struct {
	Options       []option.RequestOption
	DirectUploads *V2DirectUploadService
}

V2Service 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 NewV2Service method instead.

func NewV2Service

func NewV2Service(opts ...option.RequestOption) (r *V2Service)

NewV2Service 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 (*V2Service) List

func (r *V2Service) List(ctx context.Context, params V2ListParams, opts ...option.RequestOption) (res *V2ListResponse, err error)

List up to 10000 images with one request. Use the optional parameters below to get a specific range of images. Endpoint returns continuation_token if more images are present.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL