user

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

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 AuditLogListParams

type AuditLogListParams struct {
	// Finds a specific log by its ID.
	ID     param.Field[string]                   `query:"id"`
	Action param.Field[AuditLogListParamsAction] `query:"action"`
	Actor  param.Field[AuditLogListParamsActor]  `query:"actor"`
	// Limits the returned results to logs older than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Before param.Field[time.Time] `query:"before" format:"date-time"`
	// Changes the direction of the chronological sorting.
	Direction param.Field[AuditLogListParamsDirection] `query:"direction"`
	// Indicates that this request is an export of logs in CSV format.
	Export param.Field[bool] `query:"export"`
	// Indicates whether or not to hide user level audit logs.
	HideUserLogs param.Field[bool] `query:"hide_user_logs"`
	// Defines which page of results to return.
	Page param.Field[float64] `query:"page"`
	// Sets the number of results to return per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Limits the returned results to logs newer than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Since param.Field[time.Time]              `query:"since" format:"date-time"`
	Zone  param.Field[AuditLogListParamsZone] `query:"zone"`
}

func (AuditLogListParams) URLQuery

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

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

type AuditLogListParamsAction

type AuditLogListParamsAction struct {
	// Filters by the action type.
	Type param.Field[string] `query:"type"`
}

func (AuditLogListParamsAction) URLQuery

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

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

type AuditLogListParamsActor

type AuditLogListParamsActor struct {
	// Filters by the email address of the actor that made the change.
	Email param.Field[string] `query:"email" format:"email"`
	// Filters by the IP address of the request that made the change by specific IP
	// address or valid CIDR Range.
	IP param.Field[string] `query:"ip"`
}

func (AuditLogListParamsActor) URLQuery

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

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

type AuditLogListParamsDirection

type AuditLogListParamsDirection string

Changes the direction of the chronological sorting.

const (
	AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc"
	AuditLogListParamsDirectionAsc  AuditLogListParamsDirection = "asc"
)

func (AuditLogListParamsDirection) IsKnown

func (r AuditLogListParamsDirection) IsKnown() bool

type AuditLogListParamsZone

type AuditLogListParamsZone struct {
	// Filters by the name of the zone associated to the change.
	Name param.Field[string] `query:"name"`
}

func (AuditLogListParamsZone) URLQuery

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

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

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 AuditLogService

type AuditLogService struct {
	Options []option.RequestOption
}

AuditLogService 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 NewAuditLogService method instead.

func NewAuditLogService

func NewAuditLogService(opts ...option.RequestOption) (r *AuditLogService)

NewAuditLogService 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 (*AuditLogService) List

Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

func (*AuditLogService) ListAutoPaging

Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

type BillingHistory

type BillingHistory struct {
	// Billing item identifier tag.
	ID string `json:"id,required"`
	// The billing item action.
	Action string `json:"action,required"`
	// The amount associated with this billing item.
	Amount float64 `json:"amount,required"`
	// The monetary unit in which pricing information is displayed.
	Currency string `json:"currency,required"`
	// The billing item description.
	Description string `json:"description,required"`
	// When the billing item was created.
	OccurredAt time.Time `json:"occurred_at,required" format:"date-time"`
	// The billing item type.
	Type string             `json:"type,required"`
	Zone BillingHistoryZone `json:"zone,required"`
	JSON billingHistoryJSON `json:"-"`
}

func (*BillingHistory) UnmarshalJSON

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

type BillingHistoryListParams

type BillingHistoryListParams struct {
	// The billing item action.
	Action param.Field[string] `query:"action"`
	// When the billing item was created.
	OccuredAt param.Field[time.Time] `query:"occured_at" format:"date-time"`
	// When the billing item was created.
	OccurredAt param.Field[time.Time] `query:"occurred_at" format:"date-time"`
	// Field to order billing history by.
	Order param.Field[BillingHistoryListParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
	// The billing item type.
	Type param.Field[string] `query:"type"`
}

func (BillingHistoryListParams) URLQuery

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

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

type BillingHistoryListParamsOrder

type BillingHistoryListParamsOrder string

Field to order billing history by.

const (
	BillingHistoryListParamsOrderType      BillingHistoryListParamsOrder = "type"
	BillingHistoryListParamsOrderOccuredAt BillingHistoryListParamsOrder = "occured_at"
	BillingHistoryListParamsOrderAction    BillingHistoryListParamsOrder = "action"
)

func (BillingHistoryListParamsOrder) IsKnown

func (r BillingHistoryListParamsOrder) IsKnown() bool

type BillingHistoryService

type BillingHistoryService struct {
	Options []option.RequestOption
}

BillingHistoryService 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 NewBillingHistoryService method instead.

func NewBillingHistoryService

func NewBillingHistoryService(opts ...option.RequestOption) (r *BillingHistoryService)

NewBillingHistoryService 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 (*BillingHistoryService) List

Accesses your billing history object.

func (*BillingHistoryService) ListAutoPaging

Accesses your billing history object.

type BillingHistoryZone

type BillingHistoryZone struct {
	Name interface{}            `json:"name"`
	JSON billingHistoryZoneJSON `json:"-"`
}

func (*BillingHistoryZone) UnmarshalJSON

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

type BillingProfileGetResponseEnvelope

type BillingProfileGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo          `json:"errors,required"`
	Messages []shared.ResponseInfo          `json:"messages,required"`
	Result   BillingProfileGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success BillingProfileGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    billingProfileGetResponseEnvelopeJSON    `json:"-"`
}

