Documentation
¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConfigSrc
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type Error
- type ErrorData
- type ErrorDataSource
- type KVService
- type Key
- type Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type Namespace
- type NamespaceBulkDeleteParams
- type NamespaceBulkDeleteResponse
- type NamespaceBulkDeleteResponseEnvelope
- type NamespaceBulkDeleteResponseEnvelopeSuccess
- type NamespaceBulkGetParams
- type NamespaceBulkGetParamsType
- type NamespaceBulkGetResponse
- type NamespaceBulkGetResponseEnvelope
- type NamespaceBulkGetResponseEnvelopeSuccess
- type NamespaceBulkGetResponseUnion
- type NamespaceBulkGetResponseWorkersKVBulkGetResult
- type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap
- type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion
- type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata
- type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue
- type NamespaceBulkUpdateParams
- type NamespaceBulkUpdateParamsBody
- type NamespaceBulkUpdateResponse
- type NamespaceBulkUpdateResponseEnvelope
- type NamespaceBulkUpdateResponseEnvelopeSuccess
- type NamespaceDeleteParams
- type NamespaceDeleteResponse
- type NamespaceDeleteResponseEnvelope
- type NamespaceDeleteResponseEnvelopeSuccess
- type NamespaceGetParams
- type NamespaceGetResponseEnvelope
- type NamespaceGetResponseEnvelopeSuccess
- type NamespaceKeyBulkDeleteParams
- type NamespaceKeyBulkDeleteResponse
- type NamespaceKeyBulkDeleteResponseEnvelope
- type NamespaceKeyBulkDeleteResponseEnvelopeSuccess
- type NamespaceKeyBulkGetParams
- type NamespaceKeyBulkGetParamsType
- type NamespaceKeyBulkGetResponse
- type NamespaceKeyBulkGetResponseEnvelope
- type NamespaceKeyBulkGetResponseEnvelopeSuccess
- type NamespaceKeyBulkGetResponseUnion
- type NamespaceKeyBulkGetResponseWorkersKVBulkGetResult
- type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap
- type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion
- type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata
- type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue
- type NamespaceKeyBulkUpdateParams
- type NamespaceKeyBulkUpdateParamsBody
- type NamespaceKeyBulkUpdateResponse
- type NamespaceKeyBulkUpdateResponseEnvelope
- type NamespaceKeyBulkUpdateResponseEnvelopeSuccess
- type NamespaceKeyListParams
- type NamespaceKeyService
- func (r *NamespaceKeyService) BulkDelete(ctx context.Context, namespaceID string, params NamespaceKeyBulkDeleteParams, ...) (res *NamespaceKeyBulkDeleteResponse, err error)deprecated
- func (r *NamespaceKeyService) BulkGet(ctx context.Context, namespaceID string, params NamespaceKeyBulkGetParams, ...) (res *NamespaceKeyBulkGetResponse, err error)deprecated
- func (r *NamespaceKeyService) BulkUpdate(ctx context.Context, namespaceID string, params NamespaceKeyBulkUpdateParams, ...) (res *NamespaceKeyBulkUpdateResponse, err error)deprecated
- func (r *NamespaceKeyService) List(ctx context.Context, namespaceID string, params NamespaceKeyListParams, ...) (res *pagination.CursorLimitPagination[Key], err error)
- func (r *NamespaceKeyService) ListAutoPaging(ctx context.Context, namespaceID string, params NamespaceKeyListParams, ...) *pagination.CursorLimitPaginationAutoPager[Key]
- type NamespaceListParams
- type NamespaceListParamsDirection
- type NamespaceListParamsOrder
- type NamespaceMetadataGetParams
- type NamespaceMetadataGetResponse
- type NamespaceMetadataGetResponseEnvelope
- type NamespaceMetadataGetResponseEnvelopeSuccess
- type NamespaceMetadataService
- type NamespaceNewParams
- type NamespaceNewResponseEnvelope
- type NamespaceNewResponseEnvelopeSuccess
- type NamespaceService
- func (r *NamespaceService) BulkDelete(ctx context.Context, namespaceID string, params NamespaceBulkDeleteParams, ...) (res *NamespaceBulkDeleteResponse, err error)
- func (r *NamespaceService) BulkGet(ctx context.Context, namespaceID string, params NamespaceBulkGetParams, ...) (res *NamespaceBulkGetResponse, err error)
- func (r *NamespaceService) BulkUpdate(ctx context.Context, namespaceID string, params NamespaceBulkUpdateParams, ...) (res *NamespaceBulkUpdateResponse, err error)
- func (r *NamespaceService) Delete(ctx context.Context, namespaceID string, body NamespaceDeleteParams, ...) (res *NamespaceDeleteResponse, err error)
- func (r *NamespaceService) Get(ctx context.Context, namespaceID string, query NamespaceGetParams, ...) (res *Namespace, err error)
- func (r *NamespaceService) List(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[Namespace], err error)
- func (r *NamespaceService) ListAutoPaging(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[Namespace]
- func (r *NamespaceService) New(ctx context.Context, params NamespaceNewParams, opts ...option.RequestOption) (res *Namespace, err error)
- func (r *NamespaceService) Update(ctx context.Context, namespaceID string, params NamespaceUpdateParams, ...) (res *Namespace, err error)
- type NamespaceUpdateParams
- type NamespaceUpdateResponseEnvelope
- type NamespaceUpdateResponseEnvelopeSuccess
- type NamespaceValueDeleteParams
- type NamespaceValueDeleteResponse
- type NamespaceValueDeleteResponseEnvelope
- type NamespaceValueDeleteResponseEnvelopeSuccess
- type NamespaceValueGetParams
- type NamespaceValueService
- func (r *NamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, ...) (res *NamespaceValueDeleteResponse, err error)
- func (r *NamespaceValueService) Get(ctx context.Context, namespaceID string, keyName string, ...) (res *http.Response, err error)
- func (r *NamespaceValueService) Update(ctx context.Context, namespaceID string, keyName string, ...) (res *NamespaceValueUpdateResponse, err error)
- type NamespaceValueUpdateParams
- type NamespaceValueUpdateResponse
- type NamespaceValueUpdateResponseEnvelope
- type NamespaceValueUpdateResponseEnvelopeSuccess
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type RatePlan
- type RatePlanID
- type RatePlanParam
- type ResponseInfo
- type ResponseInfoSource
- type Role
- type RoleParam
- type RolePermissions
- type RolePermissionsParam
- type SortDirection
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type Token
- type TokenCondition
- type TokenConditionCIDRList
- type TokenConditionCIDRListParam
- type TokenConditionParam
- type TokenConditionRequestIP
- type TokenConditionRequestIPParam
- type TokenParam
- type TokenPolicy
- type TokenPolicyEffect
- type TokenPolicyParam
- type TokenPolicyPermissionGroup
- type TokenPolicyPermissionGroupParam
- type TokenPolicyPermissionGroupsMeta
- type TokenPolicyPermissionGroupsMetaParam
- type TokenPolicyResourcesIAMResourcesTypeObjectNested
- type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
- type TokenPolicyResourcesIAMResourcesTypeObjectString
- type TokenPolicyResourcesIAMResourcesTypeObjectStringParam
- type TokenPolicyResourcesUnion
- type TokenPolicyResourcesUnionParam
- type TokenStatus
- type TokenValue
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateCASSLCom = shared.CertificateCASSLCom
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelConfigSrcCloudflare = shared.CloudflareTunnelConfigSrcCloudflare
This is an alias to an internal value.
const CloudflareTunnelConfigSrcLocal = shared.CloudflareTunnelConfigSrcLocal
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow
This is an alias to an internal value.
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const RatePlanIDBusiness = shared.RatePlanIDBusiness
This is an alias to an internal value.
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise
This is an alias to an internal value.
const RatePlanIDFree = shared.RatePlanIDFree
This is an alias to an internal value.
const RatePlanIDLite = shared.RatePlanIDLite
This is an alias to an internal value.
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness
This is an alias to an internal value.
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise
This is an alias to an internal value.
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree
This is an alias to an internal value.
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro
This is an alias to an internal value.
const RatePlanIDPro = shared.RatePlanIDPro
This is an alias to an internal value.
const RatePlanIDProPlus = shared.RatePlanIDProPlus
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow
This is an alias to an internal value.
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny
This is an alias to an internal value.
const TokenStatusActive = shared.TokenStatusActive
This is an alias to an internal value.
const TokenStatusDisabled = shared.TokenStatusDisabled
This is an alias to an internal value.
const TokenStatusExpired = shared.TokenStatusExpired
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConfigSrc ¶ added in v5.1.0
type CloudflareTunnelConfigSrc = shared.CloudflareTunnelConfigSrc
Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type ErrorDataSource ¶
type ErrorDataSource = shared.ErrorDataSource
This is an alias to an internal type.
type KVService ¶
type KVService struct {
Options []option.RequestOption
Namespaces *NamespaceService
}
KVService 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 NewKVService method instead.
func NewKVService ¶
func NewKVService(opts ...option.RequestOption) (r *KVService)
NewKVService 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 Key ¶
type Key struct {
// A key's name. The name may be at most 512 bytes. All printable, non-whitespace
// characters are valid. Use percent-encoding to define key names as part of a URL.
Name string `json:"name,required"`
// The time, measured in number of seconds since the UNIX epoch, at which the key
// will expire. This property is omitted for keys that will not expire.
Expiration float64 `json:"expiration"`
// Arbitrary JSON that is associated with a key.
Metadata interface{} `json:"metadata"`
JSON keyJSON `json:"-"`
}
A name for a value. A value stored under a given key may be retrieved via the same key.
func (*Key) UnmarshalJSON ¶
type MemberPoliciesAccess ¶
type MemberPoliciesAccess = shared.MemberPoliciesAccess
Allow or deny operations against the resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroup ¶
type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroupsMeta ¶
type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type MemberPoliciesResourceGroup ¶
type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup
A group of scoped resources.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsMeta ¶
type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta
Attributes associated to the resource group.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScope ¶
type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope
A scope is a combination of scope objects which provides additional context.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScopeObject ¶
type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject
A scope object represents any resource that can have actions applied against invite.
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUser ¶
type MemberUser = shared.MemberUser
Details of the user associated to the membership.
This is an alias to an internal type.
type Namespace ¶
type Namespace struct {
// Namespace identifier tag.
ID string `json:"id,required"`
// A human-readable string name for a Namespace.
Title string `json:"title,required"`
// True if new beta namespace, with additional preview features.
Beta bool `json:"beta"`
// True if keys written on the URL will be URL-decoded before storing. For example,
// if set to "true", a key written on the URL as "%3F" will be stored as "?".
SupportsURLEncoding bool `json:"supports_url_encoding"`
JSON namespaceJSON `json:"-"`
}
func (*Namespace) UnmarshalJSON ¶
type NamespaceBulkDeleteParams ¶
type NamespaceBulkDeleteParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
Body []string `json:"body,required"`
}
func (NamespaceBulkDeleteParams) MarshalJSON ¶
func (r NamespaceBulkDeleteParams) MarshalJSON() (data []byte, err error)
type NamespaceBulkDeleteResponse ¶
type NamespaceBulkDeleteResponse struct {
// Number of keys successfully updated.
SuccessfulKeyCount float64 `json:"successful_key_count"`
// Name of the keys that failed to be fully updated. They should be retried.
UnsuccessfulKeys []string `json:"unsuccessful_keys"`
JSON namespaceBulkDeleteResponseJSON `json:"-"`
}
func (*NamespaceBulkDeleteResponse) UnmarshalJSON ¶
func (r *NamespaceBulkDeleteResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkDeleteResponseEnvelope ¶
type NamespaceBulkDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceBulkDeleteResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceBulkDeleteResponse `json:"result,nullable"`
JSON namespaceBulkDeleteResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceBulkDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceBulkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkDeleteResponseEnvelopeSuccess ¶
type NamespaceBulkDeleteResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceBulkDeleteResponseEnvelopeSuccessTrue NamespaceBulkDeleteResponseEnvelopeSuccess = true
)
func (NamespaceBulkDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceBulkDeleteResponseEnvelopeSuccess) IsKnown() bool
type NamespaceBulkGetParams ¶
type NamespaceBulkGetParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// Array of keys to retrieve (maximum of 100).
Keys param.Field[[]string] `json:"keys,required"`
// Whether to parse JSON values in the response.
Type param.Field[NamespaceBulkGetParamsType] `json:"type"`
// Whether to include metadata in the response.
WithMetadata param.Field[bool] `json:"withMetadata"`
}
func (NamespaceBulkGetParams) MarshalJSON ¶
func (r NamespaceBulkGetParams) MarshalJSON() (data []byte, err error)
type NamespaceBulkGetParamsType ¶
type NamespaceBulkGetParamsType string
Whether to parse JSON values in the response.
const ( NamespaceBulkGetParamsTypeText NamespaceBulkGetParamsType = "text" NamespaceBulkGetParamsTypeJson NamespaceBulkGetParamsType = "json" )
func (NamespaceBulkGetParamsType) IsKnown ¶
func (r NamespaceBulkGetParamsType) IsKnown() bool
type NamespaceBulkGetResponse ¶
type NamespaceBulkGetResponse struct {
// This field can have the runtime type of
// [map[string]NamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion],
// [map[string]NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue].
Values interface{} `json:"values"`
JSON namespaceBulkGetResponseJSON `json:"-"`
// contains filtered or unexported fields
}
func (NamespaceBulkGetResponse) AsUnion ¶
func (r NamespaceBulkGetResponse) AsUnion() NamespaceBulkGetResponseUnion
AsUnion returns a NamespaceBulkGetResponseUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are NamespaceBulkGetResponseWorkersKVBulkGetResult, NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata.
func (*NamespaceBulkGetResponse) UnmarshalJSON ¶
func (r *NamespaceBulkGetResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkGetResponseEnvelope ¶
type NamespaceBulkGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceBulkGetResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceBulkGetResponse `json:"result,nullable"`
JSON namespaceBulkGetResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceBulkGetResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceBulkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkGetResponseEnvelopeSuccess ¶
type NamespaceBulkGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceBulkGetResponseEnvelopeSuccessTrue NamespaceBulkGetResponseEnvelopeSuccess = true
)
func (NamespaceBulkGetResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceBulkGetResponseEnvelopeSuccess) IsKnown() bool
type NamespaceBulkGetResponseUnion ¶
type NamespaceBulkGetResponseUnion interface {
// contains filtered or unexported methods
}
Union satisfied by NamespaceBulkGetResponseWorkersKVBulkGetResult or NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata.
type NamespaceBulkGetResponseWorkersKVBulkGetResult ¶
type NamespaceBulkGetResponseWorkersKVBulkGetResult struct {
// Requested keys are paired with their values in an object.
Values map[string]NamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion `json:"values"`
JSON namespaceBulkGetResponseWorkersKVBulkGetResultJSON `json:"-"`
}
func (*NamespaceBulkGetResponseWorkersKVBulkGetResult) UnmarshalJSON ¶
func (r *NamespaceBulkGetResponseWorkersKVBulkGetResult) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap ¶
type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap map[string]interface{}
func (NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap) ImplementsNamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion ¶
func (r NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap) ImplementsNamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion()
type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion ¶
type NamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion interface {
ImplementsNamespaceBulkGetResponseWorkersKVBulkGetResultValuesUnion()
}
The value associated with the key.
Union satisfied by shared.UnionString, shared.UnionFloat, shared.UnionBool or NamespaceBulkGetResponseWorkersKVBulkGetResultValuesMap.
type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata ¶
type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata struct {
// Requested keys are paired with their values and metadata in an object.
Values map[string]NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue `json:"values"`
JSON namespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataJSON `json:"-"`
}
func (*NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata) UnmarshalJSON ¶
func (r *NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadata) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue ¶
type NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue struct {
// The metadata associated with the key.
Metadata interface{} `json:"metadata,required"`
// The value associated with the key.
Value interface{} `json:"value,required"`
// Expires the key at a certain time, measured in number of seconds since the UNIX
// epoch.
Expiration float64 `json:"expiration"`
JSON namespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValueJSON `json:"-"`
}
func (*NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue) UnmarshalJSON ¶
func (r *NamespaceBulkGetResponseWorkersKVBulkGetResultWithMetadataValue) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkUpdateParams ¶
type NamespaceBulkUpdateParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
Body []NamespaceBulkUpdateParamsBody `json:"body,required"`
}
func (NamespaceBulkUpdateParams) MarshalJSON ¶
func (r NamespaceBulkUpdateParams) MarshalJSON() (data []byte, err error)
type NamespaceBulkUpdateParamsBody ¶
type NamespaceBulkUpdateParamsBody struct {
// A key's name. The name may be at most 512 bytes. All printable, non-whitespace
// characters are valid.
Key param.Field[string] `json:"key,required"`
// A UTF-8 encoded string to be stored, up to 25 MiB in length.
Value param.Field[string] `json:"value,required"`
// Indicates whether or not the server should base64 decode the value before
// storing it. Useful for writing values that wouldn't otherwise be valid JSON
// strings, such as images.
Base64 param.Field[bool] `json:"base64"`
// Expires the key at a certain time, measured in number of seconds since the UNIX
// epoch.
Expiration param.Field[float64] `json:"expiration"`
// Expires the key after a number of seconds. Must be at least 60.
ExpirationTTL param.Field[float64] `json:"expiration_ttl"`
// Arbitrary JSON that is associated with a key.
Metadata param.Field[interface{}] `json:"metadata"`
}
func (NamespaceBulkUpdateParamsBody) MarshalJSON ¶
func (r NamespaceBulkUpdateParamsBody) MarshalJSON() (data []byte, err error)
type NamespaceBulkUpdateResponse ¶
type NamespaceBulkUpdateResponse struct {
// Number of keys successfully updated.
SuccessfulKeyCount float64 `json:"successful_key_count"`
// Name of the keys that failed to be fully updated. They should be retried.
UnsuccessfulKeys []string `json:"unsuccessful_keys"`
JSON namespaceBulkUpdateResponseJSON `json:"-"`
}
func (*NamespaceBulkUpdateResponse) UnmarshalJSON ¶
func (r *NamespaceBulkUpdateResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkUpdateResponseEnvelope ¶
type NamespaceBulkUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceBulkUpdateResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceBulkUpdateResponse `json:"result,nullable"`
JSON namespaceBulkUpdateResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceBulkUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceBulkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceBulkUpdateResponseEnvelopeSuccess ¶
type NamespaceBulkUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceBulkUpdateResponseEnvelopeSuccessTrue NamespaceBulkUpdateResponseEnvelopeSuccess = true
)
func (NamespaceBulkUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceBulkUpdateResponseEnvelopeSuccess) IsKnown() bool
type NamespaceDeleteParams ¶
type NamespaceDeleteResponse ¶
type NamespaceDeleteResponse struct {
JSON namespaceDeleteResponseJSON `json:"-"`
}
func (*NamespaceDeleteResponse) UnmarshalJSON ¶
func (r *NamespaceDeleteResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceDeleteResponseEnvelope ¶
type NamespaceDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceDeleteResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceDeleteResponse `json:"result,nullable"`
JSON namespaceDeleteResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceDeleteResponseEnvelopeSuccess ¶
type NamespaceDeleteResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceDeleteResponseEnvelopeSuccessTrue NamespaceDeleteResponseEnvelopeSuccess = true
)
func (NamespaceDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceDeleteResponseEnvelopeSuccess) IsKnown() bool
type NamespaceGetParams ¶
type NamespaceGetResponseEnvelope ¶
type NamespaceGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceGetResponseEnvelopeSuccess `json:"success,required"`
Result Namespace `json:"result"`
JSON namespaceGetResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceGetResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceGetResponseEnvelopeSuccess ¶
type NamespaceGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceGetResponseEnvelopeSuccessTrue NamespaceGetResponseEnvelopeSuccess = true
)
func (NamespaceGetResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceGetResponseEnvelopeSuccess) IsKnown() bool
type NamespaceKeyBulkDeleteParams ¶
type NamespaceKeyBulkDeleteParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
Body []string `json:"body,required"`
}
func (NamespaceKeyBulkDeleteParams) MarshalJSON ¶
func (r NamespaceKeyBulkDeleteParams) MarshalJSON() (data []byte, err error)
type NamespaceKeyBulkDeleteResponse ¶
type NamespaceKeyBulkDeleteResponse struct {
// Number of keys successfully updated.
SuccessfulKeyCount float64 `json:"successful_key_count"`
// Name of the keys that failed to be fully updated. They should be retried.
UnsuccessfulKeys []string `json:"unsuccessful_keys"`
JSON namespaceKeyBulkDeleteResponseJSON `json:"-"`
}
func (*NamespaceKeyBulkDeleteResponse) UnmarshalJSON ¶
func (r *NamespaceKeyBulkDeleteResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkDeleteResponseEnvelope ¶
type NamespaceKeyBulkDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceKeyBulkDeleteResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceKeyBulkDeleteResponse `json:"result,nullable"`
JSON namespaceKeyBulkDeleteResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceKeyBulkDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceKeyBulkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkDeleteResponseEnvelopeSuccess ¶
type NamespaceKeyBulkDeleteResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceKeyBulkDeleteResponseEnvelopeSuccessTrue NamespaceKeyBulkDeleteResponseEnvelopeSuccess = true
)
func (NamespaceKeyBulkDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceKeyBulkDeleteResponseEnvelopeSuccess) IsKnown() bool
type NamespaceKeyBulkGetParams ¶
type NamespaceKeyBulkGetParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// Array of keys to retrieve (maximum of 100).
Keys param.Field[[]string] `json:"keys,required"`
// Whether to parse JSON values in the response.
Type param.Field[NamespaceKeyBulkGetParamsType] `json:"type"`
// Whether to include metadata in the response.
WithMetadata param.Field[bool] `json:"withMetadata"`
}
func (NamespaceKeyBulkGetParams) MarshalJSON ¶
func (r NamespaceKeyBulkGetParams) MarshalJSON() (data []byte, err error)
type NamespaceKeyBulkGetParamsType ¶
type NamespaceKeyBulkGetParamsType string
Whether to parse JSON values in the response.
const ( NamespaceKeyBulkGetParamsTypeText NamespaceKeyBulkGetParamsType = "text" NamespaceKeyBulkGetParamsTypeJson NamespaceKeyBulkGetParamsType = "json" )
func (NamespaceKeyBulkGetParamsType) IsKnown ¶
func (r NamespaceKeyBulkGetParamsType) IsKnown() bool
type NamespaceKeyBulkGetResponse ¶
type NamespaceKeyBulkGetResponse struct {
// This field can have the runtime type of
// [map[string]NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion],
// [map[string]NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue].
Values interface{} `json:"values"`
JSON namespaceKeyBulkGetResponseJSON `json:"-"`
// contains filtered or unexported fields
}
func (NamespaceKeyBulkGetResponse) AsUnion ¶
func (r NamespaceKeyBulkGetResponse) AsUnion() NamespaceKeyBulkGetResponseUnion
AsUnion returns a NamespaceKeyBulkGetResponseUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are NamespaceKeyBulkGetResponseWorkersKVBulkGetResult, NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata.
func (*NamespaceKeyBulkGetResponse) UnmarshalJSON ¶
func (r *NamespaceKeyBulkGetResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkGetResponseEnvelope ¶
type NamespaceKeyBulkGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceKeyBulkGetResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceKeyBulkGetResponse `json:"result,nullable"`
JSON namespaceKeyBulkGetResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceKeyBulkGetResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceKeyBulkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkGetResponseEnvelopeSuccess ¶
type NamespaceKeyBulkGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceKeyBulkGetResponseEnvelopeSuccessTrue NamespaceKeyBulkGetResponseEnvelopeSuccess = true
)
func (NamespaceKeyBulkGetResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceKeyBulkGetResponseEnvelopeSuccess) IsKnown() bool
type NamespaceKeyBulkGetResponseUnion ¶
type NamespaceKeyBulkGetResponseUnion interface {
// contains filtered or unexported methods
}
Union satisfied by NamespaceKeyBulkGetResponseWorkersKVBulkGetResult or NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata.
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResult ¶
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResult struct {
// Requested keys are paired with their values in an object.
Values map[string]NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion `json:"values"`
JSON namespaceKeyBulkGetResponseWorkersKVBulkGetResultJSON `json:"-"`
}
func (*NamespaceKeyBulkGetResponseWorkersKVBulkGetResult) UnmarshalJSON ¶
func (r *NamespaceKeyBulkGetResponseWorkersKVBulkGetResult) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap ¶
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap map[string]interface{}
func (NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap) ImplementsNamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion ¶
func (r NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap) ImplementsNamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion()
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion ¶
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion interface {
ImplementsNamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesUnion()
}
The value associated with the key.
Union satisfied by shared.UnionString, shared.UnionFloat, shared.UnionBool or NamespaceKeyBulkGetResponseWorkersKVBulkGetResultValuesMap.
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata ¶
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata struct {
// Requested keys are paired with their values and metadata in an object.
Values map[string]NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue `json:"values"`
JSON namespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataJSON `json:"-"`
}
func (*NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata) UnmarshalJSON ¶
func (r *NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadata) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue ¶
type NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue struct {
// The metadata associated with the key.
Metadata interface{} `json:"metadata,required"`
// The value associated with the key.
Value interface{} `json:"value,required"`
// Expires the key at a certain time, measured in number of seconds since the UNIX
// epoch.
Expiration float64 `json:"expiration"`
JSON namespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValueJSON `json:"-"`
}
func (*NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue) UnmarshalJSON ¶
func (r *NamespaceKeyBulkGetResponseWorkersKVBulkGetResultWithMetadataValue) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkUpdateParams ¶
type NamespaceKeyBulkUpdateParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
Body []NamespaceKeyBulkUpdateParamsBody `json:"body,required"`
}
func (NamespaceKeyBulkUpdateParams) MarshalJSON ¶
func (r NamespaceKeyBulkUpdateParams) MarshalJSON() (data []byte, err error)
type NamespaceKeyBulkUpdateParamsBody ¶
type NamespaceKeyBulkUpdateParamsBody struct {
// A key's name. The name may be at most 512 bytes. All printable, non-whitespace
// characters are valid.
Key param.Field[string] `json:"key,required"`
// A UTF-8 encoded string to be stored, up to 25 MiB in length.
Value param.Field[string] `json:"value,required"`
// Indicates whether or not the server should base64 decode the value before
// storing it. Useful for writing values that wouldn't otherwise be valid JSON
// strings, such as images.
Base64 param.Field[bool] `json:"base64"`
// Expires the key at a certain time, measured in number of seconds since the UNIX
// epoch.
Expiration param.Field[float64] `json:"expiration"`
// Expires the key after a number of seconds. Must be at least 60.
ExpirationTTL param.Field[float64] `json:"expiration_ttl"`
// Arbitrary JSON that is associated with a key.
Metadata param.Field[interface{}] `json:"metadata"`
}
func (NamespaceKeyBulkUpdateParamsBody) MarshalJSON ¶
func (r NamespaceKeyBulkUpdateParamsBody) MarshalJSON() (data []byte, err error)
type NamespaceKeyBulkUpdateResponse ¶
type NamespaceKeyBulkUpdateResponse struct {
// Number of keys successfully updated.
SuccessfulKeyCount float64 `json:"successful_key_count"`
// Name of the keys that failed to be fully updated. They should be retried.
UnsuccessfulKeys []string `json:"unsuccessful_keys"`
JSON namespaceKeyBulkUpdateResponseJSON `json:"-"`
}
func (*NamespaceKeyBulkUpdateResponse) UnmarshalJSON ¶
func (r *NamespaceKeyBulkUpdateResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkUpdateResponseEnvelope ¶
type NamespaceKeyBulkUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceKeyBulkUpdateResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceKeyBulkUpdateResponse `json:"result,nullable"`
JSON namespaceKeyBulkUpdateResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceKeyBulkUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceKeyBulkUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceKeyBulkUpdateResponseEnvelopeSuccess ¶
type NamespaceKeyBulkUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceKeyBulkUpdateResponseEnvelopeSuccessTrue NamespaceKeyBulkUpdateResponseEnvelopeSuccess = true
)
func (NamespaceKeyBulkUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceKeyBulkUpdateResponseEnvelopeSuccess) IsKnown() bool
type NamespaceKeyListParams ¶
type NamespaceKeyListParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// Opaque token indicating the position from which to continue when requesting the
// next set of records if the amount of list results was limited by the limit
// parameter. A valid value for the cursor can be obtained from the `cursors`
// object in the `result_info` structure.
Cursor param.Field[string] `query:"cursor"`
// Limits the number of keys returned in the response. The cursor attribute may be
// used to iterate over the next batch of keys if there are more than the limit.
Limit param.Field[float64] `query:"limit"`
// Filters returned keys by a name prefix. Exact matches and any key names that
// begin with the prefix will be returned.
Prefix param.Field[string] `query:"prefix"`
}
func (NamespaceKeyListParams) URLQuery ¶
func (r NamespaceKeyListParams) URLQuery() (v url.Values)
URLQuery serializes NamespaceKeyListParams's query parameters as `url.Values`.
type NamespaceKeyService ¶
type NamespaceKeyService struct {
Options []option.RequestOption
}
NamespaceKeyService 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 NewNamespaceKeyService method instead.
func NewNamespaceKeyService ¶
func NewNamespaceKeyService(opts ...option.RequestOption) (r *NamespaceKeyService)
NewNamespaceKeyService 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 (*NamespaceKeyService) BulkDelete
deprecated
func (r *NamespaceKeyService) BulkDelete(ctx context.Context, namespaceID string, params NamespaceKeyBulkDeleteParams, opts ...option.RequestOption) (res *NamespaceKeyBulkDeleteResponse, err error)
Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.
Deprecated: Please use kv.namespaces.bulk_delete instead
func (*NamespaceKeyService) BulkGet
deprecated
func (r *NamespaceKeyService) BulkGet(ctx context.Context, namespaceID string, params NamespaceKeyBulkGetParams, opts ...option.RequestOption) (res *NamespaceKeyBulkGetResponse, err error)
Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.
Deprecated: Please use kv.namespaces.bulk_get instead
func (*NamespaceKeyService) BulkUpdate
deprecated
func (r *NamespaceKeyService) BulkUpdate(ctx context.Context, namespaceID string, params NamespaceKeyBulkUpdateParams, opts ...option.RequestOption) (res *NamespaceKeyBulkUpdateResponse, err error)
Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.
Deprecated: Please use kv.namespaces.bulk_update instead
func (*NamespaceKeyService) List ¶
func (r *NamespaceKeyService) List(ctx context.Context, namespaceID string, params NamespaceKeyListParams, opts ...option.RequestOption) (res *pagination.CursorLimitPagination[Key], err error)
Lists a namespace's keys.
func (*NamespaceKeyService) ListAutoPaging ¶
func (r *NamespaceKeyService) ListAutoPaging(ctx context.Context, namespaceID string, params NamespaceKeyListParams, opts ...option.RequestOption) *pagination.CursorLimitPaginationAutoPager[Key]
Lists a namespace's keys.
type NamespaceListParams ¶
type NamespaceListParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// Direction to order namespaces.
Direction param.Field[NamespaceListParamsDirection] `query:"direction"`
// Field to order results by.
Order param.Field[NamespaceListParamsOrder] `query:"order"`
// Page number of paginated results.
Page param.Field[float64] `query:"page"`
// Maximum number of results per page.
PerPage param.Field[float64] `query:"per_page"`
}
func (NamespaceListParams) URLQuery ¶
func (r NamespaceListParams) URLQuery() (v url.Values)
URLQuery serializes NamespaceListParams's query parameters as `url.Values`.
type NamespaceListParamsDirection ¶
type NamespaceListParamsDirection string
Direction to order namespaces.
const ( NamespaceListParamsDirectionAsc NamespaceListParamsDirection = "asc" NamespaceListParamsDirectionDesc NamespaceListParamsDirection = "desc" )
func (NamespaceListParamsDirection) IsKnown ¶
func (r NamespaceListParamsDirection) IsKnown() bool
type NamespaceListParamsOrder ¶
type NamespaceListParamsOrder string
Field to order results by.
const ( NamespaceListParamsOrderID NamespaceListParamsOrder = "id" NamespaceListParamsOrderTitle NamespaceListParamsOrder = "title" )
func (NamespaceListParamsOrder) IsKnown ¶
func (r NamespaceListParamsOrder) IsKnown() bool
type NamespaceMetadataGetResponse ¶
type NamespaceMetadataGetResponse = interface{}
type NamespaceMetadataGetResponseEnvelope ¶
type NamespaceMetadataGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceMetadataGetResponseEnvelopeSuccess `json:"success,required"`
// Arbitrary JSON that is associated with a key.
Result NamespaceMetadataGetResponse `json:"result"`
JSON namespaceMetadataGetResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceMetadataGetResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceMetadataGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceMetadataGetResponseEnvelopeSuccess ¶
type NamespaceMetadataGetResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceMetadataGetResponseEnvelopeSuccessTrue NamespaceMetadataGetResponseEnvelopeSuccess = true
)
func (NamespaceMetadataGetResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceMetadataGetResponseEnvelopeSuccess) IsKnown() bool
type NamespaceMetadataService ¶
type NamespaceMetadataService struct {
Options []option.RequestOption
}
NamespaceMetadataService 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 NewNamespaceMetadataService method instead.
func NewNamespaceMetadataService ¶
func NewNamespaceMetadataService(opts ...option.RequestOption) (r *NamespaceMetadataService)
NewNamespaceMetadataService 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 (*NamespaceMetadataService) Get ¶
func (r *NamespaceMetadataService) Get(ctx context.Context, namespaceID string, keyName string, query NamespaceMetadataGetParams, opts ...option.RequestOption) (res *NamespaceMetadataGetResponse, err error)
Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.
type NamespaceNewParams ¶
type NamespaceNewParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// A human-readable string name for a Namespace.
Title param.Field[string] `json:"title,required"`
}
func (NamespaceNewParams) MarshalJSON ¶
func (r NamespaceNewParams) MarshalJSON() (data []byte, err error)
type NamespaceNewResponseEnvelope ¶
type NamespaceNewResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceNewResponseEnvelopeSuccess `json:"success,required"`
Result Namespace `json:"result"`
JSON namespaceNewResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceNewResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceNewResponseEnvelopeSuccess ¶
type NamespaceNewResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceNewResponseEnvelopeSuccessTrue NamespaceNewResponseEnvelopeSuccess = true
)
func (NamespaceNewResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceNewResponseEnvelopeSuccess) IsKnown() bool
type NamespaceService ¶
type NamespaceService struct {
Options []option.RequestOption
Keys *NamespaceKeyService
Metadata *NamespaceMetadataService
Values *NamespaceValueService
}
NamespaceService 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 NewNamespaceService method instead.
func NewNamespaceService ¶
func NewNamespaceService(opts ...option.RequestOption) (r *NamespaceService)
NewNamespaceService 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 (*NamespaceService) BulkDelete ¶
func (r *NamespaceService) BulkDelete(ctx context.Context, namespaceID string, params NamespaceBulkDeleteParams, opts ...option.RequestOption) (res *NamespaceBulkDeleteResponse, err error)
Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.
func (*NamespaceService) BulkGet ¶
func (r *NamespaceService) BulkGet(ctx context.Context, namespaceID string, params NamespaceBulkGetParams, opts ...option.RequestOption) (res *NamespaceBulkGetResponse, err error)
Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.
func (*NamespaceService) BulkUpdate ¶
func (r *NamespaceService) BulkUpdate(ctx context.Context, namespaceID string, params NamespaceBulkUpdateParams, opts ...option.RequestOption) (res *NamespaceBulkUpdateResponse, err error)
Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.
func (*NamespaceService) Delete ¶
func (r *NamespaceService) Delete(ctx context.Context, namespaceID string, body NamespaceDeleteParams, opts ...option.RequestOption) (res *NamespaceDeleteResponse, err error)
Deletes the namespace corresponding to the given ID.
func (*NamespaceService) Get ¶
func (r *NamespaceService) Get(ctx context.Context, namespaceID string, query NamespaceGetParams, opts ...option.RequestOption) (res *Namespace, err error)
Get the namespace corresponding to the given ID.
func (*NamespaceService) List ¶
func (r *NamespaceService) List(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[Namespace], err error)
Returns the namespaces owned by an account.
func (*NamespaceService) ListAutoPaging ¶
func (r *NamespaceService) ListAutoPaging(ctx context.Context, params NamespaceListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[Namespace]
Returns the namespaces owned by an account.
func (*NamespaceService) New ¶
func (r *NamespaceService) New(ctx context.Context, params NamespaceNewParams, opts ...option.RequestOption) (res *Namespace, err error)
Creates a namespace under the given title. A `400` is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.
func (*NamespaceService) Update ¶
func (r *NamespaceService) Update(ctx context.Context, namespaceID string, params NamespaceUpdateParams, opts ...option.RequestOption) (res *Namespace, err error)
Modifies a namespace's title.
type NamespaceUpdateParams ¶
type NamespaceUpdateParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// A human-readable string name for a Namespace.
Title param.Field[string] `json:"title,required"`
}
func (NamespaceUpdateParams) MarshalJSON ¶
func (r NamespaceUpdateParams) MarshalJSON() (data []byte, err error)
type NamespaceUpdateResponseEnvelope ¶
type NamespaceUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result Namespace `json:"result,required"`
// Whether the API call was successful.
Success NamespaceUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON namespaceUpdateResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceUpdateResponseEnvelopeSuccess ¶
type NamespaceUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceUpdateResponseEnvelopeSuccessTrue NamespaceUpdateResponseEnvelopeSuccess = true
)
func (NamespaceUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceUpdateResponseEnvelopeSuccess) IsKnown() bool
type NamespaceValueDeleteResponse ¶
type NamespaceValueDeleteResponse struct {
JSON namespaceValueDeleteResponseJSON `json:"-"`
}
func (*NamespaceValueDeleteResponse) UnmarshalJSON ¶
func (r *NamespaceValueDeleteResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceValueDeleteResponseEnvelope ¶
type NamespaceValueDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceValueDeleteResponse `json:"result,nullable"`
JSON namespaceValueDeleteResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceValueDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceValueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceValueDeleteResponseEnvelopeSuccess ¶
type NamespaceValueDeleteResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceValueDeleteResponseEnvelopeSuccessTrue NamespaceValueDeleteResponseEnvelopeSuccess = true
)
func (NamespaceValueDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceValueDeleteResponseEnvelopeSuccess) IsKnown() bool
type NamespaceValueGetParams ¶
type NamespaceValueService ¶
type NamespaceValueService struct {
Options []option.RequestOption
}
NamespaceValueService 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 NewNamespaceValueService method instead.
func NewNamespaceValueService ¶
func NewNamespaceValueService(opts ...option.RequestOption) (r *NamespaceValueService)
NewNamespaceValueService 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 (*NamespaceValueService) Delete ¶
func (r *NamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, body NamespaceValueDeleteParams, opts ...option.RequestOption) (res *NamespaceValueDeleteResponse, err error)
Remove a KV pair from the namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.
func (*NamespaceValueService) Get ¶
func (r *NamespaceValueService) Get(ctx context.Context, namespaceID string, keyName string, query NamespaceValueGetParams, opts ...option.RequestOption) (res *http.Response, err error)
Returns the value associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. If the KV-pair is set to expire at some point, the expiration time as measured in seconds since the UNIX epoch will be returned in the `expiration` response header.
func (*NamespaceValueService) Update ¶
func (r *NamespaceValueService) Update(ctx context.Context, namespaceID string, keyName string, params NamespaceValueUpdateParams, opts ...option.RequestOption) (res *NamespaceValueUpdateResponse, err error)
Write a value identified by a key. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. Body should be the value to be stored. If JSON metadata to be associated with the key/value pair is needed, use `multipart/form-data` content type for your PUT request (see dropdown below in `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.
type NamespaceValueUpdateParams ¶
type NamespaceValueUpdateParams struct {
// Identifier.
AccountID param.Field[string] `path:"account_id,required"`
// A byte sequence to be stored, up to 25 MiB in length.
Value param.Field[string] `json:"value,required"`
// Expires the key at a certain time, measured in number of seconds since the UNIX
// epoch.
Expiration param.Field[float64] `query:"expiration"`
// Expires the key after a number of seconds. Must be at least 60.
ExpirationTTL param.Field[float64] `query:"expiration_ttl"`
// Associates arbitrary JSON data with a key/value pair.
Metadata param.Field[interface{}] `json:"metadata"`
}
func (NamespaceValueUpdateParams) MarshalMultipart ¶
func (r NamespaceValueUpdateParams) MarshalMultipart() (data []byte, contentType string, err error)
func (NamespaceValueUpdateParams) URLQuery ¶
func (r NamespaceValueUpdateParams) URLQuery() (v url.Values)
URLQuery serializes NamespaceValueUpdateParams's query parameters as `url.Values`.
type NamespaceValueUpdateResponse ¶
type NamespaceValueUpdateResponse struct {
JSON namespaceValueUpdateResponseJSON `json:"-"`
}
func (*NamespaceValueUpdateResponse) UnmarshalJSON ¶
func (r *NamespaceValueUpdateResponse) UnmarshalJSON(data []byte) (err error)
type NamespaceValueUpdateResponseEnvelope ¶
type NamespaceValueUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful.
Success NamespaceValueUpdateResponseEnvelopeSuccess `json:"success,required"`
Result NamespaceValueUpdateResponse `json:"result,nullable"`
JSON namespaceValueUpdateResponseEnvelopeJSON `json:"-"`
}
func (*NamespaceValueUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *NamespaceValueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type NamespaceValueUpdateResponseEnvelopeSuccess ¶
type NamespaceValueUpdateResponseEnvelopeSuccess bool
Whether the API call was successful.
const (
NamespaceValueUpdateResponseEnvelopeSuccessTrue NamespaceValueUpdateResponseEnvelopeSuccess = true
)
func (NamespaceValueUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r NamespaceValueUpdateResponseEnvelopeSuccess) IsKnown() bool
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type RatePlanID ¶
type RatePlanID = shared.RatePlanID
The ID of the rate plan.
This is an alias to an internal type.
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type ResponseInfoSource ¶
type ResponseInfoSource = shared.ResponseInfoSource
This is an alias to an internal type.
type RolePermissions ¶
type RolePermissions = shared.RolePermissions
This is an alias to an internal type.
type RolePermissionsParam ¶
type RolePermissionsParam = shared.RolePermissionsParam
This is an alias to an internal type.
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type TokenCondition ¶
type TokenCondition = shared.TokenCondition
This is an alias to an internal type.
type TokenConditionCIDRList ¶
type TokenConditionCIDRList = shared.TokenConditionCIDRList
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionCIDRListParam ¶
type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionParam ¶
type TokenConditionParam = shared.TokenConditionParam
This is an alias to an internal type.
type TokenConditionRequestIP ¶
type TokenConditionRequestIP = shared.TokenConditionRequestIP
Client IP restrictions.
This is an alias to an internal type.
type TokenConditionRequestIPParam ¶
type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam
Client IP restrictions.
This is an alias to an internal type.
type TokenPolicyEffect ¶
type TokenPolicyEffect = shared.TokenPolicyEffect
Allow or deny operations against the resources.
This is an alias to an internal type.
type TokenPolicyParam ¶
type TokenPolicyParam = shared.TokenPolicyParam
This is an alias to an internal type.
type TokenPolicyPermissionGroup ¶
type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupParam ¶
type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMeta ¶
type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMetaParam ¶
type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNested ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNested = shared.TokenPolicyResourcesIAMResourcesTypeObjectNested
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectString ¶
type TokenPolicyResourcesIAMResourcesTypeObjectString = shared.TokenPolicyResourcesIAMResourcesTypeObjectString
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectStringParam
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesUnion ¶
type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenPolicyResourcesUnionParam ¶
type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenStatus ¶
type TokenStatus = shared.TokenStatus
Status of the token.
This is an alias to an internal type.
type TokenValue ¶
type TokenValue = shared.TokenValue
The token value.
This is an alias to an internal type.