Documentation
¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type BillingService
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConfigSrc
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type Error
- type ErrorData
- type ErrorDataSource
- type Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type ProfileGetParams
- type ProfileGetResponse
- type ProfileGetResponseEnvelope
- type ProfileGetResponseEnvelopeSuccess
- type ProfileService
- 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
- type UsageGetAccountUsageInfoV1Params
- type UsageGetAccountUsageInfoV1Response
- type UsageGetAccountUsageInfoV1ResponseEnvelope
- type UsageGetAccountUsageInfoV1ResponseEnvelopeErrors
- type UsageGetAccountUsageInfoV1ResponseEnvelopeMessages
- type UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess
- type UsageGetAccountUsageInfoV1ResponseSubscription
- type UsageGetAccountUsageV1Params
- type UsageGetAccountUsageV1Response
- type UsageGetAccountUsageV1ResponseChargeCategory
- type UsageGetAccountUsageV1ResponseEnvelope
- type UsageGetAccountUsageV1ResponseEnvelopeErrors
- type UsageGetAccountUsageV1ResponseEnvelopeMessages
- type UsageGetAccountUsageV1ResponseEnvelopeSuccess
- type UsageGetAccountUsageV2Params
- type UsageGetAccountUsageV2Response
- type UsageGetAccountUsageV2ResponseChargeCategory
- type UsageGetAccountUsageV2ResponseChargeClass
- type UsageGetAccountUsageV2ResponseChargeFrequency
- type UsageGetAccountUsageV2ResponseEnvelope
- type UsageGetAccountUsageV2ResponseEnvelopeErrors
- type UsageGetAccountUsageV2ResponseEnvelopeMessages
- type UsageGetAccountUsageV2ResponseEnvelopeSuccess
- type UsageGetParams
- type UsageGetResponse
- type UsageGetResponseChargeCategory
- type UsageGetResponseChargeClass
- type UsageGetResponseChargeFrequency
- type UsageGetResponseEnvelope
- type UsageGetResponseEnvelopeErrors
- type UsageGetResponseEnvelopeMessages
- type UsageGetResponseEnvelopeSuccess
- type UsagePaygoInfoParams
- type UsagePaygoInfoResponse
- type UsagePaygoInfoResponseEnvelope
- type UsagePaygoInfoResponseEnvelopeErrors
- type UsagePaygoInfoResponseEnvelopeMessages
- type UsagePaygoInfoResponseEnvelopeSuccess
- type UsagePaygoInfoResponseSubscription
- type UsagePaygoParams
- type UsagePaygoResponse
- type UsagePaygoResponseChargeCategory
- type UsagePaygoResponseEnvelope
- type UsagePaygoResponseEnvelopeErrors
- type UsagePaygoResponseEnvelopeMessages
- type UsagePaygoResponseEnvelopeSuccess
- type UsageService
- func (r *UsageService) Get(ctx context.Context, params UsageGetParams, opts ...option.RequestOption) (res *[]UsageGetResponse, err error)deprecated
- func (r *UsageService) GetAccountUsageInfoV1(ctx context.Context, query UsageGetAccountUsageInfoV1Params, ...) (res *UsageGetAccountUsageInfoV1Response, err error)
- func (r *UsageService) GetAccountUsageV1(ctx context.Context, params UsageGetAccountUsageV1Params, ...) (res *[]UsageGetAccountUsageV1Response, err error)
- func (r *UsageService) GetAccountUsageV2(ctx context.Context, params UsageGetAccountUsageV2Params, ...) (res *[]UsageGetAccountUsageV2Response, err error)
- func (r *UsageService) Paygo(ctx context.Context, params UsagePaygoParams, opts ...option.RequestOption) (res *[]UsagePaygoResponse, err error)deprecated
- func (r *UsageService) PaygoInfo(ctx context.Context, query UsagePaygoInfoParams, opts ...option.RequestOption) (res *UsagePaygoInfoResponse, err error)deprecated
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 BillingService ¶
type BillingService struct {
Options []option.RequestOption
Profiles *ProfileService
Usage *UsageService
}
BillingService 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 NewBillingService method instead.
func NewBillingService ¶
func NewBillingService(opts ...option.RequestOption) (r *BillingService)
NewBillingService 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 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 ¶
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 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 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 ProfileGetParams ¶
type ProfileGetResponse ¶
type ProfileGetResponse struct {
// Billing item identifier tag.
ID string `json:"id"`
AccountType string `json:"account_type"`
Address string `json:"address"`
Address2 string `json:"address2"`
Balance string `json:"balance"`
CardExpiryMonth int64 `json:"card_expiry_month"`
CardExpiryYear int64 `json:"card_expiry_year"`
CardNumber string `json:"card_number"`
City string `json:"city"`
Company string `json:"company"`
Country string `json:"country"`
CreatedOn time.Time `json:"created_on" format:"date-time"`
DeviceData string `json:"device_data"`
EditedOn time.Time `json:"edited_on" format:"date-time"`
EnterpriseBillingEmail string `json:"enterprise_billing_email"`
EnterprisePrimaryEmail string `json:"enterprise_primary_email"`
FirstName string `json:"first_name"`
IsPartner bool `json:"is_partner"`
LastName string `json:"last_name"`
NextBillDate time.Time `json:"next_bill_date" format:"date-time"`
PaymentAddress string `json:"payment_address"`
PaymentAddress2 string `json:"payment_address2"`
PaymentCity string `json:"payment_city"`
PaymentCountry string `json:"payment_country"`
PaymentEmail string `json:"payment_email"`
PaymentFirstName string `json:"payment_first_name"`
PaymentGateway string `json:"payment_gateway"`
PaymentLastName string `json:"payment_last_name"`
PaymentNonce string `json:"payment_nonce"`
PaymentState string `json:"payment_state"`
PaymentZipcode string `json:"payment_zipcode"`
PrimaryEmail string `json:"primary_email"`
State string `json:"state"`
TaxIDType string `json:"tax_id_type"`
Telephone string `json:"telephone"`
UseLegacy bool `json:"use_legacy"`
ValidationCode string `json:"validation_code"`
Vat string `json:"vat"`
Zipcode string `json:"zipcode"`
JSON profileGetResponseJSON `json:"-"`
}
func (*ProfileGetResponse) UnmarshalJSON ¶
func (r *ProfileGetResponse) UnmarshalJSON(data []byte) (err error)
type ProfileGetResponseEnvelope ¶
type ProfileGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors" api:"required"`
Messages []shared.ResponseInfo `json:"messages" api:"required"`
Result ProfileGetResponse `json:"result" api:"required"`
// Whether the API call was successful
Success ProfileGetResponseEnvelopeSuccess `json:"success" api:"required"`
JSON profileGetResponseEnvelopeJSON `json:"-"`
}
func (*ProfileGetResponseEnvelope) UnmarshalJSON ¶
func (r *ProfileGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ProfileGetResponseEnvelopeSuccess ¶
type ProfileGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ProfileGetResponseEnvelopeSuccessTrue ProfileGetResponseEnvelopeSuccess = true
)
func (ProfileGetResponseEnvelopeSuccess) IsKnown ¶
func (r ProfileGetResponseEnvelopeSuccess) IsKnown() bool
type ProfileService ¶
type ProfileService struct {
Options []option.RequestOption
}
ProfileService 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 NewProfileService method instead.
func NewProfileService ¶
func NewProfileService(opts ...option.RequestOption) (r *ProfileService)
NewProfileService 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 (*ProfileService) Get
deprecated
func (r *ProfileService) Get(ctx context.Context, query ProfileGetParams, opts ...option.RequestOption) (res *ProfileGetResponse, err error)
Gets the current billing profile for the account.
Deprecated: deprecated
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.
type UsageGetAccountUsageInfoV1Params ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1Response ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1Response struct {
// Indicates whether the account is covered.
Covered bool `json:"covered" api:"required"`
// List of subscriptions for the account.
Subscriptions []UsageGetAccountUsageInfoV1ResponseSubscription `json:"subscriptions" api:"required"`
JSON usageGetAccountUsageInfoV1ResponseJSON `json:"-"`
}
Contains the usage info.
func (*UsageGetAccountUsageInfoV1Response) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageInfoV1Response) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageInfoV1ResponseEnvelope ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1ResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsageGetAccountUsageInfoV1ResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains any informational messages from the API.
Messages []UsageGetAccountUsageInfoV1ResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the usage info.
Result UsageGetAccountUsageInfoV1Response `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usageGetAccountUsageInfoV1ResponseEnvelopeJSON `json:"-"`
}
Represents a successful response containing subscription info.
func (*UsageGetAccountUsageInfoV1ResponseEnvelope) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageInfoV1ResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageInfoV1ResponseEnvelopeErrors ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1ResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageInfoV1ResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageInfoV1ResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageInfoV1ResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageInfoV1ResponseEnvelopeMessages ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1ResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageInfoV1ResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageInfoV1ResponseEnvelopeMessages) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageInfoV1ResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsageGetAccountUsageInfoV1ResponseEnvelopeSuccessTrue UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess = true
)
func (UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageInfoV1ResponseEnvelopeSuccess) IsKnown() bool
type UsageGetAccountUsageInfoV1ResponseSubscription ¶ added in v7.9.0
type UsageGetAccountUsageInfoV1ResponseSubscription struct {
// The identifier for the Cloudflare subscription.
ID string `json:"id" api:"required"`
// The subscription billing cycle anchor timestamp.
BillingCycleAnchorTimestamp time.Time `json:"billing_cycle_anchor_timestamp" api:"required" format:"date-time"`
// The subscription start timestamp.
StartTimestamp time.Time `json:"start_timestamp" api:"required" format:"date-time"`
// The subscription end timestamp. Omitted for active subscriptions; present only
// when the subscription has been cancelled.
EndTimestamp time.Time `json:"end_timestamp" format:"date-time"`
JSON usageGetAccountUsageInfoV1ResponseSubscriptionJSON `json:"-"`
}
func (*UsageGetAccountUsageInfoV1ResponseSubscription) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageInfoV1ResponseSubscription) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV1Params ¶ added in v7.9.0
type UsageGetAccountUsageV1Params struct {
// Represents a Cloudflare resource identifier tag.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Start date for the usage query (ISO 8601). The provided time range must include
// the subscription billing cycle anchor day, otherwise no usage data is returned.
// Use the info endpoint to retrieve the subscription anchor day.
From param.Field[time.Time] `query:"from" format:"date"`
// End date for the usage query (ISO 8601).
To param.Field[time.Time] `query:"to" format:"date"`
}
func (UsageGetAccountUsageV1Params) URLQuery ¶ added in v7.9.0
func (r UsageGetAccountUsageV1Params) URLQuery() (v url.Values)
URLQuery serializes UsageGetAccountUsageV1Params's query parameters as `url.Values`.
type UsageGetAccountUsageV1Response ¶ added in v7.9.0
type UsageGetAccountUsageV1Response struct {
// The amount invoiced for this charge. PayGo is billed directly by Cloudflare, so
// this equals ContractedCost.
BilledCost float64 `json:"BilledCost" api:"required"`
// The identifier of the account the charge is billed to (account tag).
BillingAccountID string `json:"BillingAccountId" api:"required"`
// The display name of the billing account. Null when the name could not be
// resolved.
BillingAccountName string `json:"BillingAccountName" api:"required,nullable"`
// Specifies the billing currency code (ISO 4217).
BillingCurrency string `json:"BillingCurrency" api:"required"`
// Indicates the start of the billing period. There is no `BillingPeriodEnd`
// counterpart; see the known gaps described on this schema.
BillingPeriodStart time.Time `json:"BillingPeriodStart" api:"required" format:"date-time"`
// Describes the nature of the charge. Always "Usage" for this endpoint, which only
// returns metered usage.
ChargeCategory UsageGetAccountUsageV1ResponseChargeCategory `json:"ChargeCategory" api:"required"`
// Indicates whether the row corrects a previously invoiced billing period. Always
// null for this endpoint, which does not return corrections.
ChargeClass string `json:"ChargeClass" api:"required,nullable"`
// A human-readable summary of the charge.
ChargeDescription string `json:"ChargeDescription" api:"required,nullable"`
// Indicates the end of the charge period.
ChargePeriodEnd time.Time `json:"ChargePeriodEnd" api:"required" format:"date-time"`
// Indicates the start of the charge period.
ChargePeriodStart time.Time `json:"ChargePeriodStart" api:"required" format:"date-time"`
// Specifies the quantity consumed during this charge period.
ConsumedQuantity float64 `json:"ConsumedQuantity" api:"required"`
// A display name for the unit of measurement used for the product (for example,
// "GB-months", "GB-seconds"). May be empty when the unit is implicit in the
// service name.
ConsumedUnit string `json:"ConsumedUnit" api:"required"`
// Specifies the cost for this charge period in the billing currency.
ContractedCost float64 `json:"ContractedCost" api:"required"`
// Specifies the cumulated cost for the billing period in the billing currency.
CumulatedContractedCost float64 `json:"CumulatedContractedCost" api:"required"`
// Specifies the cumulated pricing quantity for the billing period.
CumulatedPricingQuantity int64 `json:"CumulatedPricingQuantity" api:"required"`
// The amortized cost of the charge. PayGo has no upfront commitments, so this
// equals ContractedCost.
EffectiveCost float64 `json:"EffectiveCost" api:"required"`
// The provider that hosts the infrastructure or platform the service runs on.
HostProviderName string `json:"HostProviderName" api:"required"`
// The entity that issues the invoice for this charge.
InvoiceIssuerName string `json:"InvoiceIssuerName" api:"required"`
// The cost at published list prices, before any discount. PayGo has no commitment
// discounts, so this equals ContractedCost.
ListCost float64 `json:"ListCost" api:"required"`
// Specifies the pricing quantity for this charge period.
PricingQuantity int64 `json:"PricingQuantity" api:"required"`
// The unit that PricingQuantity is expressed in. Unlike ConsumedUnit this is never
// empty; it falls back to "Count" when the service has no explicit unit.
PricingUnit string `json:"PricingUnit" api:"required"`
// Identifies the Cloudflare service.
ServiceName string `json:"ServiceName" api:"required"`
// The provider of the purchased service.
ServiceProviderName string `json:"ServiceProviderName" api:"required"`
// Identifies the product family for the Cloudflare service.
ServiceFamilyName string `json:"ServiceFamilyName"`
// The identifier for the Cloudflare subscription.
SubscriptionID string `json:"SubscriptionId" api:"nullable"`
// The identifier for the Cloudflare zone (zone tag).
ZoneID string `json:"ZoneId" api:"nullable"`
// The display name of the Cloudflare zone.
ZoneName string `json:"ZoneName" api:"nullable"`
JSON usageGetAccountUsageV1ResponseJSON `json:"-"`
}
Represents a single billable usage record.
This schema carries 19 of the 21 columns FOCUS 1.3 marks as mandatory. Mandatory columns are always present, using an explicit null when the value is unknown, so consumers can distinguish "unknown" from "not provided".
Known gap 1: `ServiceCategory` (FOCUS 1.3 section 3.1.55) is not yet implemented and does not appear in this schema. Cloudflare's product catalog does not yet have a stakeholder-approved mapping from product family to a FOCUS ServiceCategory value, so the column is omitted entirely rather than shipping unapproved values. It will be added once that mapping exists.
Known gap 2: `BillingPeriodEnd` (FOCUS 1.3 section 3.1.4) is not yet implemented and does not appear in this schema, because no authoritative source for it exists today. Deriving it by calendar arithmetic drifts for billing cycle anchors on day 29-31, and the billing provider's current period end describes only the current period, so it is wrong for backdated records. `BillingPeriodStart` is correctly sourced and is still reported, so records carry a billing period start with no corresponding end until an authoritative end date is available.
Per FOCUS 1.3 section 4.1.4.1, the columns that are not part of FOCUS (`ServiceFamilyName`, `CumulatedPricingQuantity`, `CumulatedContractedCost`, `ZoneId`, `ZoneName` and `SubscriptionId`) would normally carry an `x_` prefix. They are kept unprefixed here to avoid a breaking change for existing consumers.
func (*UsageGetAccountUsageV1Response) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV1Response) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV1ResponseChargeCategory ¶ added in v7.9.0
type UsageGetAccountUsageV1ResponseChargeCategory string
Describes the nature of the charge. Always "Usage" for this endpoint, which only returns metered usage.
const (
UsageGetAccountUsageV1ResponseChargeCategoryUsage UsageGetAccountUsageV1ResponseChargeCategory = "Usage"
)
func (UsageGetAccountUsageV1ResponseChargeCategory) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV1ResponseChargeCategory) IsKnown() bool
type UsageGetAccountUsageV1ResponseEnvelope ¶ added in v7.9.0
type UsageGetAccountUsageV1ResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsageGetAccountUsageV1ResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains informational notices about the response.
Messages []UsageGetAccountUsageV1ResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the array of billable usage records.
Result []UsageGetAccountUsageV1Response `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsageGetAccountUsageV1ResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usageGetAccountUsageV1ResponseEnvelopeJSON `json:"-"`
}
Represents a successful response containing billable usage records.
func (*UsageGetAccountUsageV1ResponseEnvelope) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV1ResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV1ResponseEnvelopeErrors ¶ added in v7.9.0
type UsageGetAccountUsageV1ResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageV1ResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageV1ResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV1ResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV1ResponseEnvelopeMessages ¶ added in v7.9.0
type UsageGetAccountUsageV1ResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageV1ResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageV1ResponseEnvelopeMessages) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV1ResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV1ResponseEnvelopeSuccess ¶ added in v7.9.0
type UsageGetAccountUsageV1ResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsageGetAccountUsageV1ResponseEnvelopeSuccessTrue UsageGetAccountUsageV1ResponseEnvelopeSuccess = true
)
func (UsageGetAccountUsageV1ResponseEnvelopeSuccess) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV1ResponseEnvelopeSuccess) IsKnown() bool
type UsageGetAccountUsageV2Params ¶ added in v7.9.0
type UsageGetAccountUsageV2Params struct {
// Represents a Cloudflare resource identifier tag.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Start date for the usage query (ISO 8601). Required if `to` is set. When omitted
// along with `to`, defaults to the start of the current month. Filters by charge
// period (when consumption happened), not billing period. The maximum date range
// is 31 days.
From param.Field[time.Time] `query:"from" format:"date"`
// End date for the usage query (ISO 8601). Required if `from` is set. When omitted
// along with `from`, defaults to today. Filters by charge period (when consumption
// happened), not billing period. The maximum date range is 31 days.
To param.Field[time.Time] `query:"to" format:"date"`
}
func (UsageGetAccountUsageV2Params) URLQuery ¶ added in v7.9.0
func (r UsageGetAccountUsageV2Params) URLQuery() (v url.Values)
URLQuery serializes UsageGetAccountUsageV2Params's query parameters as `url.Values`.
type UsageGetAccountUsageV2Response ¶ added in v7.9.0
type UsageGetAccountUsageV2Response struct {
// Public identifier of the Cloudflare account (account tag).
BillingAccountID string `json:"BillingAccountId" api:"required"`
// Display name of the Cloudflare account.
BillingAccountName string `json:"BillingAccountName" api:"required"`
// Highest-level classification of a charge based on the nature of how it gets
// billed. Currently only "Usage" is supported.
ChargeCategory UsageGetAccountUsageV2ResponseChargeCategory `json:"ChargeCategory" api:"required"`
// Self-contained summary of the charge's purpose and price.
ChargeDescription string `json:"ChargeDescription" api:"required"`
// Indicates how often a charge occurs. Currently only "Usage-Based" is supported.
ChargeFrequency UsageGetAccountUsageV2ResponseChargeFrequency `json:"ChargeFrequency" api:"required"`
// Exclusive end of the time interval during which the usage was consumed.
ChargePeriodEnd time.Time `json:"ChargePeriodEnd" api:"required" format:"date-time"`
// Inclusive start of the time interval during which the usage was consumed.
ChargePeriodStart time.Time `json:"ChargePeriodStart" api:"required" format:"date-time"`
// Measured usage amount within the charge period. Reflects raw metered consumption
// before pricing transformations.
ConsumedQuantity float64 `json:"ConsumedQuantity" api:"required"`
// Unit of measure for the consumed quantity (e.g., "GB", "Requests",
// "vCPU-Hours").
ConsumedUnit string `json:"ConsumedUnit" api:"required"`
// Name of the entity providing the underlying infrastructure or platform.
HostProviderName string `json:"HostProviderName" api:"required"`
// Name of the entity responsible for invoicing for the services consumed.
InvoiceIssuerName string `json:"InvoiceIssuerName" api:"required"`
// Name of the entity that made the services available for purchase.
ServiceProviderName string `json:"ServiceProviderName" api:"required"`
// The unique identifier for the billable metric in the Cloudflare catalog.
// Cloudflare extension; replaces FOCUS SkuId.
XBillableMetricID string `json:"x_BillableMetricId" api:"required"`
// The display name of the billable metric. Cloudflare extension; replaces FOCUS
// SkuMeter.
XBillableMetricName string `json:"x_BillableMetricName" api:"required"`
// A charge serving as the basis for invoicing, inclusive of all reduced rates and
// discounts while excluding the amortization of upfront charges (one-time or
// recurring).
BilledCost float64 `json:"BilledCost" api:"nullable"`
// Currency that a charge was billed in (ISO 4217).
BillingCurrency string `json:"BillingCurrency" api:"nullable"`
// Exclusive end of the billing cycle that contains this usage record.
BillingPeriodEnd time.Time `json:"BillingPeriodEnd" api:"nullable" format:"date-time"`
// Inclusive start of the billing cycle that contains this usage record.
BillingPeriodStart time.Time `json:"BillingPeriodStart" api:"nullable" format:"date-time"`
// Indicates whether the row represents a correction to one or more charges
// invoiced in a previous billing period.
ChargeClass UsageGetAccountUsageV2ResponseChargeClass `json:"ChargeClass" api:"nullable"`
// Cost calculated by multiplying ContractedUnitPrice and the corresponding
// PricingQuantity.
ContractedCost float64 `json:"ContractedCost" api:"nullable"`
// The agreed-upon unit price for a single PricingUnit of the associated billable
// metric, inclusive of negotiated discounts, if present, while excluding any other
// discounts.
ContractedUnitPrice float64 `json:"ContractedUnitPrice" api:"nullable"`
// The amortized cost of the charge after applying all reduced rates, discounts,
// and the applicable portion of relevant, prepaid purchases (one-time or
// recurring) that covered the charge.
EffectiveCost float64 `json:"EffectiveCost" api:"nullable"`
// Cost calculated by multiplying ListUnitPrice and the corresponding
// PricingQuantity.
ListCost float64 `json:"ListCost" api:"nullable"`
// Suggested provider-published unit price for a single PricingUnit of the
// associated billable metric, exclusive of any discounts.
ListUnitPrice float64 `json:"ListUnitPrice" api:"nullable"`
// Volume of a given service used or purchased, based on the PricingUnit.
PricingQuantity float64 `json:"PricingQuantity" api:"nullable"`
// Provider-specified measurement unit for determining unit prices, indicating how
// the provider rates measured usage after applying pricing rules like block
// pricing.
PricingUnit string `json:"PricingUnit" api:"nullable"`
// Provider-assigned identifier for an isolated geographic area where a service is
// provided.
RegionID string `json:"RegionId" api:"nullable"`
// Name of an isolated geographic area where a service is provided.
RegionName string `json:"RegionName" api:"nullable"`
// Unique identifier assigned to a grouping of services. For Cloudflare, this is
// the subscription or contract ID.
SubAccountID string `json:"SubAccountId"`
// Name assigned to a grouping of services. For Cloudflare, this is the
// subscription or contract display name.
SubAccountName string `json:"SubAccountName"`
// The product category the charge belongs to (e.g., "Developer", "Cloudflare
// One"). Cloudflare extension; replaces FOCUS ServiceCategory.
XProductCategoryName string `json:"x_ProductCategoryName"`
// The unique identifier for the product family in the Cloudflare catalog.
// Cloudflare extension; replaces FOCUS ServiceId.
XProductFamilyID string `json:"x_ProductFamilyId"`
// The product family the charge belongs to (e.g., "R2", "Workers"). Cloudflare
// extension; replaces FOCUS ServiceName.
XProductFamilyName string `json:"x_ProductFamilyName"`
// The identifier for the Cloudflare zone (zone tag). Cloudflare extension.
XZoneID string `json:"x_ZoneId" api:"nullable"`
// The display name of the Cloudflare zone. Cloudflare extension.
XZoneName string `json:"x_ZoneName" api:"nullable"`
JSON usageGetAccountUsageV2ResponseJSON `json:"-"`
}
A single cost and usage record for a metered product within a specific charge period, aligned with the FinOps FOCUS v1.3 specification.
func (*UsageGetAccountUsageV2Response) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV2Response) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV2ResponseChargeCategory ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseChargeCategory string
Highest-level classification of a charge based on the nature of how it gets billed. Currently only "Usage" is supported.
const (
UsageGetAccountUsageV2ResponseChargeCategoryUsage UsageGetAccountUsageV2ResponseChargeCategory = "Usage"
)
func (UsageGetAccountUsageV2ResponseChargeCategory) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV2ResponseChargeCategory) IsKnown() bool
type UsageGetAccountUsageV2ResponseChargeClass ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseChargeClass string
Indicates whether the row represents a correction to one or more charges invoiced in a previous billing period.
const (
UsageGetAccountUsageV2ResponseChargeClassCorrection UsageGetAccountUsageV2ResponseChargeClass = "Correction"
)
func (UsageGetAccountUsageV2ResponseChargeClass) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV2ResponseChargeClass) IsKnown() bool
type UsageGetAccountUsageV2ResponseChargeFrequency ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseChargeFrequency string
Indicates how often a charge occurs. Currently only "Usage-Based" is supported.
const (
UsageGetAccountUsageV2ResponseChargeFrequencyUsageBased UsageGetAccountUsageV2ResponseChargeFrequency = "Usage-Based"
)
func (UsageGetAccountUsageV2ResponseChargeFrequency) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV2ResponseChargeFrequency) IsKnown() bool
type UsageGetAccountUsageV2ResponseEnvelope ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsageGetAccountUsageV2ResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains informational notices about the response.
Messages []UsageGetAccountUsageV2ResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the array of cost and usage records.
Result []UsageGetAccountUsageV2Response `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsageGetAccountUsageV2ResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usageGetAccountUsageV2ResponseEnvelopeJSON `json:"-"`
}
Successful response containing an array of FOCUS-aligned cost and usage records.
func (*UsageGetAccountUsageV2ResponseEnvelope) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV2ResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV2ResponseEnvelopeErrors ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageV2ResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageV2ResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV2ResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV2ResponseEnvelopeMessages ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetAccountUsageV2ResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetAccountUsageV2ResponseEnvelopeMessages) UnmarshalJSON ¶ added in v7.9.0
func (r *UsageGetAccountUsageV2ResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsageGetAccountUsageV2ResponseEnvelopeSuccess ¶ added in v7.9.0
type UsageGetAccountUsageV2ResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsageGetAccountUsageV2ResponseEnvelopeSuccessTrue UsageGetAccountUsageV2ResponseEnvelopeSuccess = true
)
func (UsageGetAccountUsageV2ResponseEnvelopeSuccess) IsKnown ¶ added in v7.9.0
func (r UsageGetAccountUsageV2ResponseEnvelopeSuccess) IsKnown() bool
type UsageGetParams ¶ added in v7.4.0
type UsageGetParams struct {
// Represents a Cloudflare resource identifier tag.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Start date for the usage query (ISO 8601). Required if `to` is set. When omitted
// along with `to`, defaults to the start of the current month. Filters by charge
// period (when consumption happened), not billing period. The maximum date range
// is 31 days.
From param.Field[time.Time] `query:"from" format:"date"`
// End date for the usage query (ISO 8601). Required if `from` is set. When omitted
// along with `from`, defaults to today. Filters by charge period (when consumption
// happened), not billing period. The maximum date range is 31 days.
To param.Field[time.Time] `query:"to" format:"date"`
}
func (UsageGetParams) URLQuery ¶ added in v7.4.0
func (r UsageGetParams) URLQuery() (v url.Values)
URLQuery serializes UsageGetParams's query parameters as `url.Values`.
type UsageGetResponse ¶ added in v7.4.0
type UsageGetResponse struct {
// Public identifier of the Cloudflare account (account tag).
BillingAccountID string `json:"BillingAccountId" api:"required"`
// Display name of the Cloudflare account.
BillingAccountName string `json:"BillingAccountName" api:"required"`
// Highest-level classification of a charge based on the nature of how it gets
// billed. Currently only "Usage" is supported.
ChargeCategory UsageGetResponseChargeCategory `json:"ChargeCategory" api:"required"`
// Self-contained summary of the charge's purpose and price.
ChargeDescription string `json:"ChargeDescription" api:"required"`
// Indicates how often a charge occurs. Currently only "Usage-Based" is supported.
ChargeFrequency UsageGetResponseChargeFrequency `json:"ChargeFrequency" api:"required"`
// Exclusive end of the time interval during which the usage was consumed.
ChargePeriodEnd time.Time `json:"ChargePeriodEnd" api:"required" format:"date-time"`
// Inclusive start of the time interval during which the usage was consumed.
ChargePeriodStart time.Time `json:"ChargePeriodStart" api:"required" format:"date-time"`
// Measured usage amount within the charge period. Reflects raw metered consumption
// before pricing transformations.
ConsumedQuantity float64 `json:"ConsumedQuantity" api:"required"`
// Unit of measure for the consumed quantity (e.g., "GB", "Requests",
// "vCPU-Hours").
ConsumedUnit string `json:"ConsumedUnit" api:"required"`
// Name of the entity providing the underlying infrastructure or platform.
HostProviderName string `json:"HostProviderName" api:"required"`
// Name of the entity responsible for invoicing for the services consumed.
InvoiceIssuerName string `json:"InvoiceIssuerName" api:"required"`
// Name of the entity that made the services available for purchase.
ServiceProviderName string `json:"ServiceProviderName" api:"required"`
// The unique identifier for the billable metric in the Cloudflare catalog.
// Cloudflare extension; replaces FOCUS SkuId.
XBillableMetricID string `json:"x_BillableMetricId" api:"required"`
// The display name of the billable metric. Cloudflare extension; replaces FOCUS
// SkuMeter.
XBillableMetricName string `json:"x_BillableMetricName" api:"required"`
// A charge serving as the basis for invoicing, inclusive of all reduced rates and
// discounts while excluding the amortization of upfront charges (one-time or
// recurring).
BilledCost float64 `json:"BilledCost" api:"nullable"`
// Currency that a charge was billed in (ISO 4217).
BillingCurrency string `json:"BillingCurrency" api:"nullable"`
// Exclusive end of the billing cycle that contains this usage record.
BillingPeriodEnd time.Time `json:"BillingPeriodEnd" api:"nullable" format:"date-time"`
// Inclusive start of the billing cycle that contains this usage record.
BillingPeriodStart time.Time `json:"BillingPeriodStart" api:"nullable" format:"date-time"`
// Indicates whether the row represents a correction to one or more charges
// invoiced in a previous billing period.
ChargeClass UsageGetResponseChargeClass `json:"ChargeClass" api:"nullable"`
// Cost calculated by multiplying ContractedUnitPrice and the corresponding
// PricingQuantity.
ContractedCost float64 `json:"ContractedCost" api:"nullable"`
// The agreed-upon unit price for a single PricingUnit of the associated billable
// metric, inclusive of negotiated discounts, if present, while excluding any other
// discounts.
ContractedUnitPrice float64 `json:"ContractedUnitPrice" api:"nullable"`
// The amortized cost of the charge after applying all reduced rates, discounts,
// and the applicable portion of relevant, prepaid purchases (one-time or
// recurring) that covered the charge.
EffectiveCost float64 `json:"EffectiveCost" api:"nullable"`
// Cost calculated by multiplying ListUnitPrice and the corresponding
// PricingQuantity.
ListCost float64 `json:"ListCost" api:"nullable"`
// Suggested provider-published unit price for a single PricingUnit of the
// associated billable metric, exclusive of any discounts.
ListUnitPrice float64 `json:"ListUnitPrice" api:"nullable"`
// Volume of a given service used or purchased, based on the PricingUnit.
PricingQuantity float64 `json:"PricingQuantity" api:"nullable"`
// Provider-specified measurement unit for determining unit prices, indicating how
// the provider rates measured usage after applying pricing rules like block
// pricing.
PricingUnit string `json:"PricingUnit" api:"nullable"`
// Provider-assigned identifier for an isolated geographic area where a service is
// provided.
RegionID string `json:"RegionId" api:"nullable"`
// Name of an isolated geographic area where a service is provided.
RegionName string `json:"RegionName" api:"nullable"`
// Unique identifier assigned to a grouping of services. For Cloudflare, this is
// the subscription or contract ID.
SubAccountID string `json:"SubAccountId"`
// Name assigned to a grouping of services. For Cloudflare, this is the
// subscription or contract display name.
SubAccountName string `json:"SubAccountName"`
// The product category the charge belongs to (e.g., "Developer", "Cloudflare
// One"). Cloudflare extension; replaces FOCUS ServiceCategory.
XProductCategoryName string `json:"x_ProductCategoryName"`
// The unique identifier for the product family in the Cloudflare catalog.
// Cloudflare extension; replaces FOCUS ServiceId.
XProductFamilyID string `json:"x_ProductFamilyId"`
// The product family the charge belongs to (e.g., "R2", "Workers"). Cloudflare
// extension; replaces FOCUS ServiceName.
XProductFamilyName string `json:"x_ProductFamilyName"`
// The identifier for the Cloudflare zone (zone tag). Cloudflare extension.
XZoneID string `json:"x_ZoneId" api:"nullable"`
// The display name of the Cloudflare zone. Cloudflare extension.
XZoneName string `json:"x_ZoneName" api:"nullable"`
JSON usageGetResponseJSON `json:"-"`
}
A single cost and usage record for a metered product within a specific charge period, aligned with the FinOps FOCUS v1.3 specification.
func (*UsageGetResponse) UnmarshalJSON ¶ added in v7.4.0
func (r *UsageGetResponse) UnmarshalJSON(data []byte) (err error)
type UsageGetResponseChargeCategory ¶ added in v7.4.0
type UsageGetResponseChargeCategory string
Highest-level classification of a charge based on the nature of how it gets billed. Currently only "Usage" is supported.
const (
UsageGetResponseChargeCategoryUsage UsageGetResponseChargeCategory = "Usage"
)
func (UsageGetResponseChargeCategory) IsKnown ¶ added in v7.4.0
func (r UsageGetResponseChargeCategory) IsKnown() bool
type UsageGetResponseChargeClass ¶ added in v7.4.0
type UsageGetResponseChargeClass string
Indicates whether the row represents a correction to one or more charges invoiced in a previous billing period.
const (
UsageGetResponseChargeClassCorrection UsageGetResponseChargeClass = "Correction"
)
func (UsageGetResponseChargeClass) IsKnown ¶ added in v7.4.0
func (r UsageGetResponseChargeClass) IsKnown() bool
type UsageGetResponseChargeFrequency ¶ added in v7.4.0
type UsageGetResponseChargeFrequency string
Indicates how often a charge occurs. Currently only "Usage-Based" is supported.
const (
UsageGetResponseChargeFrequencyUsageBased UsageGetResponseChargeFrequency = "Usage-Based"
)
func (UsageGetResponseChargeFrequency) IsKnown ¶ added in v7.4.0
func (r UsageGetResponseChargeFrequency) IsKnown() bool
type UsageGetResponseEnvelope ¶ added in v7.4.0
type UsageGetResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsageGetResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains informational notices about the response.
Messages []UsageGetResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the array of cost and usage records.
Result []UsageGetResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsageGetResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usageGetResponseEnvelopeJSON `json:"-"`
}
Successful response containing an array of FOCUS-aligned cost and usage records.
func (*UsageGetResponseEnvelope) UnmarshalJSON ¶ added in v7.4.0
func (r *UsageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsageGetResponseEnvelopeErrors ¶ added in v7.4.0
type UsageGetResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.4.0
func (r *UsageGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsageGetResponseEnvelopeMessages ¶ added in v7.4.0
type UsageGetResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usageGetResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsageGetResponseEnvelopeMessages) UnmarshalJSON ¶ added in v7.4.0
func (r *UsageGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsageGetResponseEnvelopeSuccess ¶ added in v7.4.0
type UsageGetResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsageGetResponseEnvelopeSuccessTrue UsageGetResponseEnvelopeSuccess = true
)
func (UsageGetResponseEnvelopeSuccess) IsKnown ¶ added in v7.4.0
func (r UsageGetResponseEnvelopeSuccess) IsKnown() bool
type UsagePaygoInfoParams ¶ added in v7.8.0
type UsagePaygoInfoResponse ¶ added in v7.8.0
type UsagePaygoInfoResponse struct {
// Indicates whether the account is covered.
Covered bool `json:"covered" api:"required"`
// List of subscriptions for the account.
Subscriptions []UsagePaygoInfoResponseSubscription `json:"subscriptions" api:"required"`
JSON usagePaygoInfoResponseJSON `json:"-"`
}
Contains the usage info.
func (*UsagePaygoInfoResponse) UnmarshalJSON ¶ added in v7.8.0
func (r *UsagePaygoInfoResponse) UnmarshalJSON(data []byte) (err error)
type UsagePaygoInfoResponseEnvelope ¶ added in v7.8.0
type UsagePaygoInfoResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsagePaygoInfoResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains any informational messages from the API.
Messages []UsagePaygoInfoResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the usage info.
Result UsagePaygoInfoResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsagePaygoInfoResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usagePaygoInfoResponseEnvelopeJSON `json:"-"`
}
Represents a successful response containing subscription info.
func (*UsagePaygoInfoResponseEnvelope) UnmarshalJSON ¶ added in v7.8.0
func (r *UsagePaygoInfoResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsagePaygoInfoResponseEnvelopeErrors ¶ added in v7.8.0
type UsagePaygoInfoResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usagePaygoInfoResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsagePaygoInfoResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.8.0
func (r *UsagePaygoInfoResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsagePaygoInfoResponseEnvelopeMessages ¶ added in v7.8.0
type UsagePaygoInfoResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usagePaygoInfoResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsagePaygoInfoResponseEnvelopeMessages) UnmarshalJSON ¶ added in v7.8.0
func (r *UsagePaygoInfoResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsagePaygoInfoResponseEnvelopeSuccess ¶ added in v7.8.0
type UsagePaygoInfoResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsagePaygoInfoResponseEnvelopeSuccessTrue UsagePaygoInfoResponseEnvelopeSuccess = true
)
func (UsagePaygoInfoResponseEnvelopeSuccess) IsKnown ¶ added in v7.8.0
func (r UsagePaygoInfoResponseEnvelopeSuccess) IsKnown() bool
type UsagePaygoInfoResponseSubscription ¶ added in v7.8.0
type UsagePaygoInfoResponseSubscription struct {
// The identifier for the Cloudflare subscription.
ID string `json:"id" api:"required"`
// The subscription billing cycle anchor timestamp.
BillingCycleAnchorTimestamp time.Time `json:"billing_cycle_anchor_timestamp" api:"required" format:"date-time"`
// The subscription start timestamp.
StartTimestamp time.Time `json:"start_timestamp" api:"required" format:"date-time"`
// The subscription end timestamp. Omitted for active subscriptions; present only
// when the subscription has been cancelled.
EndTimestamp time.Time `json:"end_timestamp" format:"date-time"`
JSON usagePaygoInfoResponseSubscriptionJSON `json:"-"`
}
func (*UsagePaygoInfoResponseSubscription) UnmarshalJSON ¶ added in v7.8.0
func (r *UsagePaygoInfoResponseSubscription) UnmarshalJSON(data []byte) (err error)
type UsagePaygoParams ¶
type UsagePaygoParams struct {
// Represents a Cloudflare resource identifier tag.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Start date for the usage query (ISO 8601). The provided time range must include
// the subscription billing cycle anchor day, otherwise no usage data is returned.
// Use the info endpoint to retrieve the subscription anchor day.
From param.Field[time.Time] `query:"from" format:"date"`
// End date for the usage query (ISO 8601).
To param.Field[time.Time] `query:"to" format:"date"`
}
func (UsagePaygoParams) URLQuery ¶
func (r UsagePaygoParams) URLQuery() (v url.Values)
URLQuery serializes UsagePaygoParams's query parameters as `url.Values`.
type UsagePaygoResponse ¶
type UsagePaygoResponse struct {
// The amount invoiced for this charge. PayGo is billed directly by Cloudflare, so
// this equals ContractedCost.
BilledCost float64 `json:"BilledCost" api:"required"`
// The identifier of the account the charge is billed to (account tag).
BillingAccountID string `json:"BillingAccountId" api:"required"`
// The display name of the billing account. Null when the name could not be
// resolved.
BillingAccountName string `json:"BillingAccountName" api:"required,nullable"`
// Specifies the billing currency code (ISO 4217).
BillingCurrency string `json:"BillingCurrency" api:"required"`
// Indicates the start of the billing period. There is no `BillingPeriodEnd`
// counterpart; see the known gaps described on this schema.
BillingPeriodStart time.Time `json:"BillingPeriodStart" api:"required" format:"date-time"`
// Describes the nature of the charge. Always "Usage" for this endpoint, which only
// returns metered usage.
ChargeCategory UsagePaygoResponseChargeCategory `json:"ChargeCategory" api:"required"`
// Indicates whether the row corrects a previously invoiced billing period. Always
// null for this endpoint, which does not return corrections.
ChargeClass string `json:"ChargeClass" api:"required,nullable"`
// A human-readable summary of the charge.
ChargeDescription string `json:"ChargeDescription" api:"required,nullable"`
// Indicates the end of the charge period.
ChargePeriodEnd time.Time `json:"ChargePeriodEnd" api:"required" format:"date-time"`
// Indicates the start of the charge period.
ChargePeriodStart time.Time `json:"ChargePeriodStart" api:"required" format:"date-time"`
// Specifies the quantity consumed during this charge period.
ConsumedQuantity float64 `json:"ConsumedQuantity" api:"required"`
// A display name for the unit of measurement used for the product (for example,
// "GB-months", "GB-seconds"). May be empty when the unit is implicit in the
// service name.
ConsumedUnit string `json:"ConsumedUnit" api:"required"`
// Specifies the cost for this charge period in the billing currency.
ContractedCost float64 `json:"ContractedCost" api:"required"`
// Specifies the cumulated cost for the billing period in the billing currency.
CumulatedContractedCost float64 `json:"CumulatedContractedCost" api:"required"`
// Specifies the cumulated pricing quantity for the billing period.
CumulatedPricingQuantity int64 `json:"CumulatedPricingQuantity" api:"required"`
// The amortized cost of the charge. PayGo has no upfront commitments, so this
// equals ContractedCost.
EffectiveCost float64 `json:"EffectiveCost" api:"required"`
// The provider that hosts the infrastructure or platform the service runs on.
HostProviderName string `json:"HostProviderName" api:"required"`
// The entity that issues the invoice for this charge.
InvoiceIssuerName string `json:"InvoiceIssuerName" api:"required"`
// The cost at published list prices, before any discount. PayGo has no commitment
// discounts, so this equals ContractedCost.
ListCost float64 `json:"ListCost" api:"required"`
// Specifies the pricing quantity for this charge period.
PricingQuantity int64 `json:"PricingQuantity" api:"required"`
// The unit that PricingQuantity is expressed in. Unlike ConsumedUnit this is never
// empty; it falls back to "Count" when the service has no explicit unit.
PricingUnit string `json:"PricingUnit" api:"required"`
// Identifies the Cloudflare service.
ServiceName string `json:"ServiceName" api:"required"`
// The provider of the purchased service.
ServiceProviderName string `json:"ServiceProviderName" api:"required"`
// Identifies the product family for the Cloudflare service.
ServiceFamilyName string `json:"ServiceFamilyName"`
// The identifier for the Cloudflare subscription.
SubscriptionID string `json:"SubscriptionId" api:"nullable"`
// The identifier for the Cloudflare zone (zone tag).
ZoneID string `json:"ZoneId" api:"nullable"`
// The display name of the Cloudflare zone.
ZoneName string `json:"ZoneName" api:"nullable"`
JSON usagePaygoResponseJSON `json:"-"`
}
Represents a single billable usage record.
This schema carries 19 of the 21 columns FOCUS 1.3 marks as mandatory. Mandatory columns are always present, using an explicit null when the value is unknown, so consumers can distinguish "unknown" from "not provided".
Known gap 1: `ServiceCategory` (FOCUS 1.3 section 3.1.55) is not yet implemented and does not appear in this schema. Cloudflare's product catalog does not yet have a stakeholder-approved mapping from product family to a FOCUS ServiceCategory value, so the column is omitted entirely rather than shipping unapproved values. It will be added once that mapping exists.
Known gap 2: `BillingPeriodEnd` (FOCUS 1.3 section 3.1.4) is not yet implemented and does not appear in this schema, because no authoritative source for it exists today. Deriving it by calendar arithmetic drifts for billing cycle anchors on day 29-31, and the billing provider's current period end describes only the current period, so it is wrong for backdated records. `BillingPeriodStart` is correctly sourced and is still reported, so records carry a billing period start with no corresponding end until an authoritative end date is available.
Per FOCUS 1.3 section 4.1.4.1, the columns that are not part of FOCUS (`ServiceFamilyName`, `CumulatedPricingQuantity`, `CumulatedContractedCost`, `ZoneId`, `ZoneName` and `SubscriptionId`) would normally carry an `x_` prefix. They are kept unprefixed here to avoid a breaking change for existing consumers.
func (*UsagePaygoResponse) UnmarshalJSON ¶
func (r *UsagePaygoResponse) UnmarshalJSON(data []byte) (err error)
type UsagePaygoResponseChargeCategory ¶ added in v7.9.0
type UsagePaygoResponseChargeCategory string
Describes the nature of the charge. Always "Usage" for this endpoint, which only returns metered usage.
const (
UsagePaygoResponseChargeCategoryUsage UsagePaygoResponseChargeCategory = "Usage"
)
func (UsagePaygoResponseChargeCategory) IsKnown ¶ added in v7.9.0
func (r UsagePaygoResponseChargeCategory) IsKnown() bool
type UsagePaygoResponseEnvelope ¶
type UsagePaygoResponseEnvelope struct {
// Contains error details if the request failed.
Errors []UsagePaygoResponseEnvelopeErrors `json:"errors" api:"required,nullable"`
// Contains informational notices about the response.
Messages []UsagePaygoResponseEnvelopeMessages `json:"messages" api:"required,nullable"`
// Contains the array of billable usage records.
Result []UsagePaygoResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success UsagePaygoResponseEnvelopeSuccess `json:"success" api:"required"`
JSON usagePaygoResponseEnvelopeJSON `json:"-"`
}
Represents a successful response containing billable usage records.
func (*UsagePaygoResponseEnvelope) UnmarshalJSON ¶
func (r *UsagePaygoResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type UsagePaygoResponseEnvelopeErrors ¶
type UsagePaygoResponseEnvelopeErrors struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usagePaygoResponseEnvelopeErrorsJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsagePaygoResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *UsagePaygoResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type UsagePaygoResponseEnvelopeMessages ¶
type UsagePaygoResponseEnvelopeMessages struct {
// Describes the error or notice.
Message string `json:"message" api:"required"`
// Identifies the error or notice type.
Code int64 `json:"code"`
JSON usagePaygoResponseEnvelopeMessagesJSON `json:"-"`
}
Represents an API notice or error detail.
func (*UsagePaygoResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *UsagePaygoResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type UsagePaygoResponseEnvelopeSuccess ¶
type UsagePaygoResponseEnvelopeSuccess bool
Indicates whether the API call was successful.
const (
UsagePaygoResponseEnvelopeSuccessTrue UsagePaygoResponseEnvelopeSuccess = true
)
func (UsagePaygoResponseEnvelopeSuccess) IsKnown ¶
func (r UsagePaygoResponseEnvelopeSuccess) IsKnown() bool
type UsageService ¶
type UsageService struct {
Options []option.RequestOption
}
UsageService 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 NewUsageService method instead.
func NewUsageService ¶
func NewUsageService(opts ...option.RequestOption) (r *UsageService)
NewUsageService 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 (*UsageService) Get
deprecated
added in
v7.4.0
func (r *UsageService) Get(ctx context.Context, params UsageGetParams, opts ...option.RequestOption) (res *[]UsageGetResponse, err error)
Returns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification.
Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost.
**Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete.
When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.
Deprecated: Use `get_account_usage_v2` instead.
func (*UsageService) GetAccountUsageInfoV1 ¶ added in v7.9.0
func (r *UsageService) GetAccountUsageInfoV1(ctx context.Context, query UsageGetAccountUsageInfoV1Params, opts ...option.RequestOption) (res *UsageGetAccountUsageInfoV1Response, err error)
Returns high-level usage information for the account, including coverage, and subscription metadata.
func (*UsageService) GetAccountUsageV1 ¶ added in v7.9.0
func (r *UsageService) GetAccountUsageV1(ctx context.Context, params UsageGetAccountUsageV1Params, opts ...option.RequestOption) (res *[]UsageGetAccountUsageV1Response, err error)
Returns billable usage data for the account. When no query parameters are provided, returns usage for the current billing period.
func (*UsageService) GetAccountUsageV2 ¶ added in v7.9.0
func (r *UsageService) GetAccountUsageV2(ctx context.Context, params UsageGetAccountUsageV2Params, opts ...option.RequestOption) (res *[]UsageGetAccountUsageV2Response, err error)
Returns cost and usage data for a single Cloudflare account, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification.
Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost.
**Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete.
When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.
func (*UsageService) Paygo
deprecated
func (r *UsageService) Paygo(ctx context.Context, params UsagePaygoParams, opts ...option.RequestOption) (res *[]UsagePaygoResponse, err error)
Returns billable usage data for the account. When no query parameters are provided, returns usage for the current billing period.
Deprecated: Use `get_account_usage_v1` instead.
func (*UsageService) PaygoInfo
deprecated
added in
v7.8.0
func (r *UsageService) PaygoInfo(ctx context.Context, query UsagePaygoInfoParams, opts ...option.RequestOption) (res *UsagePaygoInfoResponse, err error)
Returns high-level usage information for the account, including coverage, and subscription metadata.
Deprecated: Use `get_account_usage_info_v1` instead.