func (*BillingProfileGetResponseEnvelope) UnmarshalJSON

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

type BillingProfileGetResponseEnvelopeSuccess

type BillingProfileGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	BillingProfileGetResponseEnvelopeSuccessTrue BillingProfileGetResponseEnvelopeSuccess = true
)

func (BillingProfileGetResponseEnvelopeSuccess) IsKnown

type BillingProfileGetResponseUnion

type BillingProfileGetResponseUnion interface {
	ImplementsUserBillingProfileGetResponseUnion()
}

Union satisfied by user.BillingProfileGetResponseUnknown or shared.UnionString.

type BillingProfileService

type BillingProfileService struct {
	Options []option.RequestOption
}

BillingProfileService 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 NewBillingProfileService method instead.

func NewBillingProfileService

func NewBillingProfileService(opts ...option.RequestOption) (r *BillingProfileService)

NewBillingProfileService 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 (*BillingProfileService) Get

Accesses your billing profile object.

type BillingService

type BillingService struct {
	Options []option.RequestOption
	History *BillingHistoryService
	Profile *BillingProfileService
}

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 CIDRListParam

type CIDRListParam = string

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 CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

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 Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type Invite

type Invite struct {
	// ID of the user to add to the organization.
	InvitedMemberID string `json:"invited_member_id,required,nullable"`
	// ID of the organization the user will be added to.
	OrganizationID string `json:"organization_id,required"`
	// Invite identifier tag.
	ID string `json:"id"`
	// When the invite is no longer active.
	ExpiresOn time.Time `json:"expires_on" format:"date-time"`
	// The email address of the user who created the invite.
	InvitedBy string `json:"invited_by"`
	// Email address of the user to add to the organization.
	InvitedMemberEmail string `json:"invited_member_email"`
	// When the invite was sent.
	InvitedOn time.Time `json:"invited_on" format:"date-time"`
	// Organization name.
	OrganizationName string `json:"organization_name"`
	// Roles to be assigned to this user.
	Roles []shared.Role `json:"roles"`
	// Current status of the invitation.
	Status InviteStatus `json:"status"`
	JSON   inviteJSON   `json:"-"`
}

func (*Invite) UnmarshalJSON

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

type InviteEditParams

type InviteEditParams struct {
	// Status of your response to the invitation (rejected or accepted).
	Status param.Field[InviteEditParamsStatus] `json:"status,required"`
}

func (InviteEditParams) MarshalJSON

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

type InviteEditParamsStatus

type InviteEditParamsStatus string

Status of your response to the invitation (rejected or accepted).

const (
	InviteEditParamsStatusAccepted InviteEditParamsStatus = "accepted"
	InviteEditParamsStatusRejected InviteEditParamsStatus = "rejected"
)

func (InviteEditParamsStatus) IsKnown

func (r InviteEditParamsStatus) IsKnown() bool

type InviteEditResponseEnvelope

type InviteEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo   `json:"errors,required"`
	Messages []shared.ResponseInfo   `json:"messages,required"`
	Result   InviteEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success InviteEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    inviteEditResponseEnvelopeJSON    `json:"-"`
}

func (*InviteEditResponseEnvelope) UnmarshalJSON

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

type InviteEditResponseEnvelopeSuccess

type InviteEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	InviteEditResponseEnvelopeSuccessTrue InviteEditResponseEnvelopeSuccess = true
)

func (InviteEditResponseEnvelopeSuccess) IsKnown

type InviteEditResponseUnion

type InviteEditResponseUnion interface {
	ImplementsUserInviteEditResponseUnion()
}

Union satisfied by user.InviteEditResponseUnknown or shared.UnionString.

type InviteGetResponseEnvelope

type InviteGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   InviteGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success InviteGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    inviteGetResponseEnvelopeJSON    `json:"-"`
}

func (*InviteGetResponseEnvelope) UnmarshalJSON

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

type InviteGetResponseEnvelopeSuccess

type InviteGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	InviteGetResponseEnvelopeSuccessTrue InviteGetResponseEnvelopeSuccess = true
)

func (InviteGetResponseEnvelopeSuccess) IsKnown

type InviteGetResponseUnion

type InviteGetResponseUnion interface {
	ImplementsUserInviteGetResponseUnion()
}

Union satisfied by user.InviteGetResponseUnknown or shared.UnionString.

type InviteService

type InviteService struct {
	Options []option.RequestOption
}

InviteService 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 NewInviteService method instead.

func NewInviteService

func NewInviteService(opts ...option.RequestOption) (r *InviteService)

NewInviteService 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 (*InviteService) Edit

func (r *InviteService) Edit(ctx context.Context, inviteID string, body InviteEditParams, opts ...option.RequestOption) (res *InviteEditResponseUnion, err error)

Responds to an invitation.

func (*InviteService) Get

func (r *InviteService) Get(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *InviteGetResponseUnion, err error)

Gets the details of an invitation.

func (*InviteService) List

func (r *InviteService) List(ctx context.Context, opts ...option.RequestOption) (res *pagination.SinglePage[Invite], err error)

Lists all invitations associated with my user.

func (*InviteService) ListAutoPaging

Lists all invitations associated with my user.

type InviteStatus

type InviteStatus string

Current status of the invitation.

const (
	InviteStatusPending  InviteStatus = "pending"
	InviteStatusAccepted InviteStatus = "accepted"
	InviteStatusRejected InviteStatus = "rejected"
	InviteStatusExpired  InviteStatus = "expired"
)

func (InviteStatus) IsKnown

func (r InviteStatus) IsKnown() bool

type Member added in v2.1.0

type Member = shared.Member

This is an alias to an internal type.

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRole added in v2.1.0

type MemberRole = shared.MemberRole

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissions added in v2.1.0

type MemberRolesPermissions = shared.MemberRolesPermissions

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberUser added in v2.1.0

type MemberUser = shared.MemberUser

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

This is an alias to an internal type.

type Organization

type Organization struct {
	// Identifier
	ID string `json:"id"`
	// Organization name.
	Name string `json:"name"`
	// Access permissions for this User.
	Permissions []shared.Permission `json:"permissions"`
	// List of roles that a user has within an organization.
	Roles []string `json:"roles"`
	// Whether the user is a member of the organization or has an inivitation pending.
	Status OrganizationStatus `json:"status"`
	JSON   organizationJSON   `json:"-"`
}

func (*Organization) UnmarshalJSON

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

type OrganizationDeleteParams

type OrganizationDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (OrganizationDeleteParams) MarshalJSON

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

type OrganizationDeleteResponse

type OrganizationDeleteResponse struct {
	// Identifier
	ID   string                         `json:"id"`
	JSON organizationDeleteResponseJSON `json:"-"`
}

func (*OrganizationDeleteResponse) UnmarshalJSON

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

type OrganizationGetResponseEnvelope

type OrganizationGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo        `json:"errors,required"`
	Messages []shared.ResponseInfo        `json:"messages,required"`
	Result   OrganizationGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success OrganizationGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    organizationGetResponseEnvelopeJSON    `json:"-"`
}

func (*OrganizationGetResponseEnvelope) UnmarshalJSON

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

type OrganizationGetResponseEnvelopeSuccess

type OrganizationGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	OrganizationGetResponseEnvelopeSuccessTrue OrganizationGetResponseEnvelopeSuccess = true
)

func (OrganizationGetResponseEnvelopeSuccess) IsKnown

type OrganizationGetResponseUnion

type OrganizationGetResponseUnion interface {
	ImplementsUserOrganizationGetResponseUnion()
}

Union satisfied by user.OrganizationGetResponseUnknown or shared.UnionString.

type OrganizationListParams

type OrganizationListParams struct {
	// Direction to order organizations.
	Direction param.Field[OrganizationListParamsDirection] `query:"direction"`
	// Whether to match all search requirements or at least one (any).
	Match param.Field[OrganizationListParamsMatch] `query:"match"`
	// Organization name.
	Name param.Field[string] `query:"name"`
	// Field to order organizations by.
	Order param.Field[OrganizationListParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of organizations per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Whether the user is a member of the organization or has an inivitation pending.
	Status param.Field[OrganizationListParamsStatus] `query:"status"`
}

func (OrganizationListParams) URLQuery

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

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

type OrganizationListParamsDirection

type OrganizationListParamsDirection string

Direction to order organizations.

const (
	OrganizationListParamsDirectionAsc  OrganizationListParamsDirection = "asc"
	OrganizationListParamsDirectionDesc OrganizationListParamsDirection = "desc"
)

func (OrganizationListParamsDirection) IsKnown

type OrganizationListParamsMatch

type OrganizationListParamsMatch string

Whether to match all search requirements or at least one (any).

const (
	OrganizationListParamsMatchAny OrganizationListParamsMatch = "any"
	OrganizationListParamsMatchAll OrganizationListParamsMatch = "all"
)

func (OrganizationListParamsMatch) IsKnown

func (r OrganizationListParamsMatch) IsKnown() bool

type OrganizationListParamsOrder

type OrganizationListParamsOrder string

Field to order organizations by.

const (
	OrganizationListParamsOrderID     OrganizationListParamsOrder = "id"
	OrganizationListParamsOrderName   OrganizationListParamsOrder = "name"
	OrganizationListParamsOrderStatus OrganizationListParamsOrder = "status"
)

func (OrganizationListParamsOrder) IsKnown

func (r OrganizationListParamsOrder) IsKnown() bool

type OrganizationListParamsStatus

type OrganizationListParamsStatus string

Whether the user is a member of the organization or has an inivitation pending.

const (
	OrganizationListParamsStatusMember  OrganizationListParamsStatus = "member"
	OrganizationListParamsStatusInvited OrganizationListParamsStatus = "invited"
)

func (OrganizationListParamsStatus) IsKnown

func (r OrganizationListParamsStatus) IsKnown() bool

type OrganizationService

type OrganizationService struct {
	Options []option.RequestOption
}

OrganizationService 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 NewOrganizationService method instead.

func NewOrganizationService

func NewOrganizationService(opts ...option.RequestOption) (r *OrganizationService)

NewOrganizationService 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 (*OrganizationService) Delete

Removes association to an organization.

func (*OrganizationService) Get

func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationGetResponseUnion, err error)

Gets a specific organization the user is associated with.

func (*OrganizationService) List

Lists organizations the user is associated with.

func (*OrganizationService) ListAutoPaging

Lists organizations the user is associated with.

type OrganizationStatus

type OrganizationStatus string

Whether the user is a member of the organization or has an inivitation pending.

const (
	OrganizationStatusMember  OrganizationStatus = "member"
	OrganizationStatusInvited OrganizationStatus = "invited"
)

func (OrganizationStatus) IsKnown

func (r OrganizationStatus) IsKnown() bool

type Permission

type Permission = shared.Permission

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 Policy

type Policy struct {
	// Policy identifier.
	ID string `json:"id,required"`
	// Allow or deny operations against the resources.
	Effect PolicyEffect `json:"effect,required"`
	// A set of permission groups that are specified to the policy.
	PermissionGroups []PolicyPermissionGroup `json:"permission_groups,required"`
	// A list of resource names that the policy applies to.
	Resources interface{} `json:"resources,required"`
	JSON      policyJSON  `json:"-"`
}

func (*Policy) UnmarshalJSON

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

type PolicyEffect

type PolicyEffect string

Allow or deny operations against the resources.

const (
	PolicyEffectAllow PolicyEffect = "allow"
	PolicyEffectDeny  PolicyEffect = "deny"
)

func (PolicyEffect) IsKnown

func (r PolicyEffect) IsKnown() bool

type PolicyParam

type PolicyParam struct {
	// Allow or deny operations against the resources.
	Effect param.Field[PolicyEffect] `json:"effect,required"`
	// A set of permission groups that are specified to the policy.
	PermissionGroups param.Field[[]PolicyPermissionGroupParam] `json:"permission_groups,required"`
	// A list of resource names that the policy applies to.
	Resources param.Field[interface{}] `json:"resources,required"`
}

func (PolicyParam) MarshalJSON

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

type PolicyPermissionGroup

type PolicyPermissionGroup struct {
	// Identifier of the group.
	ID string `json:"id,required"`
	// Name of the group.
	Name string                    `json:"name"`
	JSON policyPermissionGroupJSON `json:"-"`
}

A named group of permissions that map to a group of operations against resources.

func (*PolicyPermissionGroup) UnmarshalJSON

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

type PolicyPermissionGroupParam

type PolicyPermissionGroupParam struct {
}

A named group of permissions that map to a group of operations against resources.

func (PolicyPermissionGroupParam) MarshalJSON

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

type RatePlan

type RatePlan struct {
	// The ID of the rate plan.
	ID string `json:"id"`
	// The currency applied to the rate plan subscription.
	Currency string `json:"currency"`
	// Whether this rate plan is managed externally from Cloudflare.
	ExternallyManaged bool `json:"externally_managed"`
	// Whether a rate plan is enterprise-based (or newly adopted term contract).
	IsContract bool `json:"is_contract"`
	// The full name of the rate plan.
	PublicName string `json:"public_name"`
	// The scope that this rate plan applies to.
	Scope string `json:"scope"`
	// The list of sets this rate plan applies to.
	Sets []string     `json:"sets"`
	JSON ratePlanJSON `json:"-"`
}

The rate plan applied to the subscription.

func (*RatePlan) UnmarshalJSON

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

type RatePlanParam

type RatePlanParam struct {
	// The ID of the rate plan.
	ID param.Field[string] `json:"id"`
	// The currency applied to the rate plan subscription.
	Currency param.Field[string] `json:"currency"`
	// Whether this rate plan is managed externally from Cloudflare.
	ExternallyManaged param.Field[bool] `json:"externally_managed"`
	// Whether a rate plan is enterprise-based (or newly adopted term contract).
	IsContract param.Field[bool] `json:"is_contract"`
	// The full name of the rate plan.
	PublicName param.Field[string] `json:"public_name"`
	// The scope that this rate plan applies to.
	Scope param.Field[string] `json:"scope"`
	// The list of sets this rate plan applies to.
	Sets param.Field[[]string] `json:"sets"`
}

The rate plan applied to the subscription.

func (RatePlanParam) MarshalJSON

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

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type Subscription

type Subscription struct {
	// Subscription identifier tag.
	ID  string          `json:"id"`
	App SubscriptionApp `json:"app"`
	// The list of add-ons subscribed to.
	ComponentValues []SubscriptionComponent `json:"component_values"`
	// The monetary unit in which pricing information is displayed.
	Currency string `json:"currency"`
	// The end of the current period and also when the next billing is due.
	CurrentPeriodEnd time.Time `json:"current_period_end" format:"date-time"`
	// When the current billing period started. May match initial_period_start if this
	// is the first period.
	CurrentPeriodStart time.Time `json:"current_period_start" format:"date-time"`
	// How often the subscription is renewed automatically.
	Frequency SubscriptionFrequency `json:"frequency"`
	// The price of the subscription that will be billed, in US dollars.
	Price float64 `json:"price"`
	// The rate plan applied to the subscription.
	RatePlan RatePlan `json:"rate_plan"`
	// The state that the subscription is in.
	State SubscriptionState `json:"state"`
	// A simple zone object. May have null properties if not a zone subscription.
	Zone SubscriptionZone `json:"zone"`
	JSON subscriptionJSON `json:"-"`
}

func (*Subscription) UnmarshalJSON

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

type SubscriptionApp

type SubscriptionApp struct {
	// app install id.
	InstallID string              `json:"install_id"`
	JSON      subscriptionAppJSON `json:"-"`
}

func (*SubscriptionApp) UnmarshalJSON

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

type SubscriptionAppParam

type SubscriptionAppParam struct {
	// app install id.
	InstallID param.Field[string] `json:"install_id"`
}

func (SubscriptionAppParam) MarshalJSON

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

type SubscriptionComponent

type SubscriptionComponent struct {
	// The default amount assigned.
	Default float64 `json:"default"`
	// The name of the component value.
	Name string `json:"name"`
	// The unit price for the component value.
	Price float64 `json:"price"`
	// The amount of the component value assigned.
	Value float64                   `json:"value"`
	JSON  subscriptionComponentJSON `json:"-"`
}

A component value for a subscription.

func (*SubscriptionComponent) UnmarshalJSON

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

type SubscriptionComponentParam

type SubscriptionComponentParam struct {
	// The default amount assigned.
	Default param.Field[float64] `json:"default"`
	// The name of the component value.
	Name param.Field[string] `json:"name"`
	// The unit price for the component value.
	Price param.Field[float64] `json:"price"`
	// The amount of the component value assigned.
	Value param.Field[float64] `json:"value"`
}

A component value for a subscription.

func (SubscriptionComponentParam) MarshalJSON

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

type SubscriptionDeleteParams

type SubscriptionDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (SubscriptionDeleteParams) MarshalJSON

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

type SubscriptionDeleteResponse

type SubscriptionDeleteResponse struct {
	// Subscription identifier tag.
	SubscriptionID string                         `json:"subscription_id"`
	JSON           subscriptionDeleteResponseJSON `json:"-"`
}

func (*SubscriptionDeleteResponse) UnmarshalJSON

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

type SubscriptionEditParams

type SubscriptionEditParams struct {
	Subscription SubscriptionParam `json:"subscription,required"`
}

func (SubscriptionEditParams) MarshalJSON

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

type SubscriptionEditResponseEnvelope

type SubscriptionEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo         `json:"errors,required"`
	Messages []shared.ResponseInfo         `json:"messages,required"`
	Result   SubscriptionEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success SubscriptionEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    subscriptionEditResponseEnvelopeJSON    `json:"-"`
}

func (*SubscriptionEditResponseEnvelope) UnmarshalJSON

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

type SubscriptionEditResponseEnvelopeSuccess

type SubscriptionEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionEditResponseEnvelopeSuccessTrue SubscriptionEditResponseEnvelopeSuccess = true
)

func (SubscriptionEditResponseEnvelopeSuccess) IsKnown

type SubscriptionEditResponseUnion

type SubscriptionEditResponseUnion interface {
	ImplementsUserSubscriptionEditResponseUnion()
}

Union satisfied by user.SubscriptionEditResponseUnknown or shared.UnionString.

type SubscriptionFrequency

type SubscriptionFrequency string

How often the subscription is renewed automatically.

const (
	SubscriptionFrequencyWeekly    SubscriptionFrequency = "weekly"
	SubscriptionFrequencyMonthly   SubscriptionFrequency = "monthly"
	SubscriptionFrequencyQuarterly SubscriptionFrequency = "quarterly"
	SubscriptionFrequencyYearly    SubscriptionFrequency = "yearly"
)

func (SubscriptionFrequency) IsKnown

func (r SubscriptionFrequency) IsKnown() bool

type SubscriptionGetResponseEnvelope

type SubscriptionGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   []Subscription        `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    SubscriptionGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo SubscriptionGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       subscriptionGetResponseEnvelopeJSON       `json:"-"`
}

func (*SubscriptionGetResponseEnvelope) UnmarshalJSON

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

type SubscriptionGetResponseEnvelopeResultInfo

type SubscriptionGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                       `json:"total_count"`
	JSON       subscriptionGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*SubscriptionGetResponseEnvelopeResultInfo) UnmarshalJSON

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

type SubscriptionGetResponseEnvelopeSuccess

type SubscriptionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionGetResponseEnvelopeSuccessTrue SubscriptionGetResponseEnvelopeSuccess = true
)

func (SubscriptionGetResponseEnvelopeSuccess) IsKnown

type SubscriptionParam

type SubscriptionParam struct {
	App param.Field[SubscriptionAppParam] `json:"app"`
	// The list of add-ons subscribed to.
	ComponentValues param.Field[[]SubscriptionComponentParam] `json:"component_values"`
	// How often the subscription is renewed automatically.
	Frequency param.Field[SubscriptionFrequency] `json:"frequency"`
	// The rate plan applied to the subscription.
	RatePlan param.Field[RatePlanParam] `json:"rate_plan"`
	// A simple zone object. May have null properties if not a zone subscription.
	Zone param.Field[SubscriptionZoneParam] `json:"zone"`
}

func (SubscriptionParam) MarshalJSON

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

type SubscriptionService

type SubscriptionService struct {
	Options []option.RequestOption
}

SubscriptionService 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 NewSubscriptionService method instead.

func NewSubscriptionService

func NewSubscriptionService(opts ...option.RequestOption) (r *SubscriptionService)

NewSubscriptionService 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 (*SubscriptionService) Delete

Deletes a user's subscription.

func (*SubscriptionService) Edit

Updates zone subscriptions, either plan or add-ons.

func (*SubscriptionService) Get

func (r *SubscriptionService) Get(ctx context.Context, opts ...option.RequestOption) (res *[]Subscription, err error)

Lists all of a user's subscriptions.

func (*SubscriptionService) Update

Updates a user's subscriptions.

type SubscriptionState

type SubscriptionState string

The state that the subscription is in.

const (
	SubscriptionStateTrial           SubscriptionState = "Trial"
	SubscriptionStateProvisioned     SubscriptionState = "Provisioned"
	SubscriptionStatePaid            SubscriptionState = "Paid"
	SubscriptionStateAwaitingPayment SubscriptionState = "AwaitingPayment"
	SubscriptionStateCancelled       SubscriptionState = "Cancelled"
	SubscriptionStateFailed          SubscriptionState = "Failed"
	SubscriptionStateExpired         SubscriptionState = "Expired"
)

func (SubscriptionState) IsKnown

func (r SubscriptionState) IsKnown() bool

type SubscriptionUpdateParams

type SubscriptionUpdateParams struct {
	Subscription SubscriptionParam `json:"subscription,required"`
}

func (SubscriptionUpdateParams) MarshalJSON

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

type SubscriptionUpdateResponseEnvelope

type SubscriptionUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo           `json:"errors,required"`
	Messages []shared.ResponseInfo           `json:"messages,required"`
	Result   SubscriptionUpdateResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success SubscriptionUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    subscriptionUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*SubscriptionUpdateResponseEnvelope) UnmarshalJSON

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

type SubscriptionUpdateResponseEnvelopeSuccess

type SubscriptionUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionUpdateResponseEnvelopeSuccessTrue SubscriptionUpdateResponseEnvelopeSuccess = true
)

func (SubscriptionUpdateResponseEnvelopeSuccess) IsKnown

type SubscriptionUpdateResponseUnion

type SubscriptionUpdateResponseUnion interface {
	ImplementsUserSubscriptionUpdateResponseUnion()
}

Union satisfied by user.SubscriptionUpdateResponseUnknown or shared.UnionString.

type SubscriptionZone

type SubscriptionZone struct {
	// Identifier
	ID string `json:"id"`
	// The domain name
	Name string               `json:"name"`
	JSON subscriptionZoneJSON `json:"-"`
}

A simple zone object. May have null properties if not a zone subscription.

func (*SubscriptionZone) UnmarshalJSON

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

type SubscriptionZoneParam

type SubscriptionZoneParam struct {
}

A simple zone object. May have null properties if not a zone subscription.

func (SubscriptionZoneParam) MarshalJSON

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

type TokenConditionParam

type TokenConditionParam struct {
	// Client IP restrictions.
	RequestIP param.Field[TokenConditionRequestIPParam] `json:"request_ip"`
}

func (TokenConditionParam) MarshalJSON

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

type TokenConditionRequestIPParam

type TokenConditionRequestIPParam struct {
	// List of IPv4/IPv6 CIDR addresses.
	In param.Field[[]CIDRListParam] `json:"in"`
	// List of IPv4/IPv6 CIDR addresses.
	NotIn param.Field[[]CIDRListParam] `json:"not_in"`
}

Client IP restrictions.

func (TokenConditionRequestIPParam) MarshalJSON

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

type TokenDeleteParams

type TokenDeleteParams struct {
	Body interface{} `json:"body,required"`
}

func (TokenDeleteParams) MarshalJSON

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

type TokenDeleteResponse

type TokenDeleteResponse struct {
	// Identifier
	ID   string                  `json:"id,required"`
	JSON tokenDeleteResponseJSON `json:"-"`
}

func (*TokenDeleteResponse) UnmarshalJSON

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

type TokenDeleteResponseEnvelope

type TokenDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   TokenDeleteResponse   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success TokenDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*TokenDeleteResponseEnvelope) UnmarshalJSON

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

type TokenDeleteResponseEnvelopeSuccess

type TokenDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenDeleteResponseEnvelopeSuccessTrue TokenDeleteResponseEnvelopeSuccess = true
)

func (TokenDeleteResponseEnvelopeSuccess) IsKnown

type TokenGetResponseEnvelope

type TokenGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   TokenGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success TokenGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenGetResponseEnvelopeJSON    `json:"-"`
}

func (*TokenGetResponseEnvelope) UnmarshalJSON

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

type TokenGetResponseEnvelopeSuccess

type TokenGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenGetResponseEnvelopeSuccessTrue TokenGetResponseEnvelopeSuccess = true
)

func (TokenGetResponseEnvelopeSuccess) IsKnown

type TokenGetResponseUnion

type TokenGetResponseUnion interface {
	ImplementsUserTokenGetResponseUnion()
}

Union satisfied by user.TokenGetResponseUnknown or shared.UnionString.

type TokenListParams

type TokenListParams struct {
	// Direction to order results.
	Direction param.Field[TokenListParamsDirection] `query:"direction"`
	// 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 (TokenListParams) URLQuery

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

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

type TokenListParamsDirection

type TokenListParamsDirection string

Direction to order results.

const (
	TokenListParamsDirectionAsc  TokenListParamsDirection = "asc"
	TokenListParamsDirectionDesc TokenListParamsDirection = "desc"
)

func (TokenListParamsDirection) IsKnown

func (r TokenListParamsDirection) IsKnown() bool

type TokenListResponse

type TokenListResponse = interface{}

type TokenNewParams

type TokenNewParams struct {
	// Token name.
	Name param.Field[string] `json:"name,required"`
	// List of access policies assigned to the token.
	Policies  param.Field[[]PolicyParam]           `json:"policies,required"`
	Condition param.Field[TokenNewParamsCondition] `json:"condition"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"`
}

func (TokenNewParams) MarshalJSON

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

type TokenNewParamsCondition

type TokenNewParamsCondition struct {
	// Client IP restrictions.
	RequestIP param.Field[TokenNewParamsConditionRequestIP] `json:"request_ip"`
}

func (TokenNewParamsCondition) MarshalJSON

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

type TokenNewParamsConditionRequestIP

type TokenNewParamsConditionRequestIP struct {
	// List of IPv4/IPv6 CIDR addresses.
	In param.Field[[]CIDRListParam] `json:"in"`
	// List of IPv4/IPv6 CIDR addresses.
	NotIn param.Field[[]CIDRListParam] `json:"not_in"`
}

Client IP restrictions.

func (TokenNewParamsConditionRequestIP) MarshalJSON

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

type TokenNewResponse

type TokenNewResponse struct {
	// The token value.
	Value Value                `json:"value"`
	JSON  tokenNewResponseJSON `json:"-"`
}

func (*TokenNewResponse) UnmarshalJSON

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

type TokenNewResponseEnvelope

type TokenNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   TokenNewResponse      `json:"result,required"`
	// Whether the API call was successful
	Success TokenNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenNewResponseEnvelopeJSON    `json:"-"`
}

func (*TokenNewResponseEnvelope) UnmarshalJSON

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

type TokenNewResponseEnvelopeSuccess

type TokenNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
)

func (TokenNewResponseEnvelopeSuccess) IsKnown

type TokenParam

type TokenParam struct {
	// Token name.
	Name param.Field[string] `json:"name,required"`
	// List of access policies assigned to the token.
	Policies param.Field[[]PolicyParam] `json:"policies,required"`
	// Status of the token.
	Status    param.Field[TokenStatus]         `json:"status,required"`
	Condition param.Field[TokenConditionParam] `json:"condition"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"`
}

func (TokenParam) MarshalJSON

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

type TokenPermissionGroupListResponse

type TokenPermissionGroupListResponse = interface{}

type TokenPermissionGroupService

type TokenPermissionGroupService struct {
	Options []option.RequestOption
}

TokenPermissionGroupService 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 NewTokenPermissionGroupService method instead.

func NewTokenPermissionGroupService

func NewTokenPermissionGroupService(opts ...option.RequestOption) (r *TokenPermissionGroupService)

NewTokenPermissionGroupService 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 (*TokenPermissionGroupService) List

Find all available permission groups.

func (*TokenPermissionGroupService) ListAutoPaging

Find all available permission groups.

type TokenService

type TokenService struct {
	Options          []option.RequestOption
	PermissionGroups *TokenPermissionGroupService
	Value            *TokenValueService
}

TokenService 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 NewTokenService method instead.

func NewTokenService

func NewTokenService(opts ...option.RequestOption) (r *TokenService)

NewTokenService 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 (*TokenService) Delete

func (r *TokenService) Delete(ctx context.Context, tokenID interface{}, body TokenDeleteParams, opts ...option.RequestOption) (res *TokenDeleteResponse, err error)

Destroy a token.

func (*TokenService) Get

func (r *TokenService) Get(ctx context.Context, tokenID interface{}, opts ...option.RequestOption) (res *TokenGetResponseUnion, err error)

Get information about a specific token.

func (*TokenService) List

List all access tokens you created.

func (*TokenService) ListAutoPaging

List all access tokens you created.

func (*TokenService) New

func (r *TokenService) New(ctx context.Context, body TokenNewParams, opts ...option.RequestOption) (res *TokenNewResponse, err error)

Create a new access token.

func (*TokenService) Update

func (r *TokenService) Update(ctx context.Context, tokenID interface{}, body TokenUpdateParams, opts ...option.RequestOption) (res *TokenUpdateResponseUnion, err error)

Update an existing token.

func (*TokenService) Verify

func (r *TokenService) Verify(ctx context.Context, opts ...option.RequestOption) (res *TokenVerifyResponse, err error)

Test whether a token works.

type TokenStatus

type TokenStatus string

Status of the token.

const (
	TokenStatusActive   TokenStatus = "active"
	TokenStatusDisabled TokenStatus = "disabled"
	TokenStatusExpired  TokenStatus = "expired"
)

func (TokenStatus) IsKnown

func (r TokenStatus) IsKnown() bool

type TokenUpdateParams

type TokenUpdateParams struct {
	Token TokenParam `json:"token,required"`
}

func (TokenUpdateParams) MarshalJSON

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

type TokenUpdateResponseEnvelope

type TokenUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo    `json:"errors,required"`
	Messages []shared.ResponseInfo    `json:"messages,required"`
	Result   TokenUpdateResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success TokenUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*TokenUpdateResponseEnvelope) UnmarshalJSON

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

type TokenUpdateResponseEnvelopeSuccess

type TokenUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenUpdateResponseEnvelopeSuccessTrue TokenUpdateResponseEnvelopeSuccess = true
)

func (TokenUpdateResponseEnvelopeSuccess) IsKnown

type TokenUpdateResponseUnion

type TokenUpdateResponseUnion interface {
	ImplementsUserTokenUpdateResponseUnion()
}

Union satisfied by user.TokenUpdateResponseUnknown or shared.UnionString.

type TokenValueService

type TokenValueService struct {
	Options []option.RequestOption
}

TokenValueService 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 NewTokenValueService method instead.

func NewTokenValueService

func NewTokenValueService(opts ...option.RequestOption) (r *TokenValueService)

NewTokenValueService 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 (*TokenValueService) Update

func (r *TokenValueService) Update(ctx context.Context, tokenID interface{}, body TokenValueUpdateParams, opts ...option.RequestOption) (res *Value, err error)

Roll the token secret.

type TokenValueUpdateParams

type TokenValueUpdateParams struct {
	Body interface{} `json:"body,required"`
}

func (TokenValueUpdateParams) MarshalJSON

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

type TokenValueUpdateResponseEnvelope

type TokenValueUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// The token value.
	Result Value `json:"result,required"`
	// Whether the API call was successful
	Success TokenValueUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenValueUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*TokenValueUpdateResponseEnvelope) UnmarshalJSON

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

type TokenValueUpdateResponseEnvelopeSuccess

type TokenValueUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenValueUpdateResponseEnvelopeSuccessTrue TokenValueUpdateResponseEnvelopeSuccess = true
)

func (TokenValueUpdateResponseEnvelopeSuccess) IsKnown

type TokenVerifyResponse

type TokenVerifyResponse struct {
	// Token identifier tag.
	ID string `json:"id,required"`
	// Status of the token.
	Status TokenVerifyResponseStatus `json:"status,required"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn time.Time `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore time.Time               `json:"not_before" format:"date-time"`
	JSON      tokenVerifyResponseJSON `json:"-"`
}

func (*TokenVerifyResponse) UnmarshalJSON

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

type TokenVerifyResponseEnvelope

type TokenVerifyResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   TokenVerifyResponse   `json:"result,required"`
	// Whether the API call was successful
	Success TokenVerifyResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenVerifyResponseEnvelopeJSON    `json:"-"`
}

func (*TokenVerifyResponseEnvelope) UnmarshalJSON

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

type TokenVerifyResponseEnvelopeSuccess

type TokenVerifyResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenVerifyResponseEnvelopeSuccessTrue TokenVerifyResponseEnvelopeSuccess = true
)

func (TokenVerifyResponseEnvelopeSuccess) IsKnown

type TokenVerifyResponseStatus

type TokenVerifyResponseStatus string

Status of the token.

const (
	TokenVerifyResponseStatusActive   TokenVerifyResponseStatus = "active"
	TokenVerifyResponseStatusDisabled TokenVerifyResponseStatus = "disabled"
	TokenVerifyResponseStatusExpired  TokenVerifyResponseStatus = "expired"
)

func (TokenVerifyResponseStatus) IsKnown

func (r TokenVerifyResponseStatus) IsKnown() bool

type UserEditParams

type UserEditParams struct {
	// The country in which the user lives.
	Country param.Field[string] `json:"country"`
	// User's first name
	FirstName param.Field[string] `json:"first_name"`
	// User's last name
	LastName param.Field[string] `json:"last_name"`
	// User's telephone number
	Telephone param.Field[string] `json:"telephone"`
	// The zipcode or postal code where the user lives.
	Zipcode param.Field[string] `json:"zipcode"`
}

func (UserEditParams) MarshalJSON

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

type UserEditResponseEnvelope

type UserEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   UserEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success UserEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    userEditResponseEnvelopeJSON    `json:"-"`
}

func (*UserEditResponseEnvelope) UnmarshalJSON

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

type UserEditResponseEnvelopeSuccess

type UserEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UserEditResponseEnvelopeSuccessTrue UserEditResponseEnvelopeSuccess = true
)

func (UserEditResponseEnvelopeSuccess) IsKnown

type UserEditResponseUnion

type UserEditResponseUnion interface {
	ImplementsUserUserEditResponseUnion()
}

Union satisfied by user.UserEditResponseUnknown or shared.UnionString.

type UserGetResponseEnvelope

type UserGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   UserGetResponseUnion  `json:"result,required"`
	// Whether the API call was successful
	Success UserGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    userGetResponseEnvelopeJSON    `json:"-"`
}

func (*UserGetResponseEnvelope) UnmarshalJSON

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

type UserGetResponseEnvelopeSuccess

type UserGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UserGetResponseEnvelopeSuccessTrue UserGetResponseEnvelopeSuccess = true
)

func (UserGetResponseEnvelopeSuccess) IsKnown

type UserGetResponseUnion

type UserGetResponseUnion interface {
	ImplementsUserUserGetResponseUnion()
}

Union satisfied by user.UserGetResponseUnknown or shared.UnionString.

type UserService

type UserService struct {
	Options       []option.RequestOption
	AuditLogs     *AuditLogService
	Billing       *BillingService
	Invites       *InviteService
	Organizations *OrganizationService
	Subscriptions *SubscriptionService
	Tokens        *TokenService
}

UserService 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 NewUserService method instead.

func NewUserService

func NewUserService(opts ...option.RequestOption) (r *UserService)

NewUserService 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 (*UserService) Edit

func (r *UserService) Edit(ctx context.Context, body UserEditParams, opts ...option.RequestOption) (res *UserEditResponseUnion, err error)

Edit part of your user details.

func (*UserService) Get

func (r *UserService) Get(ctx context.Context, opts ...option.RequestOption) (res *UserGetResponseUnion, err error)

User Details

type Value

type Value = string

Jump to

Keyboard shortcuts

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